* Created scan-ipmitool (needs more testing but seems to work now). Logical straight port from M2.

* Fixed a bug if Get->free_memory() where host_type was still being called from the old System->host_type method.
* Added global support for '--log-secure' and '--log-db' switches to enable logging of secure data and DB transactions, respectively.
* Created Database->get_tables_from_schema() that parses a SQL schema file and returns an array reference of tables found, in the order they were found.
* Updated ScanCore->agent_startup() to no longer require manually defining database tables, using Database->get_tables_from_schema() when not manually set.. Updated all existing agents to use this.

Signed-off-by: Digimer <digimer@alteeve.ca>
main
Digimer 4 years ago
parent 9c92b6bbb8
commit 51de6c721f
  1. 2
      Anvil/Tools/Get.pm
  2. 9
      Anvil/Tools/Log.pm
  3. 5
      rpm/SPECS/anvil.spec
  4. 13
      scancore-agents/scan-apc-pdu/scan-apc-pdu
  5. 27
      scancore-agents/scan-apc-ups/scan-apc-ups
  6. 10
      scancore-agents/scan-cluster/scan-cluster
  7. 13
      scancore-agents/scan-hardware/scan-hardware
  8. 2488
      scancore-agents/scan-ipmitool/scan-ipmitool
  9. 122
      scancore-agents/scan-ipmitool/scan-ipmitool.sql
  10. 120
      scancore-agents/scan-ipmitool/scan-ipmitool.xml
  11. 13
      scancore-agents/scan-lvm/scan-lvm
  12. 8
      scancore-agents/scan-server/scan-server
  13. 1
      tools/striker-manage-install-target

@ -1003,7 +1003,7 @@ sub free_memory
This method tries to determine the host type and returns a value suitable for use is the C<< hosts >> table. This method tries to determine the host type and returns a value suitable for use is the C<< hosts >> table.
my $type = $anvil->System->host_type(); my $type = $anvil->Get->host_type();
First, it looks to see if C<< sys::host_type >> is set and, if so, uses that string as it is. First, it looks to see if C<< sys::host_type >> is set and, if so, uses that string as it is.

@ -963,5 +963,14 @@ sub _adjust_log_level
$anvil->data->{sys}{'log'}{level} = "-vvvv"; $anvil->data->{sys}{'log'}{level} = "-vvvv";
} }
if ($anvil->data->{switches}{'log-secure'})
{
$anvil->Log->secure({set => 1});
}
if ($anvil->data->{switches}{'log-db'})
{
$anvil->data->{sys}{database}{log_transactions} = 1;
}
return(0); return(0);
} }

@ -43,6 +43,9 @@ Requires: gpm
Requires: hdparm Requires: hdparm
Requires: htop Requires: htop
Requires: iproute Requires: iproute
Requires: kernel-core
Requires: kernel-devel
Requires: kernel-headers
Requires: lsscsi Requires: lsscsi
Requires: mailx Requires: mailx
Requires: mlocate Requires: mlocate
@ -70,6 +73,7 @@ Requires: perl-Net-OpenSSH
Requires: perl-NetAddr-IP Requires: perl-NetAddr-IP
Requires: perl-Proc-Simple Requires: perl-Proc-Simple
Requires: perl-Sys-Syslog Requires: perl-Sys-Syslog
Requires: perl-Sys-Virt
Requires: perl-Text-Diff Requires: perl-Text-Diff
Requires: perl-Time-HiRes Requires: perl-Time-HiRes
Requires: perl-UUID-Tiny Requires: perl-UUID-Tiny
@ -111,7 +115,6 @@ Requires: gcc
Requires: gdm Requires: gdm
Requires: gnome-terminal Requires: gnome-terminal
Requires: httpd Requires: httpd
Requires: kernel-core
Requires: nmap Requires: nmap
Requires: perl-CGI Requires: perl-CGI
Requires: postgresql-server Requires: postgresql-server

@ -171,16 +171,8 @@ if (($anvil->data->{scancore}{'scan-apc-pdu'}{disable}) && (not $anvil->data->{s
$anvil->nice_exit({exit_code => 0}); $anvil->nice_exit({exit_code => 0});
} }
# These are the tables used by this agent. The order matters as it controls to order the tables are created
# and sync'ed. For purges, this array is walked backwards.
$anvil->data->{scancore}{'scan-apc-pdu'}{tables} = ["scan_apc_pdus", "scan_apc_pdu_phases", "scan_apc_pdu_outlets", "scan_apc_pdu_variables"];
# Handle start-up tasks # Handle start-up tasks
my $problem = $anvil->ScanCore->agent_startup({ my $problem = $anvil->ScanCore->agent_startup({agent => $THIS_FILE});
debug => 3,
agent => $THIS_FILE,
tables => $anvil->data->{scancore}{'scan-apc-pdu'}{tables},
});
if ($problem) if ($problem)
{ {
$anvil->nice_exit({exit_code => 1}); $anvil->nice_exit({exit_code => 1});
@ -189,9 +181,10 @@ if ($problem)
if ($anvil->data->{switches}{purge}) if ($anvil->data->{switches}{purge})
{ {
# This can be called when doing bulk-database purges. # This can be called when doing bulk-database purges.
my $schema_file = $anvil->data->{path}{directories}{scan_agents}."/".$THIS_FILE."/".$THIS_FILE.".sql";
$anvil->Database->purge_data({ $anvil->Database->purge_data({
debug => 2, debug => 2,
tables => $anvil->data->{scancore}{'scan-apc-pdu'}{tables}, tables => $anvil->Database->get_tables_from_schema({schema_file => $schema_file}),
}); });
$anvil->nice_exit({exit_code => 0}); $anvil->nice_exit({exit_code => 0});
} }

@ -195,16 +195,8 @@ if (($anvil->data->{scancore}{'scan-apc-ups'}{disable}) && (not $anvil->data->{s
$anvil->nice_exit({exit_code => 0}); $anvil->nice_exit({exit_code => 0});
} }
# These are the tables used by this agent. The order matters as it controls to order the tables are created
# and sync'ed. For purges, this array is walked backwards.
$anvil->data->{scancore}{'scan-apc-ups'}{tables} = ["scan_apc_upses", "scan_apc_ups_batteries", "scan_apc_ups_input", "scan_apc_ups_output"];
# Handle start-up tasks # Handle start-up tasks
my $problem = $anvil->ScanCore->agent_startup({ my $problem = $anvil->ScanCore->agent_startup({agent => $THIS_FILE});
debug => 3,
agent => $THIS_FILE,
tables => $anvil->data->{scancore}{'scan-apc-ups'}{tables},
});
if ($problem) if ($problem)
{ {
$anvil->nice_exit({exit_code => 1}); $anvil->nice_exit({exit_code => 1});
@ -213,9 +205,10 @@ if ($problem)
if ($anvil->data->{switches}{purge}) if ($anvil->data->{switches}{purge})
{ {
# This can be called when doing bulk-database purges. # This can be called when doing bulk-database purges.
my $schema_file = $anvil->data->{path}{directories}{scan_agents}."/".$THIS_FILE."/".$THIS_FILE.".sql";
$anvil->Database->purge_data({ $anvil->Database->purge_data({
debug => 2, debug => 2,
tables => $anvil->data->{scancore}{'scan-apc-ups'}{tables}, tables => $anvil->Database->get_tables_from_schema({schema_file => $schema_file}),
}); });
$anvil->nice_exit({exit_code => 0}); $anvil->nice_exit({exit_code => 0});
} }
@ -393,13 +386,7 @@ INSERT INTO
last_transfer_reason => "#!string!scan_apc_ups_last_xfer_".sprintf("%04d", $scan_apc_ups_last_transfer_reason)."!#", last_transfer_reason => "#!string!scan_apc_ups_last_xfer_".sprintf("%04d", $scan_apc_ups_last_transfer_reason)."!#",
}; };
$anvil->Log->entry({source => $THIS_FILE, line => __LINE__, level => 1, key => "scan_apc_pdu_message_0002", variables => $variables}); $anvil->Log->entry({source => $THIS_FILE, line => __LINE__, level => 1, key => "scan_apc_pdu_message_0002", variables => $variables});
$anvil->Alert->register({ $anvil->Alert->register({alert_level => "warning", message => "scan_apc_pdu_message_0002", message_variables => $variables, set_by => $THIS_FILE, sort_position => $anvil->data->{'scan-apc-pdu'}{alert_sort}++});
alert_level => "warning",
message => "scan_apc_pdu_message_0002",
message_variables => $variables,
set_by => $THIS_FILE,
sort_position => $anvil->data->{'scan-apc-pdu'}{alert_sort}++,
});
# Add any batteries. # Add any batteries.
foreach my $battery_number (sort {$a cmp $b} keys %{$anvil->data->{ups}{scan_apc_ups_uuid}{$scan_apc_ups_uuid}{battery}}) foreach my $battery_number (sort {$a cmp $b} keys %{$anvil->data->{ups}{scan_apc_ups_uuid}{$scan_apc_ups_uuid}{battery}})
@ -1434,7 +1421,7 @@ WHERE
$message_key = "scan_apc_ups_message_0011"; $message_key = "scan_apc_ups_message_0011";
} }
my $sort_position = $level eq "warning" ? $anvil->data->{'scan-apc-pdu'}{alert_sort}++ : 1; my $sort_position = $level eq "warning" ? 1 : $anvil->data->{'scan-apc-pdu'}{alert_sort}++;
my $variables = { my $variables = {
ups_name => $scan_apc_ups_name, ups_name => $scan_apc_ups_name,
battery_number => $battery_number, battery_number => $battery_number,
@ -1580,7 +1567,7 @@ LIMIT 1
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 2, list => { alert_sent => $alert_sent }}); $anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 2, list => { alert_sent => $alert_sent }});
if (not $alert_sent) if (not $alert_sent)
{ {
my $sort_position = $level eq "warning" ? $anvil->data->{'scan-apc-pdu'}{alert_sort}++ : 1; my $sort_position = $level eq "warning" ? 1 : $anvil->data->{'scan-apc-pdu'}{alert_sort}++;
$anvil->Log->entry({source => $THIS_FILE, line => __LINE__, level => 2, key => $message_key, variables => $variables}); $anvil->Log->entry({source => $THIS_FILE, line => __LINE__, level => 2, key => $message_key, variables => $variables});
$anvil->Alert->register({alert_level => $level, message => $message_key, message_variables => $variables, sort_position => $sort_position, set_by => $THIS_FILE}); $anvil->Alert->register({alert_level => $level, message => $message_key, message_variables => $variables, sort_position => $sort_position, set_by => $THIS_FILE});
} }
@ -1644,7 +1631,7 @@ LIMIT 1
$clear_alert = 1; $clear_alert = 1;
} }
my $sort_position = $level eq "warning" ? $anvil->data->{'scan-apc-pdu'}{alert_sort}++ : 1; my $sort_position = $level eq "warning" ? 1 : $anvil->data->{'scan-apc-pdu'}{alert_sort}++;
my $variables = { my $variables = {
ups_name => $scan_apc_ups_name, ups_name => $scan_apc_ups_name,
new_value => "#!string!scan_apc_ups_battery_state_".sprintf("%04d", $say_scan_apc_ups_battery_state)."!#", new_value => "#!string!scan_apc_ups_battery_state_".sprintf("%04d", $say_scan_apc_ups_battery_state)."!#",

@ -62,16 +62,8 @@ if (($anvil->data->{scancore}{'scan-cluster'}{disable}) && (not $anvil->data->{s
$anvil->nice_exit({exit_code => 0}); $anvil->nice_exit({exit_code => 0});
} }
# These are the tables used by this agent. The order matters as it controls to order the tables are created
# and sync'ed. For purges, this array is walked backwards.
$anvil->data->{scancore}{'scan-cluster'}{tables} = ["scan_cluster", "scan_cluster_nodes"];
# Handle start-up tasks # Handle start-up tasks
my $problem = $anvil->ScanCore->agent_startup({ my $problem = $anvil->ScanCore->agent_startup({agent => $THIS_FILE});
debug => 3,
agent => $THIS_FILE,
tables => $anvil->data->{scancore}{'scan-cluster'}{tables},
});
if ($problem) if ($problem)
{ {
$anvil->nice_exit({exit_code => 1}); $anvil->nice_exit({exit_code => 1});

@ -66,16 +66,8 @@ if (($anvil->data->{scancore}{'scan-hardware'}{disable}) && (not $anvil->data->{
$anvil->nice_exit({exit_code => 0}); $anvil->nice_exit({exit_code => 0});
} }
# These are the tables used by this agent. The order matters as it controls to order the tables are created
# and sync'ed. For purges, this array is walked backwards.
$anvil->data->{scancore}{'scan-hardware'}{tables} = ["scan_hardware", "scan_hardware_ram_modules"];
# Handle start-up tasks # Handle start-up tasks
my $problem = $anvil->ScanCore->agent_startup({ my $problem = $anvil->ScanCore->agent_startup({agent => $THIS_FILE});
debug => 3,
agent => $THIS_FILE,
tables => $anvil->data->{scancore}{'scan-hardware'}{tables},
});
if ($problem) if ($problem)
{ {
$anvil->nice_exit({exit_code => 1}); $anvil->nice_exit({exit_code => 1});
@ -84,9 +76,10 @@ if ($problem)
if ($anvil->data->{switches}{purge}) if ($anvil->data->{switches}{purge})
{ {
# This can be called when doing bulk-database purges. # This can be called when doing bulk-database purges.
my $schema_file = $anvil->data->{path}{directories}{scan_agents}."/".$THIS_FILE."/".$THIS_FILE.".sql";
$anvil->Database->purge_data({ $anvil->Database->purge_data({
debug => 2, debug => 2,
tables => $anvil->data->{scancore}{'scan-hardware'}{tables}, tables => $anvil->Database->get_tables_from_schema({schema_file => $schema_file}),
}); });
$anvil->nice_exit({exit_code => 0}); $anvil->nice_exit({exit_code => 0});
} }

File diff suppressed because it is too large Load Diff

@ -0,0 +1,122 @@
-- This is the database schema for the 'scan-ipmitool' Scan Agent.
CREATE TABLE scan_ipmitool (
scan_ipmitool_uuid uuid not null primary key,
scan_ipmitool_host_uuid uuid not null,
scan_ipmitool_sensor_host text not null, -- The hostname of the machine we pulled the sensor value from. We don't link this to a host_uuid because it is possible the host doesn't doesn't have an entry (yet)
scan_ipmitool_sensor_name text not null,
scan_ipmitool_sensor_units text not null, -- Temperature (°C), vDC, vAC, watt, amp, percent
scan_ipmitool_sensor_status text not null,
scan_ipmitool_sensor_high_critical numeric not null,
scan_ipmitool_sensor_high_warning numeric not null,
scan_ipmitool_sensor_low_critical numeric not null,
scan_ipmitool_sensor_low_warning numeric not null,
modified_date timestamp with time zone not null,
FOREIGN KEY(scan_ipmitool_host_uuid) REFERENCES hosts(host_uuid)
);
ALTER TABLE scan_ipmitool OWNER TO admin;
CREATE TABLE history.scan_ipmitool (
history_id bigserial,
scan_ipmitool_uuid uuid,
scan_ipmitool_host_uuid uuid,
scan_ipmitool_sensor_host text,
scan_ipmitool_sensor_name text,
scan_ipmitool_sensor_units text,
scan_ipmitool_sensor_status text,
scan_ipmitool_sensor_high_critical numeric,
scan_ipmitool_sensor_high_warning numeric,
scan_ipmitool_sensor_low_critical numeric,
scan_ipmitool_sensor_low_warning numeric,
modified_date timestamp with time zone not null
);
ALTER TABLE history.scan_ipmitool OWNER TO admin;
CREATE FUNCTION history_scan_ipmitool() RETURNS trigger
AS $$
DECLARE
history_scan_ipmitool RECORD;
BEGIN
SELECT INTO history_scan_ipmitool * FROM scan_ipmitool WHERE scan_ipmitool_uuid=new.scan_ipmitool_uuid;
INSERT INTO history.scan_ipmitool
(scan_ipmitool_uuid,
scan_ipmitool_host_uuid,
scan_ipmitool_sensor_host,
scan_ipmitool_sensor_name,
scan_ipmitool_sensor_units,
scan_ipmitool_sensor_status,
scan_ipmitool_sensor_high_critical,
scan_ipmitool_sensor_high_warning,
scan_ipmitool_sensor_low_critical,
scan_ipmitool_sensor_low_warning,
modified_date)
VALUES
(history_scan_ipmitool.scan_ipmitool_uuid,
history_scan_ipmitool.scan_ipmitool_host_uuid,
history_scan_ipmitool.scan_ipmitool_sensor_host,
history_scan_ipmitool.scan_ipmitool_sensor_name,
history_scan_ipmitool.scan_ipmitool_sensor_units,
history_scan_ipmitool.scan_ipmitool_sensor_status,
history_scan_ipmitool.scan_ipmitool_sensor_high_critical,
history_scan_ipmitool.scan_ipmitool_sensor_high_warning,
history_scan_ipmitool.scan_ipmitool_sensor_low_critical,
history_scan_ipmitool.scan_ipmitool_sensor_low_warning,
history_scan_ipmitool.modified_date);
RETURN NULL;
END;
$$
LANGUAGE plpgsql;
ALTER FUNCTION history_scan_ipmitool() OWNER TO admin;
CREATE TRIGGER trigger_scan_ipmitool
AFTER INSERT OR UPDATE ON scan_ipmitool
FOR EACH ROW EXECUTE PROCEDURE history_scan_ipmitool();
-- This contains the ever-changing sensor values. This is a separate table to keep the database as small as
-- possible.
CREATE TABLE scan_ipmitool_values (
scan_ipmitool_value_uuid uuid not null primary key,
scan_ipmitool_value_scan_ipmitool_uuid uuid not null,
scan_ipmitool_value_sensor_value numeric not null,
modified_date timestamp with time zone not null,
FOREIGN KEY(scan_ipmitool_value_scan_ipmitool_uuid) REFERENCES scan_ipmitool(scan_ipmitool_uuid)
);
ALTER TABLE scan_ipmitool_values OWNER TO admin;
CREATE TABLE history.scan_ipmitool_values (
history_id uuid,
scan_ipmitool_value_uuid uuid,
scan_ipmitool_value_scan_ipmitool_uuid uuid,
scan_ipmitool_value_sensor_value numeric,
modified_date timestamp with time zone not null
);
ALTER TABLE history.scan_ipmitool_values OWNER TO admin;
CREATE FUNCTION history_scan_ipmitool_values() RETURNS trigger
AS $$
DECLARE
history_scan_ipmitool_values RECORD;
BEGIN
SELECT INTO history_scan_ipmitool_values * FROM scan_ipmitool_values WHERE scan_ipmitool_value_uuid=new.scan_ipmitool_value_uuid;
INSERT INTO history.scan_ipmitool_values
(scan_ipmitool_value_uuid,
scan_ipmitool_value_scan_ipmitool_uuid,
scan_ipmitool_value_sensor_value,
modified_date)
VALUES
(history_scan_ipmitool_values.scan_ipmitool_value_uuid,
history_scan_ipmitool_values.scan_ipmitool_value_scan_ipmitool_uuid,
history_scan_ipmitool_values.scan_ipmitool_value_sensor_value,
history_scan_ipmitool_values.modified_date);
RETURN NULL;
END;
$$
LANGUAGE plpgsql;
ALTER FUNCTION history_scan_ipmitool_values() OWNER TO admin;
CREATE TRIGGER trigger_scan_ipmitool_values
AFTER INSERT OR UPDATE ON scan_ipmitool_values
FOR EACH ROW EXECUTE PROCEDURE history_scan_ipmitool_values();

@ -0,0 +1,120 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Company: Alteeve's Niche, Inc.
License: GPL v2+
Author: Madison Kelly <mkelly@alteeve.ca>
NOTE: All string keys MUST be prefixed with the agent name! ie: 'scan_ipmitool_log_0001'.
-->
<words>
<meta version="3.0.0" languages="en_CA,jp"/>
<!-- Canadian English -->
<language name="en_CA" long_name="Canadian English" description="ScanCore scan agent that monitors hardware, like RAM modules, CSS LED status, CPU information, etc.">
<!-- Messages entries -->
<key name="scan_ipmitool_message_0001">No IPMI BMC found on this host nor where any other machines with IPMI found or where accessible. Nothing to do.</key>
<key name="scan_ipmitool_message_0002">There was no IPMI sensor value units set for sensor: [#!variable!sensor!#] on the machine: [#!variable!machine!#].</key>
<key name="scan_ipmitool_message_0003">There was no IPMI sensor value set for sensor: [#!variable!sensor!#] on the machine: [#!variable!machine!#].</key>
<key name="scan_ipmitool_message_0004">
The sensor: [#!variable!sensor_name!#] has changed.
- [#!variable!old_sensor_value!#] -> [#!variable!new_sensor_value!#]
</key>
<key name="scan_ipmitool_message_0005">
The sensor: [#!variable!sensor_name!#] has changed.
- [#!variable!old_sensor_value!#] -> [#!variable!new_sensor_value!#]
- [#!variable!old_sensor_status!#] -> [#!variable!new_sensor_status!#]
- Thresholds:
- High critical: [#!variable!old_high_critical!#] -> [#!variable!new_high_critical!#]
- High warning: [#!variable!old_high_warning!#] -> [#!variable!new_high_warning!#]
- Low warning: [#!variable!old_low_warning!#] -> [#!variable!new_low_warning!#]
- Low critical: [#!variable!old_low_critical!#] -> [#!variable!new_low_critical!#]
</key>
<key name="scan_ipmitool_message_0006">
The temperature sensor: [#!variable!sensor_name!#] has gone critically high!
- [#!variable!old_sensor_value!#] -> [#!variable!new_sensor_value!#]
Note: If enough sensors go critical, this node will withdraw and power off!
</key>
<key name="scan_ipmitool_message_0007">
The temperature sensor: [#!variable!sensor_name!#] has entered a high warning state!
- [#!variable!old_sensor_value!#] -> [#!variable!new_sensor_value!#]
Note: If both nodes have enough thermal sensors go into 'warning' state, and
if load shedding is enabled, a node will power off to reduce thermal
output. If enough sensors reach critical levels, the node will withdraw
and power off.
</key>
<key name="scan_ipmitool_message_0008">
The temperature sensor: [#!variable!sensor_name!#] has returned to normal levels.
- [#!variable!old_sensor_value!#] -> [#!variable!new_sensor_value!#]
</key>
<key name="scan_ipmitool_message_0009">
The temperature sensor: [#!variable!sensor_name!#] has risen above critically low levels, but it is still in a warning state.
- [#!variable!old_sensor_value!#] -> [#!variable!new_sensor_value!#]
Note: If you are listening to 'critical' level alerts only, you will not get the alert telling you when the temperature is back to normal.
</key>
<key name="scan_ipmitool_message_0010">
The temperature sensor: [#!variable!sensor_name!#] has jumped a large amount in a short period of time!
- [#!variable!old_sensor_value!#] -> [#!variable!new_sensor_value!#]
</key>
<key name="scan_ipmitool_message_0011">
The temperature sensor: [#!variable!sensor_name!#] has gone critically low!
- [#!variable!old_sensor_value!#] -> [#!variable!new_sensor_value!#]
Note: If enough sensors go critical, this node will withdraw and power off!
</key>
<key name="scan_ipmitool_message_0012">
The temperature sensor: [#!variable!sensor_name!#] has entered a low warning state!
- [#!variable!old_sensor_value!#] -> [#!variable!new_sensor_value!#]
Note: If the temperature continues to drop, the sensor will go critical. If enough sensors go critical, the node will withdraw and power off.
</key>
<key name="scan_ipmitool_message_0013">
The temperature sensor: [#!variable!sensor_name!#] has returned to normal levels.
- [#!variable!old_sensor_value!#] -> [#!variable!new_sensor_value!#]
</key>
<key name="scan_ipmitool_message_0014">
The temperature sensor: [#!variable!sensor_name!#] has risen blow critically high levels, but it is still in a warning state.
- [#!variable!old_sensor_value!#] -> [#!variable!new_sensor_value!#]
Note: If you are listening to 'critical' level alerts only, you will not get the alert telling you when the temperature is back to normal.
</key>
<key name="scan_ipmitool_message_0015">There was no IPMI sensor value units set for sensor: [#!variable!sensor!#] on the machine: [#!variable!machine!#].</key>
<key name="scan_ipmitool_message_0016">
The sensor: [#!variable!sensor_name!#] has changed.
- [#!variable!old_sensor_value!#] -> [#!variable!new_sensor_value!#]
- [#!variable!old_sensor_status!#] -> [#!variable!new_sensor_status!#]
- Thresholds:
- High critical: [#!variable!old_high_critical!#] -> [#!variable!new_high_critical!#]
- High warning: [#!variable!old_high_warning!#] -> [#!variable!new_high_warning!#]
- Low warning: [#!variable!old_low_warning!#] -> [#!variable!new_low_warning!#]
- Low critical: [#!variable!old_low_critical!#] -> [#!variable!new_low_critical!#]
</key>
<key name="scan_ipmitool_message_0017">There was no IPMI sensor value units set for sensor: [#!variable!sensor!#] on the machine: [#!variable!machine!#].</key>
<key name="scan_ipmitool_message_0018">There was no IPMI sensor value set for sensor: [#!variable!sensor!#] on the machine: [#!variable!machine!#].</key>
<key name="scan_ipmitool_message_0019">
The new sensor: [#!variable!sensor_name!#] has been found on the machine: [#!variable!machine!#].
- Value: [#!variable!sensor_value!#], Status: [#!variable!sensor_status!#]
- Thresholds:
- High critical: [#!variable!high_critical!#]
- High warning: [#!variable!high_warning!#]
- Low warning: [#!variable!low_warning!#]
- Low critical: [#!variable!low_critical!#]
</key>
<key name="scan_ipmitool_message_0020">
The new sensor: [#!variable!sensor_name!#] has been found on the machine: [#!variable!machine!#].
Warning: It is not in an OK state!
- Value: [#!variable!sensor_value!#], Status: [#!variable!sensor_status!#]
- Thresholds:
- High critical: [#!variable!high_critical!#]
- High warning: [#!variable!high_warning!#]
- Low warning: [#!variable!low_warning!#]
- Low critical: [#!variable!low_critical!#]
</key>
<!-- Log entries -->
<key name="scan_ipmitool_log_0001">Starting to read the IPMI sensor values for: [#!variable!machine!#]</key>
<key name="scan_ipmitool_log_0002">Failed to query node: [#!variable!machine!#]'s IPMI interface using the call: [#!variable!call!#]. Is the password correct?</key>
<key name="scan_ipmitool_log_0003">IPMI sensor values read from: [#!variable!machine!#] in: [#!variable!time!#].</key>
<key name="scan_ipmitool_log_0004">The sensor named: [#!variable!sensor_name!#] appears to have vanished, but this is the first scan that it vanished. This is generally harmless and just a sensor read issue.</key>
<key name="scan_ipmitool_log_0005">The sensor named: [#!variable!sensor_name!#] has returned.</key>
</language>
</words>

@ -66,16 +66,8 @@ if (($anvil->data->{scancore}{'scan-lvm'}{disable}) && (not $anvil->data->{switc
$anvil->nice_exit({exit_code => 0}); $anvil->nice_exit({exit_code => 0});
} }
# These are the tables used by this agent. The order matters as it controls to order the tables are created
# and sync'ed. For purges, this array is walked backwards.
$anvil->data->{scancore}{'scan-lvm'}{tables} = ["scan_lvm_pvs", "scan_lvm_vgs", "scan_lvm_lvs"];
# Handle start-up tasks # Handle start-up tasks
my $problem = $anvil->ScanCore->agent_startup({ my $problem = $anvil->ScanCore->agent_startup({agent => $THIS_FILE});
debug => 3,
agent => $THIS_FILE,
tables => $anvil->data->{scancore}{'scan-lvm'}{tables},
});
if ($problem) if ($problem)
{ {
$anvil->nice_exit({exit_code => 1}); $anvil->nice_exit({exit_code => 1});
@ -84,9 +76,10 @@ if ($problem)
if ($anvil->data->{switches}{purge}) if ($anvil->data->{switches}{purge})
{ {
# This can be called when doing bulk-database purges. # This can be called when doing bulk-database purges.
my $schema_file = $anvil->data->{path}{directories}{scan_agents}."/".$THIS_FILE."/".$THIS_FILE.".sql";
$anvil->Database->purge_data({ $anvil->Database->purge_data({
debug => 2, debug => 2,
tables => $anvil->data->{scancore}{'scan-lvm'}{tables}, tables => $anvil->Database->get_tables_from_schema({schema_file => $schema_file}),
}); });
$anvil->nice_exit({exit_code => 0}); $anvil->nice_exit({exit_code => 0});
} }

@ -64,14 +64,8 @@ if (($anvil->data->{scancore}{'scan-server'}{disable}) && (not $anvil->data->{sw
$anvil->nice_exit({exit_code => 0}); $anvil->nice_exit({exit_code => 0});
} }
# This scan agent only uses core tables (server and definitions).
$anvil->data->{scancore}{'scan-server'}{tables} = [];
# Handle start-up tasks # Handle start-up tasks
my $problem = $anvil->ScanCore->agent_startup({ my $problem = $anvil->ScanCore->agent_startup({agent => $THIS_FILE});
agent => $THIS_FILE,
tables => $anvil->data->{scancore}{'scan-server'}{tables},
});
if ($problem) if ($problem)
{ {
$anvil->nice_exit({exit_code => 1}); $anvil->nice_exit({exit_code => 1});

@ -2337,6 +2337,7 @@ sub load_packages
"perl-Sub-Install.noarch", "perl-Sub-Install.noarch",
"perl-Sub-Quote.noarch", "perl-Sub-Quote.noarch",
"perl-Sys-Syslog.x86_64", "perl-Sys-Syslog.x86_64",
"perl-Sys-Virt.x86_64",
"perl-Term-ANSIColor.noarch", "perl-Term-ANSIColor.noarch",
"perl-Term-Cap.noarch", "perl-Term-Cap.noarch",
"perl-Text-Balanced.noarch", "perl-Text-Balanced.noarch",

Loading…
Cancel
Save