Commit Graph

4052 Commits

Author SHA1 Message Date
Digimer
6405483fea * Added a check to fence_pacemaker that exits with 7 if the target node is already out of the pacemaker cluster.
* Verified that the logic works in a 3-node (Anvil! + DR) cluster.

Signed-off-by: Digimer <digimer@alteeve.ca>
2018-02-11 02:45:56 -05:00
Digimer
26f956e429 * Much more work done on the fence handler. How able to sanity check most of the pacemaker side of things and have the framing done for sanity checking DRBD.
Signed-off-by: Digimer <digimer@alteeve.ca>
2018-02-08 02:03:36 -05:00
Digimer
806b452d10 Merge branch 'master' of github.com:digimer/m3
Signed-off-by: Digimer <digimer@alteeve.ca>
2018-02-07 12:11:21 -05:00
Digimer
ced92139b1 * Added the new (and still very much in progress) 'fence_pacemaker' fence handler for power-fencing via DRBD.
* Updated dev notes.

Signed-off-by: Digimer <digimer@alteeve.ca>
2018-02-07 03:36:49 -05:00
Digimer
fe4a1d5a1c * Working on timing for DB connections.
* Created a new tool (that may go away) for monitoring for network changes as quickly and with as few resources as possible.

Signed-off-by: Digimer <digimer@alteeve.ca>
2018-01-17 15:10:07 -06:00
Digimer
f72d8e0f70 * Added a version file and Tools->_anvil_version() which reports the version in it.
* Added Get->anvil_version() to check the local or remote Anvil! version.
* Added a check in Database->connect() to see if a database server's Anvil! version matches the local version. If the versions don't match, the database is not used.

Signed-off-by: Digimer <digimer@alteeve.ca>
2018-01-04 01:29:05 -08:00
Digimer
2170c00add * Added the 'debug' parameter to System->check_alert_sent. Also updated it to use 'alert_sent_uuid'.
* Added the 'debug' parameter to System->enable_daemon.
* Fixed a bug where the old 'Tools.sql' files was being referenced instead of the new 'anvil.sql'.
* Added the 'debug' parameter to Database->initialize and Database->write. Also made it enable the postgresql daemon when initializing the DB.
* Added the 'debug' parameter to Get->host_uuid.
* Fixed the old anvil.conf variable from defaults::log::db_transactions to sys::database::log_transactions.
* Fixed a bad replacement variable name in anvil.sql.

Signed-off-by: Digimer <digimer@alteeve.ca>
2017-12-27 13:01:58 -04:00
Digimer
4e30f2024c * Changed tabs to white-spaces in the SQL source to make copy/pasting easier.
Signed-off-by: Digimer <digimer@alteeve.ca>
2017-12-27 02:43:32 -04:00
Digimer
f1bd4b99ca * Fixed more issues with anvil-prep-database.
* Added the 'debug' parameter to System->call(). Also added a check to make sure that the called executable exists.
* Added the 'debug' parameter to System->start_daemon().

Signed-off-by: Digimer <digimer@alteeve.ca>
2017-12-27 00:45:59 -04:00
Digimer
d864bd6dac * Moved words.xml to /usr/share/anvil/
* Moved all executables to /usr/sbin/
* Made /root/anvil-backups/ the backup directory.
* Started debuging anvil-prep-database

Signed-off-by: Digimer <digimer@alteeve.ca>
2017-12-26 14:12:59 -04:00
Digimer
d03213b860 * Fixed some string and path issues from the 'anvil' merger.
* Added a 'debug' parameter to System->ping() to allow per-call log levels.

Signed-off-by: Digimer <digimer@alteeve.ca>
2017-12-24 01:49:57 -04:00
Digimer
665f2217d9 * Added 'jobs' to the core tables list.
Signed-off-by: Digimer <digimer@alteeve.ca>
2017-12-15 16:33:35 -05:00
Digimer
5d78ca6624 * Finished (but still need to test) Database->insert_or_update_jobs();
Signed-off-by: Digimer <digimer@alteeve.ca>
2017-12-15 16:32:01 -05:00
Digimer
5976e7ea32 * Adding a new Database->insert_or_update_jobs() method and associated database tables.
* Fixed display issues when showing a summary of what will be done if the user confirms the reconfiguration of the Striker.

Signed-off-by: Digimer <digimer@alteeve.ca>
2017-12-13 11:40:50 -05:00
Digimer
9648e8ba43 * Create tools/anvil-jobs and units/anvil-jobs.service, which is a new daemon that will handle jobs that can take some time to finish.
* Created Storage->record_md5sums() and Storage->check_md5sums for use in daemons. These will record the md5sums of the program itself, all perl modules and the words file. When check_md5sums is called, it returns '1' if any sums have changed, which daemons can trigger on to exit (and systemd will restart them). Removed the basic md5sum check from anvil-daemon and switched to this.
* Fixed how 'fatalstobrowsers' is invoked so that it only applies to programs running in a browser.

Signed-off-by: Digimer <digimer@alteeve.ca>
2017-12-08 17:04:36 -05:00
Digimer
bb48c090a7 * Created Get->md5sum() to return the md5sum of the specified file.
* Updated anvil-daemon to exit if the md5sum on disk changes.
* Quieted a lot of logging.

Signed-off-by: Digimer <digimer@alteeve.ca>
2017-12-07 18:42:48 -05:00
Digimer
8e5e5b07d3 * Moved the buffer disable up the script.
Signed-off-by: Digimer <digimer@alteeve.ca>
2017-11-01 00:33:41 -04:00
Digimer
9e4414613b * Added a check to exit if no DBs were available in tools/anvil-update-states.
Signed-off-by: Digimer <digimer@alteeve.ca>
2017-10-20 13:53:01 -04:00
Digimer
1c3b3c2c9e * Fixed a bug in calling ethtool in tools/anvil-update-states and added conditionals to reading the data files.
Signed-off-by: Digimer <digimer@alteeve.ca>
2017-10-20 13:45:55 -04:00
Digimer
2b9c6c26dc * Fixed a couple remaining issues from the recent merger. Specifically, '$$anvil' was fixed from a bad regex and the path/names of our tools were fixed.
Signed-off-by: Digimer <digimer@alteeve.ca>
2017-10-20 11:13:00 -04:00
Digimer
db8632ca1b * Fixed a couple problems with 'home' from the namespace update.
Signed-off-by: Digimer <digimer@alteeve.ca>
2017-10-20 00:32:05 -04:00
Digimer
1cb42080c3 ** Major Changes **
We've decided to give up on trying to keep ScanCore, AN::Tools and Striker as three separate things. We had originally hoped to make ScanCore easily separatable from the Anvil!, but this was adding increasing complexity to the project and complexity is the enemy of reliability.

In this release, AN::Tools becomes Anvil::Tools, all configuration files move to /etc/anvil and all programs and data files move to /usr/sbin/anvil. Words files are now merged, as are SQL schemas (ScanCore agents will still maintain their own, later). The journald tag has changed from 'an-tools' to 'anvil'.

Other changes;
* Tools.t has been updated to handle existing tests. New methods and parameters still need to have tests added though.
* Added a simple test.pl script used for testing things outside the main program. It will be removed before final release.
* Added the simple 'watch_logs' bash script to more easily tail output.

Signed-off-by: Digimer <digimer@alteeve.ca>
2017-10-20 00:19:32 -04:00
Digimer
ee7b68bfb5 * Moved the logic to write the host UUID cache into Get->host_uuid().
Signed-off-by: Digimer <digimer@alteeve.ca>
2017-10-19 13:20:01 -04:00
Digimer
ca417c7c84 * Added perl-DBD-Pg to the dependency list in notes.
Signed-off-by: Digimer <digimer@alteeve.ca>
2017-10-19 12:17:40 -04:00
Digimer
261addf153 Merge pull request #1 from cc452/patch-1
Fixed typo on last two perl dependency packages
2017-10-19 12:16:56 -04:00
Chris Johnson
dbca9cd4df Fixed typo on last two perl dependency packages 2017-10-19 11:47:57 -04:00
Digimer
286b145434 * Added a general purpose 'notes' file.
Signed-off-by: Digimer <digimer@alteeve.ca>
2017-10-19 11:30:07 -04:00
Digimer
eed06bdb22 * Created a dedicated loop for processes that need to run each time tools/scancore-daemon loops.
Signed-off-by: Digimer <digimer@alteeve.ca>
2017-10-18 11:27:57 -04:00
Digimer
886331c756 * Created the new System->get_ips method which records IP addresses, subnet masks and MAC addresses of interfaces as reported by 'ip addr'.
* Finished the form for showing the user what changes will be made.

Signed-off-by: Digimer <digimer@alteeve.ca>
2017-10-12 18:34:41 -04:00
Digimer
27fe291524 * Started work on config_step3.
* Reworked step 2 to allow for empty DNS and empty gateway fields.
* Step2 now loads previous answers from the database properly.
* Fixed (the lack of) recording each network's IP and subnet to the database.
* Added (and disabled for now) a jquery feature for clearing the variables from the URL to keep it from getting exceptionally long.

Signed-off-by: Digimer <digimer@alteeve.ca>
2017-10-11 01:20:03 -04:00
Digimer
8a2c97c6c5 * Added a check to determine if the defined gateway in config step 2 matches one of the network and throws and error if not.
* Record step2 answers into the database.
* Added back hidden for values in config step 2 that recorded step 1's answers.

Signed-off-by: Digimer <digimer@alteeve.ca>
2017-10-10 02:33:58 -04:00
Digimer
bb89254207 * Added an undocumented (does this count?) parameter 'log_level' to Database->insert_or_update_variables() to allow per-call logging levels.
* Created Validate->form_field() which makes it a little quicker/easier to sanity check a form field that uses one of the other Validate methods.
* Added Validate->is_mac to validate MAC addresses.
* Got config_step2 finishes and sanity checked.

Signed-off-by: Digimer <digimer@alteeve.ca>
2017-10-08 02:54:10 -04:00
Digimer
3d385a5731 * Updated the configuration step 2 to properly show interface link changes again (had to add the network status XML generator back), and added displaying the 'up order', which tells the order that interfaces last cycles. This allows a user to unplug and plug the network cables in without watching the screen and be able to determine which interfaces cycled in a given order. This makes it easier to map MAC addresses to desired roles.
Signed-off-by: Digimer <digimer@alteeve.ca>
2017-10-05 00:20:36 -04:00
Digimer
fa11459543 * Updated Log->entry to use the new Log::Journald method, which improved writing to log speed at high log levels dramatically (ie: 33 seconds -> 1 seconds).
* Started using Time::HiRes and recording the run time of programs using AN::Tools at log level 2.
* Added a check in tools/an-prep-database to write journald.conf.d/an.conf to disable rate limiting to allow high log levels without losing messages.

Signed-off-by: Digimer <digimer@alteeve.ca>
2017-10-04 02:11:03 -04:00
Digimer
1e7fe44c23 * Updated Get->host_uuid to record the UUID to a cache file when run with root privs, but read from the cache when an unpriv user.
* Added a start-check to make sure 'home' could read the host UUID and exit if not.
* Removed network_interface_current_name / network_interface_requested_name from the network_interfaces DB table and used simply network_interface_name.
* Added caching to Storage->read_file().
* Now record form answers in the variables table as 'form::<form_name>::<variable>::value' and read the same when the form is first loaded.

Signed-off-by: Digimer <digimer@alteeve.ca>
2017-09-27 03:24:27 -04:00
Digimer
96670756ab * Created Database->insert_or_update_network_interfaces to handle pushing data into update_network_interfaces.
* Updated Database->connect to always test if hosts table exists and load the core schema if not.
* Fixed Database->write to log all SQL when 'sys::database::log_transactions' is set.
* Got tools/scancore-update-states scanning and recording network interface data to the database. Also removed it writing out the XML status file.

Signed-off-by: Digimer <digimer@alteeve.ca>
2017-09-22 00:56:35 -04:00
Digimer
65636100c6 * Adding support of network routing to config page2.
Signed-off-by: Digimer <digimer@alteeve.ca>
2017-09-17 10:49:10 -04:00
Digimer
30f87cd7c4 * Created Template->select_form() that builds a <select> form entry based on the old Web->build_select from v2.
* Finished config step 2's menus, including adding back the auto-updating network state form.

Signed-off-by: Digimer <digimer@alteeve.ca>
2017-09-10 23:47:31 +01:00
Digimer
20d3f0e90b * Got some more work done on config_stage2. Working on sanity checking requested IFNs versus available interfaces.
Signed-off-by: Digimer <digimer@alteeve.ca>
2017-09-07 14:55:21 +02:00
Digimer
c4a857e8d8 * Created Validate->is_alphanumeric, ->is_domain_name and ->is_positive_integer.
* In 'home', finished 'config_step1' sanity checks and framed up the base for step 2.

Signed-off-by: Digimer <digimer@alteeve.ca>
2017-09-05 14:55:48 +02:00
Digimer
3ac52e1724 * Added binary uploading to Get->cgi and moved the variable store to 'cgi::<variable>::value'. Also added "pretty" variable logging for passed-in CGI variables.
* Added fields for domain and sequence to config_step1 in 'home' CGI script.

Signed-off-by: Digimer <digimer@alteeve.ca>
2017-09-05 10:38:25 +02:00
Digimer
c962a9ac79 * Added the loading of the CGI module when the environment is set to 'html'.
* Added a check to Database->archive_database() to return immediately if the check_tables array is empty.
* Created the new Get->cgi() method that reads in CGI variables (as set by the special 'cgi_list' variable).
* Got more work done on the config_step1 funtions.

Signed-off-by: Digimer <digimer@alteeve.ca>
2017-09-04 17:10:02 +02:00
Digimer
fdc8850dfe * A touch of work on the new Striker setup questionair.
Signed-off-by: Digimer <digimer@alteeve.ca>
2017-08-29 19:24:32 -04:00
Digimer
0acb2c8e18 * Starting work on the Striker configuration workflow.
Signed-off-by: Digimer <digimer@alteeve.ca>
2017-08-24 23:58:14 -04:00
Digimer
692e3a1d97 * Started work on the database archiving method, but won't be continuing it until enough data is being collected to have a working data set.
Signed-off-by: Digimer <digimer@alteeve.ca>
2017-08-23 02:45:10 -04:00
Digimer
0af03deca9 * Fixed a problem with resync'ing a table with a host_uuid column.
* Added a missing column to 'history.states'.

Signed-off-by: Digimer <digimer@alteeve.ca>
2017-08-22 02:54:21 -04:00
Digimer
e68ebe31a0 * Fixed a problem in the resync code where differing time zones on two DB servers caused their time stamps to appear different.
* Fixed a pronlem where I entered into the check for missing records before reading the data from all the DBs.

Signed-off-by: Digimer <digimer@alteeve.ca>
2017-08-22 02:30:34 -04:00
Digimer
1d1258e8b5 * Resync'ing tables works!! (Well, kind of, loooots more testing needed).
Signed-off-by: Digimer <digimer@alteeve.ca>
2017-08-21 21:41:18 -04:00
Digimer
1aefa7fb8a * Made more progress on the resync code.
* Added notes on SQL table requirements.
* Added the ability to sort columns in Log->variables.

Signed-off-by: Digimer <digimer@alteeve.ca>
2017-08-21 03:51:44 -04:00
Digimer
21694716e8 * Made more progress on the automatic DB resync code. It now pulls the table columns and reads the data from the DB.
Signed-off-by: Digimer <digimer@alteeve.ca>
2017-08-20 03:36:33 -04:00