Commit Graph

3595 Commits

Author SHA1 Message Date
Digimer
4cf9d6215c * Removed the table host_mail_servers.
* Added a check in striker-manage-install-target to watch for and remove bad RPMs.

Signed-off-by: Digimer <digimer@alteeve.ca>
2020-01-06 19:47:37 -05:00
Digimer
e764eccf6e * Started work on Email->check_alert_recipients().
* Created Database->get_recipients() (from what used to be get_alert_recipients), as well as ->get_mail_servers() and ->insert_or_update_notifications().
* Renamed 'recipients -> notification_anvil_uuid' to 'notification_host_uuid'.
* Started work on scancore -> check_email.

Signed-off-by: Digimer <digimer@alteeve.ca>
2020-01-05 15:07:35 -07:00
Digimer
754435685e * Fixed a couple bugs when handling alert recipients.
* Fixed a bug where deleting records from numerous tables didn't use the active time stamp.

Signed-off-by: Digimer <digimer@alteeve.ca>
2020-01-01 00:53:29 -07:00
Digimer
9e16cdf504 * Created Validate->is_email() to validate email addresses, using Mail::RFC822::Address.
* Finished (but not yet tested) the menu to manage alert recipients.
* Created Words->language_list() that creates a hash reference of available languages.

Signed-off-by: Digimer <digimer@alteeve.ca>
2019-12-31 23:43:52 -07:00
Digimer
eb0481bcb0 * Created Database->insert_or_update_recipients() (and did general cleanup of the database module).
* Started work on Striker's notification recipient management page. Cleaned up the variable names in the mail_server management function.
* Added recipients -> recipient_units column to the sql schema.

Signed-off-by: Digimer <digimer@alteeve.ca>
2019-12-28 11:20:09 -07:00
Digimer
98211e1228 * Finished the mail server configuration menu. Mail servers can be added, edited, and deleted now.
Signed-off-by: Digimer <digimer@alteeve.ca>
2019-12-27 23:12:13 -05:00
Digimer
d4a5882bb4 * Created Validate->is_port() to validate TCP/UDP ports
* Got Striker to the point where it can save mail servers (not load existing or delete yet, though).
* Added a check to striker-parse-oui so that it only runs once per day.

Signed-off-by: Digimer <digimer@alteeve.ca>
2019-12-26 21:06:31 -05:00
Digimer
c48e9a174c * Created Tools->_domain_name() to return the host's domain name portion of their full host name.
* Created Database->insert_or_update_mail_servers() to insert/update entries in the 'mail_servers' table.
* Got more work done on the email server menu. It now shows the entered values, but not yet save the data.

Signed-off-by: Digimer <digimer@alteeve.ca>
2019-12-26 00:17:17 -05:00
Digimer
a3105c08a7 * Started work on the mail server form.
Signed-off-by: Digimer <digimer@alteeve.ca>
2019-12-24 23:13:23 -05:00
Digimer
c3869a2ff6 * Started adding in front-end support for managing email servers and alert recipients. Added the new 'Email' module to (later) habdle all email-related tasks.
* Fixed a bug in Accounts->read_cookies where, when a user's hash had expired, the logged error message didn't show the user's name.

Signed-off-by: Digimer <digimer@alteeve.ca>
2019-12-23 00:54:09 -05:00
Digimer
2f81275551 * Updated the kickstart template/script to now add the local striker to the installed system's dnf repo list.
* Fixed a bug in the tftp templates where the os_type was statically set to 'rhel8'.

Signed-off-by: Digimer <digimer@alteeve.ca>
2019-12-20 00:54:07 -05:00
Digimer
c2ef156e2d * Did work on adding better offline support for installing DHCP/PXE targets on RHEL 8.1
Signed-off-by: Digimer <digimer@alteeve.ca>
2019-12-19 22:00:31 -05:00
Digimer
974d3c3411 * Fixed the order or table creations in anvil.sql (as well as fixed a missing comma)
* Fixed / added 'delete' parameters for Database->insert_or_update_bridges(), ->insert_or_update_bonds(), ->insert_or_update_ip_addresses() and ->insert_or_update_network_interfaces().

Signed-off-by: Digimer <digimer@alteeve.ca>
2019-12-17 23:36:26 -05:00
Digimer
c34f56f2c8 * Disabled firewalld for now.
* Created System->disable_daemon.
* Fixed a bug in Database->insert_or_update_bonds() where the bridge_uuid was an empty string instead of NULL.

Signed-off-by: Digimer <digimer@alteeve.ca>
2019-12-17 01:38:42 -05:00
Digimer
b4a979da4b * Bumped the rpm to -30.
Signed-off-by: Digimer <digimer@alteeve.ca>
2019-12-13 23:54:49 -05:00
Digimer
a16e86dc7c * Finished tools/anvil-configure-host! More notably, it can now update the network without a reboot, and it cleanly handles losing and reconnecting to dashboards.
* Added 'no_ping' to Database->connect() to disable pinging before connection, regardless of the anvil.conf setting.
* Created Network->read_nmcli() that reads, parses and stores the verbose output from 'nmcli'.

I can not properly explain in this commit message how much getting network manager working tripped me up. omg the complexity of what used to be such a simple process...

Signed-off-by: Digimer <digimer@alteeve.ca>
2019-12-13 22:20:18 -05:00
Digimer
414bf81f25 * Fixed a bug where the BOOTPROTO="x" was set to dhcp for a bond interface that is connected to a bridge and should have been set to 'none'.
Signed-off-by: Digimer <digimer@alteeve.ca>
2019-12-11 01:25:18 -05:00
Digimer
e9ee74553a * Fixed a comment bug in Network->reconfigure_network() indicating that MAC lookup was using the wrong hash key.
* Fixed a couple more bugs in tools/anvil-configure-host, getting it now to the point where it writes out the network config files.

Signed-off-by: Digimer <digimer@alteeve.ca>
2019-12-11 01:03:50 -05:00
Digimer
9bcad1c4bf * Did more work on adapting tools/anvil-configure-host to work on nodes and DR hosts.
* Fixed a bug in Job->get_job_details() when no job_uuid was passed.

Signed-off-by: Digimer <digimer@alteeve.ca>
2019-12-11 00:38:48 -05:00
Digimer
b97f15b25e * Finished the sanity checks and user confirmation table when preparing to configure the network on a node or dr host.
Signed-off-by: Digimer <digimer@alteeve.ca>
2019-12-10 02:38:55 -05:00
Digimer
6d81e03fb2 * Created Network->match_gateway() to check if a gateway applies to a given network.
* Got more work done on confirming the user's request to setup the network of a node or DR host.
* Reworked network select boxes to sort by the network name instead of the MAC address.

Signed-off-by: Digimer <digimer@alteeve.ca>
2019-12-08 00:19:13 -05:00
Digimer
86af67ecda * Created a cachine mechanism for anvil-update-states so that it can record network interface link state changes when it loses contact with all databases, as can happen when cycling NICs to map a newly build DR host or node.
* Updated Database->insert_or_update_network_interfaces() to take the new 'link_only' and 'timestamp' parameters to support flushing out the cache file above.
* Updated anvil-daemon to run anvil-update-states when the database connection is lost. Also moved the 'handle_periodic_tasks()' function call to be conditional on there being a database connection.

Signed-off-by: Digimer <digimer@alteeve.ca>
2019-12-05 01:59:41 -05:00
Digimer
530d379f59 * Started work on caching network state change in tools/anvil-update-states.
* Fixed a bug where ip_addresses could break resync when 2+ machines had the same IP (ie: 192.168.122.1).
* Updated logging of DB transactions to show the DB host's IP instead of the UUID.
* Updated Get->date_and_time to take a 'use_utc' parameter to return the time using GMT time instead of the host's TZ.
* Updated anvil-daemon to periodically call tools/anvil-update-states. Also upadted anvil-daemon to delay daily jobs by 2 hours except for the dashboard with the highest sorted UUID to minimize dual runs of tasks that only need to run once per day per cluster.

Signed-off-by: Digimer <digimer@alteeve.ca>
2019-12-04 00:02:19 -05:00
Digimer
e8d15112da * Fixed a bug in anvil.js where the state of a link always said 'up', even when it was down.
* Fixed a couple logging bugs in System->call().
* Fixed a bug in anvil-daemon where it was trying to setup setuid-C wrappers on non-dashboards.

Signed-off-by: Digimer <digimer@alteeve.ca>
2019-12-03 01:23:31 -05:00
Digimer
90f5bf49d5 * Updated Network->load_interfces() to only assign a 'changed_order' to real interfaces.
* Fixed a bug in System->generate_state_json() where interfaces connected to a bridge were constantly having their 'network_interface_bond_uuid' cleared and reset.
* Finished (for now) the jquery code to update the network interface list when preparing the network interface configuration of a new node or DR host.

Signed-off-by: Digimer <digimer@alteeve.ca>
2019-12-03 00:30:26 -05:00
Digimer
0dfd2ddbf0 * Renamed 'ip' to 'ip_address' in Striker->parse_all_status_json() and related functions.
* Got the menu for mapping a host's network displaying (much work still to be done).
* Updated the anvil.js funtion to run dependent on the page being shown. For the main menu, the json is now properly reread and display updated as json content changes.

Signed-off-by: Digimer <digimer@alteeve.ca>
2019-11-29 23:37:11 -05:00
Digimer
0b2439edc3 * Finished the jquery/css stuff for showing the list of hosts that can have their network configured.
* Fixed unclear error logging in Network->find_matches().
* Updated System->generate_state_json() Striker->parse_all_status_json() to determine if another machine can be reached from the local dashboard. If it can be reached, the first matching interface and IP are recorded.

Signed-off-by: Digimer <digimer@alteeve.ca>
2019-11-27 23:26:21 -05:00
Digimer
c608ebb232 * Added bonds -> bond_bridge_uuid to track which bridge, if any, that a bond is connected to. Updated Network->load_interfces() to record this.
* Added missing foreign key references to the SQL schema.
* Added support to tools/anvil-update-states to connect bonds to bridges, as appropriate.
* Finished the logic in test.pl to pull the network data (with connections between bridges, bonds and interfaces) needed for the WebUI.

Signed-off-by: Digimer <digimer@alteeve.ca>
2019-11-26 00:15:37 -05:00
Digimer
0cf13b6387 * Worked out more of the logic in test.pl for displaying the JSON data.
Signed-off-by: Digimer <digimer@alteeve.ca>
2019-11-22 18:14:25 -05:00
Digimer
82bc25c78d * Adding the test.pl script. Even though it doesn't relate to the program, it's used to sort out logic and the code should be committed, until mainline development is done.
Signed-off-by: Digimer <digimer@alteeve.ca>
2019-11-21 19:47:21 -05:00
Digimer
7aaef3d6d5 * Fixed bugs in Striker->parse_all_status_json() and System->generate_state_json() where the connected interfaces to bridges and bonds wasn't be stored properly.
Signed-off-by: Digimer <digimer@alteeve.ca>
2019-11-21 19:23:16 -05:00
Digimer
aba79cc457 * Added a check in Striker->parse_all_status_json() to set the connected interface types.
Signed-off-by: Digimer <digimer@alteeve.ca>
2019-11-21 14:07:03 -05:00
Digimer
54de5466cf * Renamed bond_active_slave to bond_active_interface.
Signed-off-by: Digimer <digimer@alteeve.ca>
2019-11-21 10:55:21 -05:00
Digimer
12b0cc28f0 * Renamed 'primary_slave' to 'primary_interface' for the bond table.
* Got more work done on parsing the all_status.json (and fixing related bugs).

Signed-off-by: Digimer <digimer@alteeve.ca>
2019-11-20 01:45:16 -05:00
Digimer
d5672e77eb * Standardized 'subnet_mask' over 'subnet' naming throughout.
* Created (and haven't finished yet) Striker->parse_all_status_json().

Signed-off-by: Digimer <digimer@alteeve.ca>
2019-11-19 02:13:19 -05:00
Digimer
b2ff4c4c53 * Created Network->get_company_from_mac() that converts a MAC address to the company name that owns it.
* Added recording the last-change order for network interfaces in System->generate_state_json() so that the most recently unplugged and plugged back in interfaces can be tracked.
* Worked out a faster way to ping scan subnets with nmap in striker-scan-network. Dropped average scan time from 35 minutes to 4~5 minutes for a /16 subnet.

Signed-off-by: Digimer <digimer@alteeve.ca>
2019-11-15 18:29:07 -05:00
Digimer
e3a8c1a01d * Created System->generate_state_json() that reads, parse and writes out the network status of all known machines on a given Striker database.
Signed-off-by: Digimer <digimer@alteeve.ca>
2019-11-14 23:58:39 -05:00
Digimer
387c03aa7d * Added more text for the pending JSON state file generation.
Signed-off-by: Digimer <digimer@alteeve.ca>
2019-11-13 21:29:51 -05:00
Digimer
7cf1db3b37 * Added strings for making size suffixes translatable and updated Convert->bytes_to_human_readable to use them.
* Fixed a bug in tools/anvil-update-states where the MAC of an interface that is the backup in an active-backup bond would be the MAC of the active member instead of its real MAC.
* Fixed a bug in Convert->add_commas() where a passed in value of '0' returned an empty string.

Signed-off-by: Digimer <digimer@alteeve.ca>
2019-11-12 16:27:01 -05:00
Digimer
b9e8d2a971 * Added suffixes for data sizes.
Signed-off-by: Digimer <digimer@alteeve.ca>
2019-11-11 18:18:29 -05:00
Digimer
d0006cc4d3 * Changed a bunch more variables to standardize on 'mac_address' instead of 'mac'.
* Added ' --best --allowerasing' to the dnf call in tools/anvil-update-system (found it was needed when 'yum-utils' replaced 'dnf-utils' in RHEL 8.1 release).

Signed-off-by: Digimer <digimer@alteeve.ca>
2019-11-11 11:17:02 -05:00
Digimer
70776964d6 * Added packages needed to support offline machines to striker-manage-install-target.
* Cleaned up the returned 'return_code' in System->call() when background is true.

Signed-off-by: Digimer <digimer@alteeve.ca>
2019-11-08 14:49:49 -05:00
Digimer
ea27f88bcc * Removed the 'bridge_interfaces' table and related database methods. This was found to be duplicate, given that 'network_interfaces' has references to parent bonds and bridges.
* Renamed 'bridges' -> 'bridge_mac' to 'bridge_mac_address' to be consstent with other MAC address column names.
* Finished Network->load_interfces().
* Updated anvil-update-states to check for interfaces under bridges that are missing their 'network_interface_bridge_uuid' reference UUID.

Signed-off-by: Digimer <digimer@alteeve.ca>
2019-11-07 23:40:02 -05:00
Digimer
628f7faa45 * Updated the RPM spec file to generate '/etc/anvil/type.X' files to directly indicate the machine type. Updated System->get_host_type() to check for these files directly, falling back to parsing the host name if they don't exist.
* Created Database->get_hosts_info() (though it's not at all finished) that will write out a unified JSON file contain all data known about all hosts/Anvil! systems. This will be later used to create the WebUI parts.
* Also created, but also not finished, Network->load_interfces() that will work sort of like ->load_ups, but include all interfaces regardless of if they have an IP or not.
* Fixed a bug where the new bridge_interface_note parameter didn't exist in the Database->insert_or_update_bridge_interfaces() method.
* Updated anvil-update-states() to only write out the JSON/XML files if it's running on a dashboard. For nodes and DR hosts, it just needs to update the database.
* Created a new hook in anvil-daemon that will call tasks on a machine that is configured.
* As per RHEL 8.1 release notes, changed the package 'dnf-utils' to 'yum-utils' in the packages to load for install target repos.

Signed-off-by: Digimer <digimer@alteeve.ca>
2019-11-06 11:26:21 -05:00
Digimer
077977ad9c * Fixed tools/anvil-update-states so that it properly removed ip_addresses no longer assigned to a host. Also merged 'network::interfaces::by_name::${interface}' with 'network::local::interface::${interface}' for storing discovered interfaces.'
* Added 'ip_address_note' to the 'ip_addresses' table as there was no column convenient for flagging as DELETEd.
* Added 'uuid' to Database->insert_or_update_file_locations() and ->insert_or_update_files(), and actually used it in all ->inser_or_update_X() methods.
* Added 'delete' as a parameter to Database->insert_or_update_ip_addresses() to allow simple deletion of a referenced IP address.
* Addressed a few 'undefined variable' errors.

Signed-off-by: Digimer <digimer@alteeve.ca>
2019-11-02 00:02:36 -04:00
Digimer
517771594e * Updated to release -28 RPM.
Signed-off-by: Digimer <digimer@alteeve.ca>
2019-10-28 11:04:57 -04:00
Digimer
197f5ed90e * Finished the automatic archving of the database! New in M3; Archving happens on dashboards only, and whichever database triggers an archive will archive all data in any connected databases. This is a departure from where each host archived it's own data, but will avoid putting a disk or CPU load on server hosts.
Signed-off-by: Digimer <digimer@alteeve.ca>
2019-10-28 02:27:26 -04:00
Digimer
650dc6eb80 * Finished Storage->compress(). Also added some missing 'port' parameters (reads and passes) in a few different Storage methods.
Signed-off-by: Digimer <digimer@alteeve.ca>
2019-10-27 17:19:03 -04:00
Digimer
deb8965a38 Merge branch 'master' of github.com:digimer/anvil
Signed-off-by: Digimer <digimer@alteeve.ca>
2019-10-26 20:43:17 -04:00
Digimer
08176a5711 * Updated Database->_archive_table() to remove double-// in paths.
* Started work on Database->compress.

Signed-off-by: Digimer <digimer@alteeve.ca>
2019-10-26 20:10:02 -04:00