Commit Graph

815 Commits

Author SHA1 Message Date
Tsu-ba-me
7c1e6e7c87 fix(cgi-bin): add proper error messages when given invalid UUID(s) 2021-06-01 14:13:29 -04:00
Tsu-ba-me
1ec32bfbaf fix(cgi-bin): filled in logic to power on/off target host(s) 2021-06-01 14:13:29 -04:00
Tsu-ba-me
12113e1dda fix(cgi-bin): parse set_power request body to get parameters 2021-06-01 14:13:29 -04:00
Tsu-ba-me
869a5ec807 fix(share): add error template 0304 for request body parse failure 2021-06-01 14:13:29 -04:00
Tsu-ba-me
3ae54037ea fix(cgi-bin): improve verbosity in set_power 2021-06-01 14:13:29 -04:00
Tsu-ba-me
a8571863be fix(cgi-bin): add subs to handle set anvil/host power 2021-06-01 14:13:29 -04:00
digimer-bot
5903cb2921
Merge pull request #105 from ClusterLabs/anvil-tools-dev
* Updated System->configure_ipmi to pull the machine from the anvils …
2021-05-31 21:01:26 -04:00
Digimer
78f3fb7b10 * Updated System->configure_ipmi to pull the machine from the anvils table instead of looking for the original job, which isn't useful now that we purge old jobs.
* Shortened up the log messages in scan-drbd

Signed-off-by: Digimer <digimer@alteeve.ca>
2021-05-31 20:49:14 -04:00
digimer-bot
628c31a278
Merge pull request #104 from ClusterLabs/anvil-tools-dev
* Biggest change in this commit; scan-apc-pdu and scan-apc-ups now on…
2021-05-31 14:15:36 -04:00
Digimer
f3a6d2eec3
Merge branch 'master' into anvil-tools-dev 2021-05-31 13:40:38 -04:00
Digimer
4dcd505753 * Biggest change in this commit; scan-apc-pdu and scan-apc-ups now only run on Striker dashboards! This was because we found that if two machines ran their agents at the same time, the reponce time from SNMP read requests grew a lot. This meant it was likely a third, fourth and so on machne would also then have their scan agent runs while the existing runs were still trying to process, causing the SNMP reads to get slower still until timeouts popped.
* Bumped scancore's scan delay from 30 seconds to 60.
* Shorted the age-out time to 24 hours and again boosted the archive thresholds. As we get a feel for the amount of data collected on multi-Anvil! systems over time, we may continue to tune this.l
* Moved Database->archive_database() to be called daily by anvil-daemon, instead of during '->connect' calls.
* Added locking to Database->_age_out_data to avoid resyncs mid-purge. Also moved the power, temperature and ip_address columns into the same 'to_clean' hash as it was duplicate logic.

Signed-off-by: Digimer <digimer@alteeve.ca>
2021-05-31 13:34:49 -04:00
digimer-bot
6de1824fe7
Merge pull request #102 from ClusterLabs/anvil-tools-dev
The theme of this commit is database cleanup and fixes.
2021-05-30 15:25:43 -04:00
Digimer
8807915bb7 The theme of this commit is database cleanup and fixes.
* Updated Database->_age_out_data() to check for certain scan agent tables and, for those found, purge out old records. This should go a long way to keeping the database data responsive.
* Fixed a bug in Jobs->update_progress() where the 'job_picked_up_by' column was being set to '0' instead of '$$' when clearing the job.
* Fixed a bug in System->update_hosts() where '127.0.0.1' would be used in hosts for the actual host name.
* Updated the default trigger, count and division values in anvil.conf to 100,000, 50,000 and 75,000 respectively. In combination with the aging of data, this should go a long way to minimizing database sizes and overheads.
* Updated anvil-daemon to call $anvil->Database->_age_out_data(); in it's daily tasks.
* Updated various striker-X tools to specifically request a DB resync on Database->connect calls.

Signed-off-by: Digimer <digimer@alteeve.ca>
2021-05-30 15:16:25 -04:00
digimer-bot
b862ff4895
Merge pull request #101 from ClusterLabs/scancore-debugging
The theme of these commits is improving DB responsiveness.
2021-05-29 23:51:46 -04:00
Digimer
6abe06f125 The theme of these commits is improving DB responsiveness.
* Created Database->_age_out_data() to delete records from the database that are old enough to no longer be useful. This is designed to significantly reduce the size of the database, allowing a better focus on performance.
* Changed Database->connect() to default to NOT check for resync, reworking the old 'no_resync' to 'check_for_resync', so that resync checks happen on demard, instead of by default.
* Updated get_tables_from_schema() to now allow 'schema_file' to be set to 'all', which then loads the schema files of all scan agents as well as the core anvil schema file. Fixed a bug where commented out tables were being counted.
* Re-enabled triggering resyncs on 'last_updated' differences.
* Fixed a bug in scan-ipmitool where the history_id column in history.scan_ipmitool_value was incorrect.
* Created a new tool called striker-show-db-counts that shows the number of records in all public and history schema tables for all databases.
* Updated anvil-update-states to detect when a libvirtd NAT'ed bridge exists and to delete it when found.

Signed-off-by: Digimer <digimer@alteeve.ca>
2021-05-29 23:34:22 -04:00
digimer-bot
7623b9df87
Merge pull request #98 from ClusterLabs/anvil-tools-dev
* Fixed a bug in anvil-join-anvil where the desired DNS servers were …
2021-05-27 17:44:09 -04:00
Digimer
49a700d68f * Fixed a bug in anvil-join-anvil where the desired DNS servers were not matching existing list of used DNS servers, even when they are the same already.
Signed-off-by: Digimer <digimer@alteeve.ca>
2021-05-27 17:36:12 -04:00
digimer-bot
952a4a85cd
Merge pull request #97 from ClusterLabs/bond-monitor
* Created a new tool, anvil-watch-bonds, which is a live monitor of b…
2021-05-26 20:33:28 -04:00
Digimer
1c02dbdaa8
Merge branch 'master' into bond-monitor 2021-05-26 20:30:23 -04:00
Digimer
bbad058b33 * Created a new tool, anvil-watch-bonds, which is a live monitor of bonds and interfaces designed to be run from the command line on a given host.
* Created Words->center_text that takes a string (or string key) and centers it to a given string length, padding white spaces on either side of the string as needed.

Signed-off-by: Digimer <digimer@alteeve.ca>
2021-05-26 20:24:05 -04:00
digimer-bot
c5f8cc9f7c
Merge pull request #96 from ClusterLabs/anvil-tools-dev
* Fixed a bug where 'timeout' would repeatedly get added to drbd's gl…
2021-05-24 20:17:32 -04:00
Digimer
d155c2eb66 * Fixed a bug where 'timeout' would repeatedly get added to drbd's global-common.conf file.
Signed-off-by: Digimer <digimer@alteeve.ca>
2021-05-24 20:03:17 -04:00
digimer-bot
992143ef1b
Merge pull request #95 from ClusterLabs/anvil-tools-dev
* Created the function check_daemons() in anvil-daemon to check that …
2021-05-24 15:38:13 -04:00
Digimer
ff65712fd9 * Created the function check_daemons() in anvil-daemon to check that needed daemons are running when it starts. This was specifically added to address a periodic issue with machines booting without NetworkManager running.
Signed-off-by: Digimer <digimer@alteeve.ca>
2021-05-24 15:27:10 -04:00
digimer-bot
7495950b83
Merge pull request #94 from ClusterLabs/anvil-tools-dev
* Updated remainder pointers to the old repos to the new repos. Added…
2021-05-24 14:40:01 -04:00
Digimer
42ffc200bc * Updated remainder pointers to the old repos to the new repos. Added support for the new alteeve-repo-setup.
* Removed the checks for resync that limited resyncs on jobs and variables tables. That approach to minimize unnecessary resyncshas proven faulty, will find another way later.

Signed-off-by: Digimer <digimer@alteeve.ca>
2021-05-24 14:34:15 -04:00
digimer-bot
667eaa67fe
Merge pull request #93 from ClusterLabs/startup-fixes
* Several bugs fixed and enhancements;
2021-05-24 00:21:28 -04:00
Digimer
41cd1e0319 * Several bugs fixed and enhancements;
* DRBD is now configured to a ping-timeout of 3 seconds.
* Created Log->switches() that returnes the command line switches used by Anvil! tool command line calls based on the active log levels / secure logging. Appended this to all invocations of our tools.
* Updated Database->resync_databases() to now only skip 'jobs' and 'variables' tables with less than 10 record differences. All other differences will trigger a resync.
* Created System->_check_anvil_conf() that, as you might guess, checks in anvil.conf exists and created it (using defaults), if not. It also checks to see if the 'admin' group and user exists and creates them, if not.
* Updated anvil-daemon to check anvil.conf on start up and in each loop. Created the function check_journald() that checks (and sets, if needed) that journald logging is persistent.
* Made striker-manage-peers to check_if_configured on the Database->connect() when updating anvil.conf and the target UUID is the local machine. Also created a loop to make the reconnection a lot more robust.

Signed-off-by: Digimer <digimer@alteeve.ca>
2021-05-24 00:09:32 -04:00
digimer-bot
a90782bfdd
Merge pull request #92 from ClusterLabs/anvil-tools-dev
* Fixed (another) bug in Database->_archive_table() that was preventi…
2021-05-22 13:33:06 -04:00
Digimer
2f8becbb11 * Fixed (another) bug in Database->_archive_table() that was preventing Database.pm from compiling.
Signed-off-by: Digimer <digimer@alteeve.ca>
2021-05-22 13:30:16 -04:00
digimer-bot
7cea567817
Merge pull request #91 from ClusterLabs/anvil-tools-dev
* Fixed a missing semi-colon that broke Database.pm.
2021-05-22 13:00:48 -04:00
Digimer
49890762b9 * Fixed a missing semi-colon that broke Database.pm.
Signed-off-by: Digimer <digimer@alteeve.ca>
2021-05-22 12:53:49 -04:00
digimer-bot
67c73cdef5
Merge pull request #90 from ClusterLabs/anvil-tools-dev
Anvil tools dev
2021-05-22 12:34:16 -04:00
Digimer
995edd321f
Merge branch 'master' into anvil-tools-dev 2021-05-22 12:29:58 -04:00
Digimer
a846f9ecbc * Fix to the database resync logic. The previous change to only resync if 10+ lines differed broke striker-manage-peers as the difference in host counts is what triggered the pairing of strikers.
Signed-off-by: Digimer <digimer@alteeve.ca>
2021-05-22 12:25:29 -04:00
Digimer
41d528418d * Increased the trigger point for database archiving. The current values were too low and cuasing frequent archive -> resync cycles.
* Fixed a bug in that archiving defaulting to not store on disk was not working properly. Now acts as described in anvil.conf.

Signed-off-by: Digimer <digimer@alteeve.ca>
2021-05-22 11:57:29 -04:00
digimer-bot
ce8fd02228
Merge pull request #89 from ClusterLabs/anvil-tools-dev
Anvil tools dev
2021-05-20 00:30:44 -04:00
Digimer
48956d94fb * Fixed anvil-manage-system file name in Makefile.
Signed-off-by: Digimer <digimer@alteeve.ca>
2021-05-20 00:27:34 -04:00
Digimer
fc0954d0c8 * Started work on, but not at all finished, anvil-manage-server which will allow manipulation of a server's resources.
* Changed the alteeve repo RPM to the new cimmunity/enterprise repo
* Fixed a bug where 'fence_data::updated' was causing the fences web page to break.
* Fixed a bug in Database->insert_or_update_network_interfaces() where certain interfaces were being repeatedly added to the database.
* Fixed a bug in Database->_find_behind_databases() was marking DBs as behind even though they had less than 10 columns off.
* Fixed a bug in Get->host_name() where, if the host name was changed on disk but the environment variable was still the old name, it would cause the hostname to waffle back and forth and cause constant updated to /etc/hosts.

Signed-off-by: Digimer <digimer@alteeve.ca>
2021-05-20 00:16:09 -04:00
Digimer
ad4a1ecc78 * Increaded the scancore agent run timeout to 60 seconds.
* Updated anvil-safe-start to start DRBD resources when the peer's DRBD resourcs is 'Connecting',
* Updated fence_pacemaker to more intelligently check the list of host names related to an IP address when looking for the peer host name

Signed-off-by: Digimer <digimer@alteeve.ca>
2021-05-15 00:12:43 -04:00
digimer-bot
c2b57ca3c8
Merge pull request #87 from ClusterLabs/anvil-tools-dev
Anvil tools dev
2021-05-13 23:46:37 -04:00
Digimer
473c728117 * Updated scan-ipmitool to use 'jump' thresholds for a common sensor name where duplicates with the hex address appended may exist.
Signed-off-by: Digimer <digimer@alteeve.ca>
2021-05-13 23:40:50 -04:00
Digimer
44864ce321 * Updated Database->resync_databases() to set a default schema of 'public'. Also fixed a bug where, when the difference in record numbers between two line was > 999, it would not trigger a resync.
* Updated the scan agent timeout to 60 seconds. Also made the scan agent exit code log entries more helpful.
* Updated System->collect_ipmi_data() to now better handle duplicate sensor names. Now, instead of simply appending an integer, we find the hex address and use that in the sensor name when duplicates exist. This solves the problem of the sensor names not being consistently shown in order.
* Fixed message bugs (bad variable insertions) in scan-apc-pdu and scan-apc-ups.
* Fixed schema procedure bugs in the 'temperature' and 'ip_address' tables where the columns were in bad order, causing constanty updates.

Incomplete work;
* Create the shell of 'anvil-manage-storage', but virtually no logic exists in it yet.
* Started work on anvil-safe-start to deal with an issue where DRBD resources don't start when a server is running on a peer.

Signed-off-by: Digimer <digimer@alteeve.ca>
2021-05-13 23:27:38 -04:00
digimer-bot
4382dc8370
Merge pull request #86 from ClusterLabs/scancore-debugging
* Renamed tools/striker-purge-host to tools/striker-purge-target and …
2021-05-11 14:28:34 -04:00
Digimer
309aa13684 * Updated the name of striker-purge-target in the makefile.
Signed-off-by: Digimer <digimer@alteeve.ca>
2021-05-11 14:25:27 -04:00
Digimer
7abbc938af * Renamed tools/striker-purge-host to tools/striker-purge-target and moved the code from test.pl over to it. No longer provides interactive selection, but now does work with Anvil! systems as well as hosts.
* Fixed a bug in Database->get_tables_from_schema where history.X and X tables were being stored in the table list.
* Updated ocf:alteeve:server to no do resyncs on DB connect.

Signed-off-by: Digimer <digimer@alteeve.ca>
2021-05-11 14:14:00 -04:00
digimer-bot
95159d4492
Merge pull request #85 from ClusterLabs/scancore-debugging
* Fixed a bug where the log message for a changed CIB wasn't useful.
2021-05-08 13:47:05 -04:00
Digimer
f833c311ba * To address issues with scancore debugging, we needed a tool to purge old anvils and hosts from the database. The 'test.pl' in this commit contains the new logic that will be merged into tools/striker-purge-host shortly.
* Created Database->find_host_uuid_columns() and ->_find_column() to create a list of tables and column names in the proper order to allow deletion of foreign keys to that deeply nested primary keys can be deleted. Specifically, this was meant for hosts -> host_uuid and anvils -> anvil_uuid, though it should work for other tables.
* Updated html/jquery-ui-1.12.1/package.json to address CVE-2020-7729
* Fixed a bug in the temperature table's history procedure where temperature_weight wasn't being copied.
* Updated anvil-provision-server to support '--anvil' that can take either the anvil-uuid or anvil-name.
* Updated anvil-safe-stop to default the stop-reason to 'user'.

Signed-off-by: Digimer <digimer@alteeve.ca>
2021-05-08 02:02:46 -04:00
Digimer
3fb81c1a0a * Updated Convert->time() to silently return if the given time was '--'.
* Added a new parameter to Database->connect() called 'no_resync' that, if set, prevents a resync check being performed. Updated ->resync_databases() to find a uuid_column where the table name ends in 'ies' and the UUID column is 'y_uuid'. Updated ->resync_databases() to not fire on updated table age anymore, and to trigger only if the number of rows differ in a given table by more than 10.
* Updated Log->entry() to prefix a tool's name, when the new 'log::scan_agent' value is set. Also set this value in ScanCore->agent_startup(), to help differentiate log entries.
* Fixed a bug in scancore's main loop where it logged the sleep message at the start of the run.

Signed-off-by: Digimer <digimer@alteeve.ca>
2021-05-04 12:33:31 -04:00
Digimer
a74be60469 * Fixed a bug where the log message for a changed CIB wasn't useful.
Signed-off-by: Digimer <digimer@alteeve.ca>
2021-05-02 23:35:37 -04:00