You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently the plan is to drop existing tables before recreating them each time the application is run. At some point the hope is to synchronize database changes instead of brute force destroying/recreating the data each time.
An intermediate step is to validate the SQLite database tables and skip recreating them if they already contain 1:1 the data found in the source MySQL database. Since this functionality is being written for the Nagios plugin, it could be refactored and made available to the base binary to execute before attempting to recreate the SQLite database tables.
The text was updated successfully, but these errors were encountered:
An intermediate step is to validate the SQLite database tables and skip recreating them if they already contain 1:1 the data found in the source MySQL database
I ended up writing a shell script that checks the exit code of the Nagios plugin, then only regenerates the SQLite database if a WARNING result was returned from the Nagios plugin. Otherwise, it logs a "no need" style message and exits successfully.
I'm not sure yet if this functionality is needed in the base application, or if keeping it in the wrapper script is a valid choice.
I ended up writing a shell script that checks the exit code of the Nagios plugin, then only regenerates the SQLite database if a WARNING result was returned from the Nagios plugin. Otherwise, it logs a "no need" style message and exits successfully.
When deploying the binaries from this project on a new system, I was "surprised" (quickly; how we forget) that the wrapper script used to generate the SQLite database requires either an OK or WARNING state as a response from the Nagios plugin. If a CRITICAL state is returned (e.g., the database file is missing or empty) the mysql2sqlite binary is never called. On a fresh system, this leads to a sort of dependency loop.
The workaround is to run the mysql2sqlite binary once manually to bootstrap the process. This "bootstrapping" needs to be documented.
Currently the plan is to drop existing tables before recreating them each time the application is run. At some point the hope is to synchronize database changes instead of brute force destroying/recreating the data each time.
An intermediate step is to validate the SQLite database tables and skip recreating them if they already contain 1:1 the data found in the source MySQL database. Since this functionality is being written for the Nagios plugin, it could be refactored and made available to the base binary to execute before attempting to recreate the SQLite database tables.
The text was updated successfully, but these errors were encountered: