* Finished porting scan-hpacucli, the last M2 scan agent!

* Updated Database->insert_or_update_temperature() to accespt a 'delete' parameter (which, surprise, deletes a record).
* Updated (but not yet tested) the RPM .spec to require that 'core' and the other three packages are required to be the same version.
* Updated scan-ipmitool and scan-storcli scan agents to now delete temperature data belonging to lost sensors.
* Fixed tools/striker-manage-install-target to add multiple missing packages.

Signed-off-by: Digimer <digimer@alteeve.ca>
main
Digimer 4 years ago
parent 1c00060d6e
commit cda51e562d
  1. 3
      Anvil/Tools.pm
  2. 2
      Anvil/Tools/Convert.pm
  3. 188
      Anvil/Tools/Database.pm
  4. 21
      Anvil/Tools/Email.pm
  5. 5
      notes
  6. 7
      rpm/SPECS/anvil.spec
  7. 2
      scancore-agents/scan-apc-ups/scan-apc-ups
  8. 15
      scancore-agents/scan-ipmitool/scan-ipmitool
  9. 144
      scancore-agents/scan-storcli/scan-storcli
  10. 1
      share/words.xml
  11. 2
      tools/anvil-daemon
  12. 2
      tools/striker-initialize-host
  13. 18
      tools/striker-manage-install-target

@ -1156,6 +1156,7 @@ sub _set_paths
'grep' => "/usr/bin/grep", 'grep' => "/usr/bin/grep",
head => "/usr/bin/head", head => "/usr/bin/head",
hostnamectl => "/usr/bin/hostnamectl", hostnamectl => "/usr/bin/hostnamectl",
hpacucli => "/usr/sbin/hpacucli",
htpasswd => "/usr/bin/htpasswd", htpasswd => "/usr/bin/htpasswd",
ifdown => "/sbin/ifdown", ifdown => "/sbin/ifdown",
ifup => "/sbin/ifup", ifup => "/sbin/ifup",
@ -1192,6 +1193,7 @@ sub _set_paths
pwd => "/usr/bin/pwd", pwd => "/usr/bin/pwd",
pvs => "/usr/sbin/pvs", pvs => "/usr/sbin/pvs",
pvscan => "/usr/sbin/pvscan", pvscan => "/usr/sbin/pvscan",
rm => "/usr/bin/rm",
rpm => "/usr/bin/rpm", rpm => "/usr/bin/rpm",
rsync => "/usr/bin/rsync", rsync => "/usr/bin/rsync",
sed => "/usr/bin/sed", sed => "/usr/bin/sed",
@ -1220,6 +1222,7 @@ sub _set_paths
tput => "/usr/bin/tput", tput => "/usr/bin/tput",
'tr' => "/usr/bin/tr", 'tr' => "/usr/bin/tr",
uname => "/usr/bin/uname", uname => "/usr/bin/uname",
unzip => "/usr/bin/unzip",
usermod => "/usr/sbin/usermod", usermod => "/usr/sbin/usermod",
uuidgen => "/usr/bin/uuidgen", uuidgen => "/usr/bin/uuidgen",
virsh => "/usr/bin/virsh", virsh => "/usr/bin/virsh",

@ -755,7 +755,7 @@ sub format_mmddyy_to_yymmdd
if (not $date) if (not $date)
{ {
$anvil->Log->entry({source => $THIS_FILE, line => __LINE__, level => 0, priority => "err", key => "log_0020", variables => { method => "Convert->host_name_to_ip()", parameter => "host_name" }}); $anvil->Log->entry({source => $THIS_FILE, line => __LINE__, level => 0, priority => "err", key => "log_0020", variables => { method => "Convert->format_mmddyy_to_yymmdd()", parameter => "host_name" }});
return("!!error!!"); return("!!error!!");
} }

@ -1065,6 +1065,13 @@ Once connected to the database, a query is made to see if the database needs to
If you set this table manually, it will be checked and if the table doesn't exist on a connected database, the database will be initialized with the C<< sql_file >> parameter's file. If you set this table manually, it will be checked and if the table doesn't exist on a connected database, the database will be initialized with the C<< sql_file >> parameter's file.
=cut =cut
### TODO: Have anvil-daemon look up all IPs available for a database (SELECT ip_address_address,
### ip_address_subnet_mask FROM ip_addresses WHERE ip_address_host_uuid = '<host_uuid>' AND
### ip_address_note != 'DELETED';) and append any found IPs to the anvil.conf entry. Then, in the order
### they're found in the anvil.conf, try to connect. This should speed up showing link state changes
### when mapping the network of a node or DR host as the client can fairly quickly cycle through
### networks to find and update the database). On connect, move the host/IP that worked to the front of
### the list.
sub connect sub connect
{ {
my $self = shift; my $self = shift;
@ -1145,7 +1152,7 @@ sub connect
$anvil->data->{database}{$uuid}{password} = "" if not defined $anvil->data->{database}{$uuid}{password}; $anvil->data->{database}{$uuid}{password} = "" if not defined $anvil->data->{database}{$uuid}{password};
my $driver = "DBI:Pg"; my $driver = "DBI:Pg";
my $host = $anvil->data->{database}{$uuid}{host}; # This should fail my $host = $anvil->data->{database}{$uuid}{host}; # This should fail if not set
my $port = $anvil->data->{database}{$uuid}{port}; my $port = $anvil->data->{database}{$uuid}{port};
my $name = $anvil->data->{database}{$uuid}{name}; my $name = $anvil->data->{database}{$uuid}{name};
my $user = $anvil->data->{database}{$uuid}{user}; my $user = $anvil->data->{database}{$uuid}{user};
@ -1174,7 +1181,7 @@ sub connect
} }
# Make sure the user didn't specify the same target twice. # Make sure the user didn't specify the same target twice.
my $target_host = "$host:$port"; my $target_host = $host.":".$port;
my $duplicate = 0; my $duplicate = 0;
foreach my $existing_host (sort {$a cmp $b} @{$seen_connections}) foreach my $existing_host (sort {$a cmp $b} @{$seen_connections})
{ {
@ -1204,7 +1211,7 @@ sub connect
### TODO: Can we do a telnet port ping with a short timeout instead of a shell ping call? ### TODO: Can we do a telnet port ping with a short timeout instead of a shell ping call?
# Assemble my connection string # Assemble my connection string
my $db_connect_string = "$driver:dbname=$name;host=$host;port=$port"; my $db_connect_string = $driver.":dbname=".$name.";host=".$host.";port=".$port;
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => $debug, list => { $anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => $debug, list => {
db_connect_string => $db_connect_string, db_connect_string => $db_connect_string,
"database::${uuid}::ping" => $anvil->data->{database}{$uuid}{ping}, "database::${uuid}::ping" => $anvil->data->{database}{$uuid}{ping},
@ -4258,9 +4265,9 @@ WHERE
} }
# NULL values can't be quoted # NULL values can't be quoted
my $say_anvil_node1_host_uuid = $anvil_node1_host_uuid eq "NULL" ? "NULL" : $anvil->Database->quote($anvil_node1_host_uuid); my $say_anvil_node1_host_uuid = $anvil_node1_host_uuid eq "" ? "NULL" : $anvil->Database->quote($anvil_node1_host_uuid);
my $say_anvil_node2_host_uuid = $anvil_node2_host_uuid eq "NULL" ? "NULL" : $anvil->Database->quote($anvil_node2_host_uuid); my $say_anvil_node2_host_uuid = $anvil_node2_host_uuid eq "" ? "NULL" : $anvil->Database->quote($anvil_node2_host_uuid);
my $say_anvil_dr1_host_uuid = $anvil_dr1_host_uuid eq "NULL" ? "NULL" : $anvil->Database->quote($anvil_dr1_host_uuid); my $say_anvil_dr1_host_uuid = $anvil_dr1_host_uuid eq "" ? "NULL" : $anvil->Database->quote($anvil_dr1_host_uuid);
# If I still don't have an anvil_uuid, we're INSERT'ing . # If I still don't have an anvil_uuid, we're INSERT'ing .
@ -6717,7 +6724,7 @@ sub insert_or_update_jobs
my $job_data = defined $parameter->{job_data} ? $parameter->{job_data} : ""; my $job_data = defined $parameter->{job_data} ? $parameter->{job_data} : "";
my $job_picked_up_by = defined $parameter->{job_picked_up_by} ? $parameter->{job_picked_up_by} : 0; my $job_picked_up_by = defined $parameter->{job_picked_up_by} ? $parameter->{job_picked_up_by} : 0;
my $job_picked_up_at = defined $parameter->{job_picked_up_at} ? $parameter->{job_picked_up_at} : 0; my $job_picked_up_at = defined $parameter->{job_picked_up_at} ? $parameter->{job_picked_up_at} : 0;
my $job_updated = defined $parameter->{job_updated} ? $parameter->{job_updated} : time; my $job_updated = defined $parameter->{job_updated} ? $parameter->{job_updated} : "";
my $job_name = defined $parameter->{job_name} ? $parameter->{job_name} : ""; my $job_name = defined $parameter->{job_name} ? $parameter->{job_name} : "";
my $job_progress = defined $parameter->{job_progress} ? $parameter->{job_progress} : ""; my $job_progress = defined $parameter->{job_progress} ? $parameter->{job_progress} : "";
my $job_title = defined $parameter->{job_title} ? $parameter->{job_title} : ""; my $job_title = defined $parameter->{job_title} ? $parameter->{job_title} : "";
@ -6745,6 +6752,7 @@ sub insert_or_update_jobs
clear_status => $clear_status, clear_status => $clear_status,
}}); }});
# If I have a job_uuid and update_progress_only is true, I only need the progress. # If I have a job_uuid and update_progress_only is true, I only need the progress.
my $problem = 0; my $problem = 0;
@ -6804,6 +6812,12 @@ sub insert_or_update_jobs
return(""); return("");
} }
if (not $job_updated)
{
$job_updated = time;
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => $debug, list => { job_updated => $job_updated }});
}
# If we don't have a UUID, see if we can find one for the given job name. # If we don't have a UUID, see if we can find one for the given job name.
if (not $job_uuid) if (not $job_uuid)
{ {
@ -10493,6 +10507,10 @@ parameters;
If this is passed an array reference, SQL queries will be pushed into the array instead of actually committed to databases. It will be up to the caller to commit the queries. If this is passed an array reference, SQL queries will be pushed into the array instead of actually committed to databases. It will be up to the caller to commit the queries.
=head3 delete (optional, default '0')
If set to C<< 1 >>, the associated C<< temperature_uuid >> will be deleted. When set, only C<< temperature_uuid >> is required.
=head3 temperature_uuid (optional) =head3 temperature_uuid (optional)
Is passed, the specific entry will be updated. Is passed, the specific entry will be updated.
@ -10547,7 +10565,8 @@ sub insert_or_update_temperature
my $uuid = defined $parameter->{uuid} ? $parameter->{uuid} : ""; my $uuid = defined $parameter->{uuid} ? $parameter->{uuid} : "";
my $file = defined $parameter->{file} ? $parameter->{file} : ""; my $file = defined $parameter->{file} ? $parameter->{file} : "";
my $line = defined $parameter->{line} ? $parameter->{line} : ""; my $line = defined $parameter->{line} ? $parameter->{line} : "";
my $cache = defined $parameter->{cache} ? $parameter->{cache} : ""; my $cache = defined $parameter->{cache} ? $parameter->{cache} : 0;
my $delete = defined $parameter->{'delete'} ? $parameter->{'delete'} : 0;
my $temperature_uuid = defined $parameter->{temperature_uuid} ? $parameter->{temperature_uuid} : ""; my $temperature_uuid = defined $parameter->{temperature_uuid} ? $parameter->{temperature_uuid} : "";
my $temperature_host_uuid = defined $parameter->{temperature_host_uuid} ? $parameter->{temperature_host_uuid} : $anvil->Get->host_uuid; my $temperature_host_uuid = defined $parameter->{temperature_host_uuid} ? $parameter->{temperature_host_uuid} : $anvil->Get->host_uuid;
my $temperature_agent_name = defined $parameter->{temperature_agent_name} ? $parameter->{temperature_agent_name} : ""; my $temperature_agent_name = defined $parameter->{temperature_agent_name} ? $parameter->{temperature_agent_name} : "";
@ -10561,6 +10580,8 @@ sub insert_or_update_temperature
uuid => $uuid, uuid => $uuid,
file => $file, file => $file,
line => $line, line => $line,
cache => $cache,
'delete' => $delete,
temperature_uuid => $temperature_uuid, temperature_uuid => $temperature_uuid,
temperature_host_uuid => $temperature_host_uuid, temperature_host_uuid => $temperature_host_uuid,
temperature_agent_name => $temperature_agent_name, temperature_agent_name => $temperature_agent_name,
@ -10572,59 +10593,63 @@ sub insert_or_update_temperature
temperature_weight => $temperature_weight, temperature_weight => $temperature_weight,
}}); }});
# Pointy end up?
if ($temperature_state eq "norminal")
{
$temperature_state = "nominal";
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => $debug, list => { temperature_state => $temperature_state }});
}
if (not $temperature_agent_name) # Pointy end up?
{ if (not $delete)
$anvil->Log->entry({source => $THIS_FILE, line => __LINE__, level => 0, priority => "err", key => "log_0020", variables => { method => "Database->insert_or_update_temperature()", parameter => "temperature_agent_name" }});
return("");
}
if (not $temperature_sensor_host)
{
$anvil->Log->entry({source => $THIS_FILE, line => __LINE__, level => 0, priority => "err", key => "log_0020", variables => { method => "Database->insert_or_update_temperature()", parameter => "temperature_sensor_host" }});
return("");
}
if (not $temperature_sensor_name)
{
$anvil->Log->entry({source => $THIS_FILE, line => __LINE__, level => 0, priority => "err", key => "log_0020", variables => { method => "Database->insert_or_update_temperature()", parameter => "temperature_sensor_name" }});
return("");
}
if ($temperature_value_c eq "")
{
$anvil->Log->entry({source => $THIS_FILE, line => __LINE__, level => 0, priority => "err", key => "log_0020", variables => { method => "Database->insert_or_update_temperature()", parameter => "temperature_value_c" }});
return("");
}
if (not $temperature_state)
{
$anvil->Log->entry({source => $THIS_FILE, line => __LINE__, level => 0, priority => "err", key => "log_0020", variables => { method => "Database->insert_or_update_temperature()", parameter => "temperature_state" }});
return("");
}
elsif (($temperature_state ne "ok") && ($temperature_state ne "warning") && ($temperature_state ne "critical"))
{
# Invalid value.
$anvil->Log->entry({source => $THIS_FILE, line => __LINE__, level => 0, priority => "err", key => "log_0546", variables => { temperature_state => $temperature_state }});
return("");
}
if (not $temperature_is)
{
$anvil->Log->entry({source => $THIS_FILE, line => __LINE__, level => 0, priority => "err", key => "log_0020", variables => { method => "Database->insert_or_update_temperature()", parameter => "temperature_is" }});
return("");
}
elsif (($temperature_is ne "nominal") && ($temperature_is ne "warning") && ($temperature_is ne "critical"))
{
# Invalid value.
$anvil->Log->entry({source => $THIS_FILE, line => __LINE__, level => 0, priority => "err", key => "log_0547", variables => { temperature_is => $temperature_is }});
return("");
}
if ($temperature_weight eq "")
{ {
$anvil->Log->entry({source => $THIS_FILE, line => __LINE__, level => 0, priority => "err", key => "log_0020", variables => { method => "Database->insert_or_update_temperature()", parameter => "temperature_weight" }}); if ($temperature_state eq "norminal")
return(""); {
$temperature_state = "nominal";
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => $debug, list => { temperature_state => $temperature_state }});
}
if (not $temperature_agent_name)
{
$anvil->Log->entry({source => $THIS_FILE, line => __LINE__, level => 0, priority => "err", key => "log_0020", variables => { method => "Database->insert_or_update_temperature()", parameter => "temperature_agent_name" }});
return("");
}
if (not $temperature_sensor_host)
{
$anvil->Log->entry({source => $THIS_FILE, line => __LINE__, level => 0, priority => "err", key => "log_0020", variables => { method => "Database->insert_or_update_temperature()", parameter => "temperature_sensor_host" }});
return("");
}
if (not $temperature_sensor_name)
{
$anvil->Log->entry({source => $THIS_FILE, line => __LINE__, level => 0, priority => "err", key => "log_0020", variables => { method => "Database->insert_or_update_temperature()", parameter => "temperature_sensor_name" }});
return("");
}
if ($temperature_value_c eq "")
{
$anvil->Log->entry({source => $THIS_FILE, line => __LINE__, level => 0, priority => "err", key => "log_0020", variables => { method => "Database->insert_or_update_temperature()", parameter => "temperature_value_c" }});
return("");
}
if (not $temperature_state)
{
$anvil->Log->entry({source => $THIS_FILE, line => __LINE__, level => 0, priority => "err", key => "log_0020", variables => { method => "Database->insert_or_update_temperature()", parameter => "temperature_state" }});
return("");
}
elsif (($temperature_state ne "ok") && ($temperature_state ne "warning") && ($temperature_state ne "critical"))
{
# Invalid value.
$anvil->Log->entry({source => $THIS_FILE, line => __LINE__, level => 0, priority => "err", key => "log_0546", variables => { temperature_state => $temperature_state }});
return("");
}
if (not $temperature_is)
{
$anvil->Log->entry({source => $THIS_FILE, line => __LINE__, level => 0, priority => "err", key => "log_0020", variables => { method => "Database->insert_or_update_temperature()", parameter => "temperature_is" }});
return("");
}
elsif (($temperature_is ne "nominal") && ($temperature_is ne "warning") && ($temperature_is ne "critical"))
{
# Invalid value.
$anvil->Log->entry({source => $THIS_FILE, line => __LINE__, level => 0, priority => "err", key => "log_0547", variables => { temperature_is => $temperature_is }});
return("");
}
if ($temperature_weight eq "")
{
$anvil->Log->entry({source => $THIS_FILE, line => __LINE__, level => 0, priority => "err", key => "log_0020", variables => { method => "Database->insert_or_update_temperature()", parameter => "temperature_weight" }});
return("");
}
} }
# If we don't have a temperature UUID, see if we can find one. # If we don't have a temperature UUID, see if we can find one.
@ -10657,6 +10682,51 @@ AND
} }
} }
if ($delete)
{
if (not $temperature_uuid)
{
$anvil->Log->entry({source => $THIS_FILE, line => __LINE__, level => 0, priority => "err", key => "log_0020", variables => { method => "Database->insert_or_update_temperature()", parameter => "temperature_uuid" }});
return("");
}
my $query = "
UPDATE
temperature
SET
temperature_state = 'DELETED',
modified_date = ".$anvil->Database->quote($anvil->data->{sys}{database}{timestamp})."
WHERE
temperature_uuid = ".$anvil->Database->quote($temperature_uuid).";
";
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 2, list => { query => $query }});
if (ref($cache) eq "ARRAY")
{
push @{$cache}, $query;
}
else
{
$anvil->Database->write({uuid => $uuid, query => $query, source => $file ? $file." -> ".$THIS_FILE : $THIS_FILE, line => $line ? $line." -> ".__LINE__ : __LINE__});
}
$query = "
DELETE FROM
temperature
WHERE
temperature_uuid = ".$anvil->Database->quote($temperature_uuid).";
";
push @{$anvil->data->{'scan-hpacucli'}{queries}}, $query;
if (ref($cache) eq "ARRAY")
{
push @{$cache}, $query;
}
else
{
$anvil->Database->write({uuid => $uuid, query => $query, source => $file ? $file." -> ".$THIS_FILE : $THIS_FILE, line => $line ? $line." -> ".__LINE__ : __LINE__});
}
return($temperature_uuid);
}
# If we have a temperature UUID now, look up the previous value and see if it has changed. If not, INSERT # If we have a temperature UUID now, look up the previous value and see if it has changed. If not, INSERT
# a new entry. # a new entry.
if ($temperature_uuid) if ($temperature_uuid)

@ -110,7 +110,12 @@ sub check_config
# known server. # known server.
$anvil->Database->get_mail_servers({debug => $debug}); $anvil->Database->get_mail_servers({debug => $debug});
my ($oldest_message) = $anvil->Email->check_queue({debug => $debug}); my ($oldest_message) = $anvil->Email->check_queue({debug => $debug});
if ($oldest_message > 600) if ($oldest_message eq "!!error!!")
{
# Something went wrong, but the problem would already be logged, so just return.
$problem = 1;
}
elsif ($oldest_message > 600)
{ {
# Switch out mail servers. If there's only one mail server, this just checks the existing # Switch out mail servers. If there's only one mail server, this just checks the existing
# config. # config.
@ -190,7 +195,7 @@ sub check_config
=head2 check_queue =head2 check_queue
This method looks to see how many email messages are in the send queue and how long they've been there. The age of the older queued message is returned (in seconds). This method looks to see how many email messages are in the send queue and how long they've been there. The age of the older queued message is returned (in seconds). If there is a problem, C<< !!error!! >> is returned.
This method takes no parameters. This method takes no parameters.
@ -204,12 +209,19 @@ sub check_queue
$anvil->Log->entry({source => $THIS_FILE, line => __LINE__, level => $debug, key => "log_0125", variables => { method => "Email->check_queue()" }}); $anvil->Log->entry({source => $THIS_FILE, line => __LINE__, level => $debug, key => "log_0125", variables => { method => "Email->check_queue()" }});
my $oldest_message = 0; my $oldest_message = 0;
my ($queue, $return_code) = $anvil->System->call({debug => 2, shell_call => $anvil->data->{path}{exe}{postqueue}." -j"}); my ($queue, $return_code) = $anvil->System->call({debug => $debug, shell_call => $anvil->data->{path}{exe}{postqueue}." -j"});
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => $debug, list => { $anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => $debug, list => {
queue => $queue, queue => $queue,
return_code => $return_code, return_code => $return_code,
}}); }});
if ($queue =~ /^postqueue: warning:/)
{
# Something is up, we can't proceed.
$anvil->Log->entry({source => $THIS_FILE, line => __LINE__, level => 1, key => "warning_0069", variables => { output => $queue }});
return("!!error!!");
}
# This is empty if there is nothing in the queue. # This is empty if there is nothing in the queue.
foreach my $email (split/\n/, $queue) foreach my $email (split/\n/, $queue)
{ {
@ -1172,6 +1184,9 @@ sub _configure_for_server
}); });
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => $debug, list => { variable_uuid => $variable_uuid }}); $anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => $debug, list => { variable_uuid => $variable_uuid }});
# In some cases, postfix will already be running, but won't be enabled.
my $enable_return_code = $anvil->System->enable_daemon({daemon => "postfix.service"});
# Start the daemon # Start the daemon
if (not $postfix_started) if (not $postfix_started)
{ {

@ -1574,3 +1574,8 @@ ip link set <dev> mtu 9000
netsh interface ipv4 set subinterface "Local Area Connection" mtu=nnnn store=persistent netsh interface ipv4 set subinterface "Local Area Connection" mtu=nnnn store=persistent
yum install kernel-2.6.32-754.27.1.el6.x86_64 kernel-devel-2.6.32-754.27.1.el6.x86_64 kernel-headers-2.6.32-754.27.1.el6.x86_64 yum install kernel-2.6.32-754.27.1.el6.x86_64 kernel-devel-2.6.32-754.27.1.el6.x86_64 kernel-headers-2.6.32-754.27.1.el6.x86_64
DRBD Notes;
* c-max-rate is default 100M. Detect when the SN is 10Gbps and up to 750M
* drbdsetup show <resource> --show-defaults <- shows defaults

@ -87,6 +87,7 @@ Requires: screen
Requires: smartmontools Requires: smartmontools
Requires: syslinux Requires: syslinux
Requires: tmux Requires: tmux
Requires: unzip
Requires: usbutils Requires: usbutils
Requires: vim Requires: vim
Requires: wget Requires: wget
@ -101,7 +102,7 @@ Common base libraries required for the Anvil! system.
%package striker %package striker
Summary: Alteeve's Anvil! Striker dashboard package Summary: Alteeve's Anvil! Striker dashboard package
Requires: anvil-core Requires: anvil-core == %{version}-%{release}
Requires: anvil-striker-extra Requires: anvil-striker-extra
Requires: bpg-dejavu-sans-fonts Requires: bpg-dejavu-sans-fonts
Requires: createrepo Requires: createrepo
@ -135,7 +136,7 @@ NOTE: This installs and enables Gnome desktop.
%package node %package node
Summary: Alteeve's Anvil! node package Summary: Alteeve's Anvil! node package
Requires: anvil-core Requires: anvil-core == %{version}-%{release}
Requires: drbd90-utils Requires: drbd90-utils
Requires: kmod-drbd90 Requires: kmod-drbd90
Requires: libvirt Requires: libvirt
@ -165,7 +166,7 @@ NOTE: LINBIT customers must have access to the LINBIT repositories configured.
%package dr %package dr
Summary: Alteeve's Anvil! DR host package Summary: Alteeve's Anvil! DR host package
Requires: anvil-core Requires: anvil-core == %{version}-%{release}
Requires: drbd90-utils Requires: drbd90-utils
Requires: kmod-drbd90 Requires: kmod-drbd90
Requires: libvirt Requires: libvirt

@ -14,6 +14,8 @@
# - Support UPSes with extended runtime batteries # - Support UPSes with extended runtime batteries
# - Pick a battery temperature where the UPS will automatically shut down if it passes over. # - Pick a battery temperature where the UPS will automatically shut down if it passes over.
# - Add support for sudden temperature jumps in process_temperature(). # - Add support for sudden temperature jumps in process_temperature().
# - It might be possible that a battery goes over temp, then is removed and not replaced, the UPS could keep
# reporting a temp anomoly.
# #
# Use my modules. # Use my modules.

@ -1174,6 +1174,21 @@ AND
"new::${machine}::temperature::${scan_ipmitool_sensor_name}::temperature_uuid" => $anvil->data->{new}{$machine}{temperature}{$scan_ipmitool_sensor_name}{temperature_uuid}, "new::${machine}::temperature::${scan_ipmitool_sensor_name}::temperature_uuid" => $anvil->data->{new}{$machine}{temperature}{$scan_ipmitool_sensor_name}{temperature_uuid},
}}); }});
} }
# Now, if any undeleted old entries remain, delete them from the database.
foreach my $ipmitool_sensor_name (sort {$a cmp $b} keys %{$anvil->data->{old}{$machine}{temperature}})
{
my $temperature_uuid = $anvil->data->{old}{$machine}{temperature}{$scan_ipmitool_sensor_name}{temperature_uuid};
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 2, list => { temperature_uuid => $temperature_uuid }});
$temperature_uuid = $anvil->Database->insert_or_update_temperature({
cache => $anvil->data->{'scan-ipmitool'}{queries},
debug => 2,
'delete' => 1,
temperature_uuid => $temperature_uuid,
});
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 2, list => { temperature_uuid => $temperature_uuid }});
}
# Now commit the changes. # Now commit the changes.
$anvil->Database->write({query => $anvil->data->{'scan-ipmitool'}{queries}, source => $THIS_FILE, line => __LINE__}); $anvil->Database->write({query => $anvil->data->{'scan-ipmitool'}{queries}, source => $THIS_FILE, line => __LINE__});

@ -515,7 +515,7 @@ AND
} }
$health_uuid = $anvil->Database->insert_or_update_health({ $health_uuid = $anvil->Database->insert_or_update_health({
debug => 2, debug => 2,
cache => $anvil->data->{'scan-ipmitool'}{queries}, cache => $anvil->data->{'scan-storcli'}{queries},
health_uuid => $health_uuid, health_uuid => $health_uuid,
health_host_uuid => $anvil->Get->host_uuid, health_host_uuid => $anvil->Get->host_uuid,
health_agent_name => $THIS_FILE, health_agent_name => $THIS_FILE,
@ -531,7 +531,7 @@ AND
# Well set the source name to 'DELETED'. # Well set the source name to 'DELETED'.
my $health_uuid = $anvil->Database->insert_or_update_health({ my $health_uuid = $anvil->Database->insert_or_update_health({
debug => 2, debug => 2,
cache => $anvil->data->{'scan-ipmitool'}{queries}, cache => $anvil->data->{'scan-storcli'}{queries},
'delete' => 1, 'delete' => 1,
health_uuid => $anvil->data->{health}{old}{$health_source_name}{uuid}, health_uuid => $anvil->data->{health}{old}{$health_source_name}{uuid},
}); });
@ -636,15 +636,15 @@ AND
}}); }});
} }
### TODO: Left off here.
# Store # Store
my $temperature_uuid = ""; my $temperature_uuid = "";
if (exists $anvil->data->{old}{temperature}{$variable}{$serial_number}) if (exists $anvil->data->{old}{temperature}{$variable}{$serial_number})
{ {
$temperature_uuid = $anvil->data->{old}{temperature}{$variable}{$serial_number}{temperature_uuid}; $temperature_uuid = $anvil->data->{old}{temperature}{$variable}{$serial_number}{temperature_uuid};
delete $anvil->data->{old}{temperature}{$variable}{$serial_number};
} }
$temperature_uuid = $anvil->Database->insert_or_update_temperature({ $temperature_uuid = $anvil->Database->insert_or_update_temperature({
cache => $anvil->data->{'scan-ipmitool'}{queries}, cache => $anvil->data->{'scan-storcli'}{queries},
debug => 2, debug => 2,
temperature_uuid => $temperature_uuid, temperature_uuid => $temperature_uuid,
temperature_host_uuid => $anvil->Get->host_uuid, temperature_host_uuid => $anvil->Get->host_uuid,
@ -659,6 +659,21 @@ AND
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 2, list => { temperature_uuid => $temperature_uuid }}); $anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 2, list => { temperature_uuid => $temperature_uuid }});
} }
} }
# Now, if any undeleted old entries remain, delete them from the database.
foreach my $serial_number (sort {$a cmp $b} keys %{$anvil->data->{old}{temperature}{$variable}})
{
my $temperature_uuid = $anvil->data->{old}{temperature}{$variable}{$serial_number}{temperature_uuid};
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 2, list => { temperature_uuid => $temperature_uuid }});
$temperature_uuid = $anvil->Database->insert_or_update_temperature({
cache => $anvil->data->{'scan-storcli'}{queries},
debug => 2,
'delete' => 1,
temperature_uuid => $temperature_uuid,
});
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 2, list => { temperature_uuid => $temperature_uuid }});
}
# Commit the queries. # Commit the queries.
$anvil->Database->write({query => $anvil->data->{'scan-storcli'}{queries}, source => $THIS_FILE, line => __LINE__}); $anvil->Database->write({query => $anvil->data->{'scan-storcli'}{queries}, source => $THIS_FILE, line => __LINE__});
@ -745,12 +760,12 @@ sub process_drive_groups
if (not $host_controller_serial_number) if (not $host_controller_serial_number)
{ {
# Error! # Error!
$anvil->Log->entry({source => $THIS_FILE, line => __LINE__, level => 0, key => "scan_storcli_error_0011", variables => { id_string => $scan_storcli_virtual_drive_id_string }}); $anvil->Log->entry({source => $THIS_FILE, line => __LINE__, 'print' => 1, level => 0, key => "scan_storcli_error_0011", variables => { id_string => $scan_storcli_virtual_drive_id_string }});
$anvil->nice_exit({exit_code => 11}); $anvil->nice_exit({exit_code => 11});
} }
if (not $controller_uuid) if (not $controller_uuid)
{ {
$anvil->Log->entry({source => $THIS_FILE, line => __LINE__, level => 0, key => "scan_storcli_error_0008", variables => { serial_number => $host_controller_serial_number }}); $anvil->Log->entry({source => $THIS_FILE, line => __LINE__, 'print' => 1, level => 0, key => "scan_storcli_error_0008", variables => { serial_number => $host_controller_serial_number }});
$anvil->nice_exit({exit_code => 8}); $anvil->nice_exit({exit_code => 8});
} }
@ -931,7 +946,7 @@ sub process_drive_groups
alert_level => "notice", alert_level => "notice",
message => "scan_storcli_note_0005", message => "scan_storcli_note_0005",
variables => $variables, variables => $variables,
sort_position => $anvil->data->{'scan-ipmitool'}{alert_sort}++, sort_position => $anvil->data->{'scan-storcli'}{alert_sort}++,
set_by => $THIS_FILE, set_by => $THIS_FILE,
}); });
@ -1003,7 +1018,7 @@ INSERT INTO
message => "scan_storcli_note_0002", message => "scan_storcli_note_0002",
show_header => 0, show_header => 0,
variables => $variables, variables => $variables,
sort_position => $anvil->data->{'scan-ipmitool'}{alert_sort}++, sort_position => $anvil->data->{'scan-storcli'}{alert_sort}++,
set_by => $THIS_FILE, set_by => $THIS_FILE,
}); });
@ -1086,7 +1101,7 @@ INSERT INTO
if (not defined $old_drive_group_virtual_drive_uuid) if (not defined $old_drive_group_virtual_drive_uuid)
{ {
$anvil->Log->entry({source => $THIS_FILE, line => __LINE__, level => 0, key => "scan_storcli_error_0014", variables => { drive_group => $drive_group }}); $anvil->Log->entry({source => $THIS_FILE, line => __LINE__, 'print' => 1, level => 0, key => "scan_storcli_error_0014", variables => { drive_group => $drive_group }});
$anvil->nice_exit({exit_code => 14}); $anvil->nice_exit({exit_code => 14});
} }
@ -1148,7 +1163,7 @@ INSERT INTO
message => $message_key, message => $message_key,
show_header => 0, show_header => 0,
variables => $variables, variables => $variables,
sort_position => $anvil->data->{'scan-ipmitool'}{alert_sort}++, sort_position => $anvil->data->{'scan-storcli'}{alert_sort}++,
set_by => $THIS_FILE, set_by => $THIS_FILE,
}); });
$main_table_changed = 1; $main_table_changed = 1;
@ -1234,7 +1249,7 @@ WHERE
message => $message_key, message => $message_key,
show_header => $main_table_changed ? 0 : 1, show_header => $main_table_changed ? 0 : 1,
variables => $variables, variables => $variables,
sort_position => $anvil->data->{'scan-ipmitool'}{alert_sort}++, sort_position => $anvil->data->{'scan-storcli'}{alert_sort}++,
set_by => $THIS_FILE, set_by => $THIS_FILE,
}); });
@ -1267,7 +1282,7 @@ WHERE
message => "scan_storcli_warning_0043", message => "scan_storcli_warning_0043",
show_header => $main_table_changed ? 0 : 1, show_header => $main_table_changed ? 0 : 1,
variables => $variables, variables => $variables,
sort_position => $anvil->data->{'scan-ipmitool'}{alert_sort}++, sort_position => $anvil->data->{'scan-storcli'}{alert_sort}++,
set_by => $THIS_FILE, set_by => $THIS_FILE,
}); });
@ -1337,7 +1352,7 @@ INSERT INTO
message => "scan_storcli_warning_0028", message => "scan_storcli_warning_0028",
show_header => $main_table_changed ? 0 : 1, show_header => $main_table_changed ? 0 : 1,
variables => $variables, variables => $variables,
sort_position => $anvil->data->{'scan-ipmitool'}{alert_sort}++, sort_position => $anvil->data->{'scan-storcli'}{alert_sort}++,
set_by => $THIS_FILE, set_by => $THIS_FILE,
}); });
@ -1402,12 +1417,12 @@ sub process_virtual_drives
if (not $host_controller_serial_number) if (not $host_controller_serial_number)
{ {
# Error! # Error!
$anvil->Log->entry({source => $THIS_FILE, line => __LINE__, level => 0, key => "scan_storcli_error_0010", variables => { id_string => $scan_storcli_virtual_drive_id_string }}); $anvil->Log->entry({source => $THIS_FILE, line => __LINE__, 'print' => 1, level => 0, key => "scan_storcli_error_0010", variables => { id_string => $scan_storcli_virtual_drive_id_string }});
$anvil->nice_exit({exit_code => 10}); $anvil->nice_exit({exit_code => 10});
} }
if (not $controller_uuid) if (not $controller_uuid)
{ {
$anvil->Log->entry({source => $THIS_FILE, line => __LINE__, level => 0, key => "scan_storcli_error_0008", variables => { serial_number => $host_controller_serial_number }}); $anvil->Log->entry({source => $THIS_FILE, line => __LINE__, 'print' => 1, level => 0, key => "scan_storcli_error_0008", variables => { serial_number => $host_controller_serial_number }});
$anvil->nice_exit({exit_code => 8}); $anvil->nice_exit({exit_code => 8});
} }
@ -1632,7 +1647,7 @@ sub process_virtual_drives
alert_level => "notice", alert_level => "notice",
message => "scan_storcli_note_0004", message => "scan_storcli_note_0004",
variables => $variables, variables => $variables,
sort_position => $anvil->data->{'scan-ipmitool'}{alert_sort}++, sort_position => $anvil->data->{'scan-storcli'}{alert_sort}++,
set_by => $THIS_FILE, set_by => $THIS_FILE,
}); });
@ -1702,7 +1717,7 @@ INSERT INTO
show_header => 0, show_header => 0,
message => "scan_storcli_note_0002", message => "scan_storcli_note_0002",
variables => $variables, variables => $variables,
sort_position => $anvil->data->{'scan-ipmitool'}{alert_sort}++, sort_position => $anvil->data->{'scan-storcli'}{alert_sort}++,
set_by => $THIS_FILE, set_by => $THIS_FILE,
}); });
@ -1850,7 +1865,7 @@ INSERT INTO
clear_alert => $cleared, clear_alert => $cleared,
message => $message_key, message => $message_key,
variables => $variables, variables => $variables,
sort_position => $anvil->data->{'scan-ipmitool'}{alert_sort}++, sort_position => $anvil->data->{'scan-storcli'}{alert_sort}++,
set_by => $THIS_FILE, set_by => $THIS_FILE,
}); });
$main_table_changed = 1; $main_table_changed = 1;
@ -1969,7 +1984,7 @@ WHERE
show_header => $main_table_changed ? 0 : 1, show_header => $main_table_changed ? 0 : 1,
message => $message_key, message => $message_key,
variables => $variables, variables => $variables,
sort_position => $anvil->data->{'scan-ipmitool'}{alert_sort}++, sort_position => $anvil->data->{'scan-storcli'}{alert_sort}++,
set_by => $THIS_FILE, set_by => $THIS_FILE,
}); });
@ -2003,7 +2018,7 @@ WHERE
show_header => $main_table_changed ? 0 : 1, show_header => $main_table_changed ? 0 : 1,
message => "scan_storcli_warning_0022", message => "scan_storcli_warning_0022",
variables => $variables, variables => $variables,
sort_position => $anvil->data->{'scan-ipmitool'}{alert_sort}++, sort_position => $anvil->data->{'scan-storcli'}{alert_sort}++,
set_by => $THIS_FILE, set_by => $THIS_FILE,
}); });
@ -2074,7 +2089,7 @@ INSERT INTO
show_header => $main_table_changed ? 0 : 1, show_header => $main_table_changed ? 0 : 1,
message => "scan_storcli_warning_0021", message => "scan_storcli_warning_0021",
variables => $variables, variables => $variables,
sort_position => $anvil->data->{'scan-ipmitool'}{alert_sort}++, sort_position => $anvil->data->{'scan-storcli'}{alert_sort}++,
set_by => $THIS_FILE, set_by => $THIS_FILE,
}); });
@ -2145,7 +2160,7 @@ WHERE
show_header => 1, show_header => 1,
message => "scan_storcli_warning_0023", message => "scan_storcli_warning_0023",
variables => $variables, variables => $variables,
sort_position => $anvil->data->{'scan-ipmitool'}{alert_sort}++, sort_position => $anvil->data->{'scan-storcli'}{alert_sort}++,
set_by => $THIS_FILE, set_by => $THIS_FILE,
}); });
@ -2202,7 +2217,7 @@ WHERE
# If I still don't have a controller UUID, then something serious went wrong. # If I still don't have a controller UUID, then something serious went wrong.
if (not $controller_uuid) if (not $controller_uuid)
{ {
$anvil->Log->entry({source => $THIS_FILE, line => __LINE__, level => 0, key => "scan_storcli_error_0015", variables => { drive_group_uuid => $scan_storcli_drive_group_uuid }}); $anvil->Log->entry({source => $THIS_FILE, line => __LINE__, 'print' => 1, level => 0, key => "scan_storcli_error_0015", variables => { drive_group_uuid => $scan_storcli_drive_group_uuid }});
$anvil->nice_exit({exit_code => 15}); $anvil->nice_exit({exit_code => 15});
} }
@ -2235,7 +2250,7 @@ WHERE
show_header => 1, show_header => 1,
message => "scan_storcli_warning_0028", message => "scan_storcli_warning_0028",
variables => $variables, variables => $variables,
sort_position => $anvil->data->{'scan-ipmitool'}{alert_sort}++, sort_position => $anvil->data->{'scan-storcli'}{alert_sort}++,
set_by => $THIS_FILE, set_by => $THIS_FILE,
}); });
@ -2328,7 +2343,7 @@ sub process_physical_disks
show_header => 1, show_header => 1,
message => "scan_storcli_warning_0035", message => "scan_storcli_warning_0035",
variables => $variables, variables => $variables,
sort_position => $anvil->data->{'scan-ipmitool'}{alert_sort}++, sort_position => $anvil->data->{'scan-storcli'}{alert_sort}++,
set_by => $THIS_FILE, set_by => $THIS_FILE,
}); });
@ -2378,7 +2393,7 @@ sub process_a_physical_disk
else else
{ {
# Error! # Error!
$anvil->Log->entry({source => $THIS_FILE, line => __LINE__, level => 0, key => "scan_storcli_error_0013", variables => { $anvil->Log->entry({source => $THIS_FILE, line => __LINE__, 'print' => 1, level => 0, key => "scan_storcli_error_0013", variables => {
virtual_drive => $scan_storcli_virtual_drive_id_string, virtual_drive => $scan_storcli_virtual_drive_id_string,
drive_group => $drive_group, drive_group => $drive_group,
enclosure_id => $enclosure_id, enclosure_id => $enclosure_id,
@ -2394,7 +2409,7 @@ sub process_a_physical_disk
if (not $anvil->data->{virtual_drive}{$scan_storcli_virtual_drive_id_string}{drive_group}{$drive_group}{enclosure_id}{$enclosure_id}{slot_number}{$slot_number}{variable}{on_controller}) if (not $anvil->data->{virtual_drive}{$scan_storcli_virtual_drive_id_string}{drive_group}{$drive_group}{enclosure_id}{$enclosure_id}{slot_number}{$slot_number}{variable}{on_controller})
{ {
# Error! # Error!
$anvil->Log->entry({source => $THIS_FILE, line => __LINE__, level => 0, key => "scan_storcli_error_0012", variables => { serial_number => $scan_storcli_physical_drive_serial_number }}); $anvil->Log->entry({source => $THIS_FILE, line => __LINE__, 'print' => 1, level => 0, key => "scan_storcli_error_0012", variables => { serial_number => $scan_storcli_physical_drive_serial_number }});
$anvil->nice_exit({exit_code => 12}); $anvil->nice_exit({exit_code => 12});
} }
@ -2404,7 +2419,7 @@ sub process_a_physical_disk
# Now make sure I can translate this to a UUID. # Now make sure I can translate this to a UUID.
if (not $anvil->data->{'scan-storcli'}{controllers}{by_serial}{$host_controller_serial_number}) if (not $anvil->data->{'scan-storcli'}{controllers}{by_serial}{$host_controller_serial_number})
{ {
$anvil->Log->entry({source => $THIS_FILE, line => __LINE__, level => 0, key => "scan_storcli_error_0008", variables => { serial_number => $host_controller_serial_number }}); $anvil->Log->entry({source => $THIS_FILE, line => __LINE__, 'print' => 1, level => 0, key => "scan_storcli_error_0008", variables => { serial_number => $host_controller_serial_number }});
$anvil->nice_exit({exit_code => 8}); $anvil->nice_exit({exit_code => 8});
} }
my $controller_uuid = $anvil->data->{'scan-storcli'}{controllers}{by_serial}{$host_controller_serial_number}; my $controller_uuid = $anvil->data->{'scan-storcli'}{controllers}{by_serial}{$host_controller_serial_number};
@ -2538,7 +2553,7 @@ sub process_a_physical_disk
show_header => 1, show_header => 1,
message => "scan_storcli_note_0006", message => "scan_storcli_note_0006",
variables => $variables, variables => $variables,
sort_position => $anvil->data->{'scan-ipmitool'}{alert_sort}++, sort_position => $anvil->data->{'scan-storcli'}{alert_sort}++,
set_by => $THIS_FILE, set_by => $THIS_FILE,
}); });
@ -2713,7 +2728,7 @@ INSERT INTO
show_header => 0, show_header => 0,
message => $message_key, message => $message_key,
variables => $variables, variables => $variables,
sort_position => $anvil->data->{'scan-ipmitool'}{alert_sort}++, sort_position => $anvil->data->{'scan-storcli'}{alert_sort}++,
set_by => $THIS_FILE, set_by => $THIS_FILE,
}); });
@ -2847,7 +2862,7 @@ INSERT INTO
show_header => 0, show_header => 0,
message => $message_key, message => $message_key,
variables => $variables, variables => $variables,
sort_position => $anvil->data->{'scan-ipmitool'}{alert_sort}++, sort_position => $anvil->data->{'scan-storcli'}{alert_sort}++,
set_by => $THIS_FILE, set_by => $THIS_FILE,
}); });
$main_table_changed = 1; $main_table_changed = 1;
@ -3273,7 +3288,7 @@ WHERE
show_header => $main_table_changed ? 0 : 1, show_header => $main_table_changed ? 0 : 1,
message => $message_key, message => $message_key,
variables => $variables, variables => $variables,
sort_position => $anvil->data->{'scan-ipmitool'}{alert_sort}++, sort_position => $anvil->data->{'scan-storcli'}{alert_sort}++,
set_by => $THIS_FILE, set_by => $THIS_FILE,
}); });
@ -3306,7 +3321,7 @@ WHERE
show_header => $main_table_changed ? 0 : 1, show_header => $main_table_changed ? 0 : 1,
message => "scan_storcli_warning_0033", message => "scan_storcli_warning_0033",
variables => $variables, variables => $variables,
sort_position => $anvil->data->{'scan-ipmitool'}{alert_sort}++, sort_position => $anvil->data->{'scan-storcli'}{alert_sort}++,
set_by => $THIS_FILE, set_by => $THIS_FILE,
}); });
@ -3377,7 +3392,7 @@ INSERT INTO
show_header => $main_table_changed ? 0 : 1, show_header => $main_table_changed ? 0 : 1,
message => "scan_storcli_warning_0034", message => "scan_storcli_warning_0034",
variables => $variables, variables => $variables,
sort_position => $anvil->data->{'scan-ipmitool'}{alert_sort}++, sort_position => $anvil->data->{'scan-storcli'}{alert_sort}++,
set_by => $THIS_FILE, set_by => $THIS_FILE,
}); });
@ -3473,7 +3488,7 @@ sub process_cachevaults
if (not $anvil->data->{cachevault}{serial_number}{$cachevault_serial_number}{host_controller_serial_number}) if (not $anvil->data->{cachevault}{serial_number}{$cachevault_serial_number}{host_controller_serial_number})
{ {
# Error! # Error!
$anvil->Log->entry({source => $THIS_FILE, line => __LINE__, level => 1, key => "scan_storcli_error_0009", variables => { serial_number => $cachevault_serial_number }}); $anvil->Log->entry({source => $THIS_FILE, line => __LINE__, 'print' => 1, level => 0, key => "scan_storcli_error_0009", variables => { serial_number => $cachevault_serial_number }});
$anvil->nice_exit({exit_code => 9}); $anvil->nice_exit({exit_code => 9});
} }
my $host_controller_serial_number = $anvil->data->{cachevault}{serial_number}{$cachevault_serial_number}{host_controller_serial_number}; my $host_controller_serial_number = $anvil->data->{cachevault}{serial_number}{$cachevault_serial_number}{host_controller_serial_number};
@ -3481,7 +3496,7 @@ sub process_cachevaults
if (not $anvil->data->{'scan-storcli'}{controllers}{by_serial}{$host_controller_serial_number}) if (not $anvil->data->{'scan-storcli'}{controllers}{by_serial}{$host_controller_serial_number})
{ {
$anvil->Log->entry({source => $THIS_FILE, line => __LINE__, level => 1, key => "scan_storcli_error_0008", variables => { serial_number => $host_controller_serial_number }}); $anvil->Log->entry({source => $THIS_FILE, line => __LINE__, 'print' => 1, level => 0, key => "scan_storcli_error_0008", variables => { serial_number => $host_controller_serial_number }});
$anvil->nice_exit({exit_code => 8}); $anvil->nice_exit({exit_code => 8});
} }
my $controller_uuid = $anvil->data->{'scan-storcli'}{controllers}{by_serial}{$host_controller_serial_number}; my $controller_uuid = $anvil->data->{'scan-storcli'}{controllers}{by_serial}{$host_controller_serial_number};
@ -3574,7 +3589,7 @@ sub process_cachevaults
alert_level => "notice", alert_level => "notice",
message => "scan_storcli_note_0007", message => "scan_storcli_note_0007",
variables => $variables, variables => $variables,
sort_position => $anvil->data->{'scan-ipmitool'}{alert_sort}++, sort_position => $anvil->data->{'scan-storcli'}{alert_sort}++,
set_by => $THIS_FILE, set_by => $THIS_FILE,
}); });
@ -3745,7 +3760,7 @@ INSERT INTO
message => $message_key, message => $message_key,
variables => $variables, variables => $variables,
show_header => 0, show_header => 0,
sort_position => $anvil->data->{'scan-ipmitool'}{alert_sort}++, sort_position => $anvil->data->{'scan-storcli'}{alert_sort}++,
set_by => $THIS_FILE, set_by => $THIS_FILE,
}); });
@ -3872,7 +3887,7 @@ INSERT INTO
message => $message_key, message => $message_key,
variables => $variables, variables => $variables,
show_header => 0, show_header => 0,
sort_position => $anvil->data->{'scan-ipmitool'}{alert_sort}++, sort_position => $anvil->data->{'scan-storcli'}{alert_sort}++,
set_by => $THIS_FILE, set_by => $THIS_FILE,
}); });
$main_table_changed = 1; $main_table_changed = 1;
@ -4293,7 +4308,7 @@ WHERE
message => $message_key, message => $message_key,
variables => $variables, variables => $variables,
show_header => $main_table_changed ? 0 : 1, show_header => $main_table_changed ? 0 : 1,
sort_position => $anvil->data->{'scan-ipmitool'}{alert_sort}++, sort_position => $anvil->data->{'scan-storcli'}{alert_sort}++,
set_by => $THIS_FILE, set_by => $THIS_FILE,
}); });
@ -4326,7 +4341,7 @@ WHERE
message => "scan_storcli_warning_0041", message => "scan_storcli_warning_0041",
variables => $variables, variables => $variables,
show_header => $main_table_changed ? 0 : 1, show_header => $main_table_changed ? 0 : 1,
sort_position => $anvil->data->{'scan-ipmitool'}{alert_sort}++, sort_position => $anvil->data->{'scan-storcli'}{alert_sort}++,
set_by => $THIS_FILE, set_by => $THIS_FILE,
}); });
@ -4397,7 +4412,7 @@ INSERT INTO
message => "scan_storcli_warning_0040", message => "scan_storcli_warning_0040",
variables => $variables, variables => $variables,
show_header => $main_table_changed ? 0 : 1, show_header => $main_table_changed ? 0 : 1,
sort_position => $anvil->data->{'scan-ipmitool'}{alert_sort}++, sort_position => $anvil->data->{'scan-storcli'}{alert_sort}++,
set_by => $THIS_FILE, set_by => $THIS_FILE,
}); });
@ -4460,7 +4475,7 @@ WHERE
message => "scan_storcli_warning_0042", message => "scan_storcli_warning_0042",
variables => $variables, variables => $variables,
show_header => 1, show_header => 1,
sort_position => $anvil->data->{'scan-ipmitool'}{alert_sort}++, sort_position => $anvil->data->{'scan-storcli'}{alert_sort}++,
set_by => $THIS_FILE, set_by => $THIS_FILE,
}); });
@ -4579,7 +4594,7 @@ sub process_bbus
if (not $anvil->data->{bbu}{serial_number}{$bbu_serial_number}{host_controller_serial_number}) if (not $anvil->data->{bbu}{serial_number}{$bbu_serial_number}{host_controller_serial_number})
{ {
# Error! # Error!
$anvil->Log->entry({source => $THIS_FILE, line => __LINE__, level => 1, key => "scan_storcli_error_0007", variables => { serial_number => $bbu_serial_number }}); $anvil->Log->entry({source => $THIS_FILE, line => __LINE__, 'print' => 1, level => 0, key => "scan_storcli_error_0007", variables => { serial_number => $bbu_serial_number }});
$anvil->nice_exit({exit_code => 7}); $anvil->nice_exit({exit_code => 7});
} }
my $host_controller_serial_number = $anvil->data->{bbu}{serial_number}{$bbu_serial_number}{host_controller_serial_number}; my $host_controller_serial_number = $anvil->data->{bbu}{serial_number}{$bbu_serial_number}{host_controller_serial_number};
@ -4587,7 +4602,7 @@ sub process_bbus
if (not $anvil->data->{'scan-storcli'}{controllers}{by_serial}{$host_controller_serial_number}) if (not $anvil->data->{'scan-storcli'}{controllers}{by_serial}{$host_controller_serial_number})
{ {
$anvil->Log->entry({source => $THIS_FILE, line => __LINE__, level => 1, key => "scan_storcli_error_0008", variables => { serial_number => $host_controller_serial_number }}); $anvil->Log->entry({source => $THIS_FILE, line => __LINE__, 'print' => 1, level => 0, key => "scan_storcli_error_0008", variables => { serial_number => $host_controller_serial_number }});
$anvil->nice_exit({exit_code => 8}); $anvil->nice_exit({exit_code => 8});
} }
my $controller_uuid = $anvil->data->{'scan-storcli'}{controllers}{by_serial}{$host_controller_serial_number}; my $controller_uuid = $anvil->data->{'scan-storcli'}{controllers}{by_serial}{$host_controller_serial_number};
@ -4680,7 +4695,7 @@ sub process_bbus
alert_level => "notice", alert_level => "notice",
message => "scan_storcli_note_0003", message => "scan_storcli_note_0003",
variables => $variables, variables => $variables,
sort_position => $anvil->data->{'scan-ipmitool'}{alert_sort}++, sort_position => $anvil->data->{'scan-storcli'}{alert_sort}++,
set_by => $THIS_FILE, set_by => $THIS_FILE,
}); });
@ -4849,7 +4864,7 @@ INSERT INTO
alert_level => $alert_level, alert_level => $alert_level,
message => $message_key, message => $message_key,
variables => $variables, variables => $variables,
sort_position => $anvil->data->{'scan-ipmitool'}{alert_sort}++, sort_position => $anvil->data->{'scan-storcli'}{alert_sort}++,
set_by => $THIS_FILE, set_by => $THIS_FILE,
}); });
@ -4974,7 +4989,7 @@ INSERT INTO
message => $message_key, message => $message_key,
variables => $variables, variables => $variables,
show_header => 0, show_header => 0,
sort_position => $anvil->data->{'scan-ipmitool'}{alert_sort}++, sort_position => $anvil->data->{'scan-storcli'}{alert_sort}++,
set_by => $THIS_FILE, set_by => $THIS_FILE,
}); });
@ -5421,7 +5436,7 @@ WHERE
message => $message_key, message => $message_key,
variables => $variables, variables => $variables,
show_header => $show_header, show_header => $show_header,
sort_position => $anvil->data->{'scan-ipmitool'}{alert_sort}++, sort_position => $anvil->data->{'scan-storcli'}{alert_sort}++,
set_by => $THIS_FILE, set_by => $THIS_FILE,
}); });
@ -5455,7 +5470,7 @@ WHERE
message => "scan_storcli_warning_0015", message => "scan_storcli_warning_0015",
variables => $variables, variables => $variables,
show_header => $show_header, show_header => $show_header,
sort_position => $anvil->data->{'scan-ipmitool'}{alert_sort}++, sort_position => $anvil->data->{'scan-storcli'}{alert_sort}++,
set_by => $THIS_FILE, set_by => $THIS_FILE,
}); });
@ -5526,7 +5541,7 @@ INSERT INTO
message => "scan_storcli_warning_0014", message => "scan_storcli_warning_0014",
variables => $variables, variables => $variables,
show_header => $show_header, show_header => $show_header,
sort_position => $anvil->data->{'scan-ipmitool'}{alert_sort}++, sort_position => $anvil->data->{'scan-storcli'}{alert_sort}++,
set_by => $THIS_FILE, set_by => $THIS_FILE,
}); });
@ -5588,7 +5603,7 @@ WHERE
message => "scan_storcli_warning_0016", message => "scan_storcli_warning_0016",
variables => $variables, variables => $variables,
show_header => 1, show_header => 1,
sort_position => $anvil->data->{'scan-ipmitool'}{alert_sort}++, sort_position => $anvil->data->{'scan-storcli'}{alert_sort}++,
set_by => $THIS_FILE, set_by => $THIS_FILE,
}); });
@ -5751,7 +5766,7 @@ sub process_controllers
alert_level => "notice", alert_level => "notice",
message => "scan_storcli_note_0001", message => "scan_storcli_note_0001",
variables => $variables, variables => $variables,
sort_position => $anvil->data->{'scan-ipmitool'}{alert_sort}++, sort_position => $anvil->data->{'scan-storcli'}{alert_sort}++,
set_by => $THIS_FILE, set_by => $THIS_FILE,
}); });
@ -5905,7 +5920,7 @@ INSERT INTO
alert_level => $alert_level, alert_level => $alert_level,
message => $message_key, message => $message_key,
variables => $variables, variables => $variables,
sort_position => $anvil->data->{'scan-ipmitool'}{alert_sort}++, sort_position => $anvil->data->{'scan-storcli'}{alert_sort}++,
set_by => $THIS_FILE, set_by => $THIS_FILE,
}); });
@ -5996,7 +6011,7 @@ INSERT INTO
alert_level => "warning", alert_level => "warning",
message => $message_key, message => $message_key,
variables => $variables, variables => $variables,
sort_position => $anvil->data->{'scan-ipmitool'}{alert_sort}++, sort_position => $anvil->data->{'scan-storcli'}{alert_sort}++,
set_by => $THIS_FILE}); set_by => $THIS_FILE});
$main_table_changed = 1; $main_table_changed = 1;
@ -6455,7 +6470,7 @@ AND
message => $message_key, message => $message_key,
variables => $variables, variables => $variables,
show_header => $alert_header, show_header => $alert_header,
sort_position => $anvil->data->{'scan-ipmitool'}{alert_sort}++, sort_position => $anvil->data->{'scan-storcli'}{alert_sort}++,
set_by => $THIS_FILE, set_by => $THIS_FILE,
}); });
@ -6489,7 +6504,7 @@ WHERE
message => "scan_storcli_warning_0004", message => "scan_storcli_warning_0004",
variables => $variables, variables => $variables,
show_header => $alert_header, show_header => $alert_header,
sort_position => $anvil->data->{'scan-ipmitool'}{alert_sort}++, sort_position => $anvil->data->{'scan-storcli'}{alert_sort}++,
set_by => $THIS_FILE, set_by => $THIS_FILE,
}); });
@ -6560,7 +6575,7 @@ INSERT INTO
message => "scan_storcli_warning_0007", message => "scan_storcli_warning_0007",
variables => $variables, variables => $variables,
show_header => $alert_header, show_header => $alert_header,
sort_position => $anvil->data->{'scan-ipmitool'}{alert_sort}++, sort_position => $anvil->data->{'scan-storcli'}{alert_sort}++,
set_by => $THIS_FILE, set_by => $THIS_FILE,
}); });
@ -6622,7 +6637,7 @@ WHERE
message => "scan_storcli_warning_0008", message => "scan_storcli_warning_0008",
variables => $variables, variables => $variables,
show_header => 1, show_header => 1,
sort_position => $anvil->data->{'scan-ipmitool'}{alert_sort}++, sort_position => $anvil->data->{'scan-storcli'}{alert_sort}++,
set_by => $THIS_FILE, set_by => $THIS_FILE,
}); });
@ -6737,7 +6752,7 @@ WHERE
show_header => 1, show_header => 1,
message => "scan_storcli_warning_0052", message => "scan_storcli_warning_0052",
variables => $variables, variables => $variables,
sort_position => $anvil->data->{'scan-ipmitool'}{alert_sort}++, sort_position => $anvil->data->{'scan-storcli'}{alert_sort}++,
set_by => $THIS_FILE, set_by => $THIS_FILE,
}); });
@ -9617,7 +9632,7 @@ sub get_controller_info
if (not $serial_number) if (not $serial_number)
{ {
# Error out. # Error out.
$anvil->Log->entry({source => $THIS_FILE, line => __LINE__, level => 1, 'print' => 1 , key => "scan_storcli_error_0006", variables => { adapter => $adapter }}); $anvil->Log->entry({source => $THIS_FILE, line => __LINE__, level => 0, 'print' => 1 , key => "scan_storcli_error_0006", variables => { adapter => $adapter }});
$anvil->nice_exit({exit_code => 6}); $anvil->nice_exit({exit_code => 6});
} }
@ -10026,14 +10041,14 @@ sub find_lsi_controllers
if (not -e $anvil->data->{path}{exe}{storcli64}) if (not -e $anvil->data->{path}{exe}{storcli64})
{ {
# Nope, exit. # Nope, exit.
$anvil->Log->entry({source => $THIS_FILE, line => __LINE__, 'print' => 1, level => 1, key => "scan_storcli_error_0001", variables => { path => $anvil->data->{path}{exe}{storcli64} }}); $anvil->Log->entry({source => $THIS_FILE, line => __LINE__, 'print' => 1, level => 0, key => "scan_storcli_error_0001", variables => { path => $anvil->data->{path}{exe}{storcli64} }});
$anvil->nice_exit({exit_code => 1}); $anvil->nice_exit({exit_code => 1});
} }
# Make sure it is executable # Make sure it is executable
if (not -x $anvil->data->{path}{exe}{storcli64}) if (not -x $anvil->data->{path}{exe}{storcli64})
{ {
$anvil->Log->entry({source => $THIS_FILE, line => __LINE__, 'print' => 1, level => 1, key => "scan_storcli_error_0002", variables => { path => $anvil->data->{path}{exe}{storcli64} }}); $anvil->Log->entry({source => $THIS_FILE, line => __LINE__, 'print' => 1, level => 0, key => "scan_storcli_error_0002", variables => { path => $anvil->data->{path}{exe}{storcli64} }});
$anvil->nice_exit({exit_code => 2}); $anvil->nice_exit({exit_code => 2});
} }
@ -10065,10 +10080,9 @@ sub find_lsi_controllers
} }
else else
{ {
$anvil->Log->entry({source => $THIS_FILE, line => __LINE__, 'print' => 1, level => 1, key => "scan_storcli_error_0003", variables => { $anvil->Log->entry({source => $THIS_FILE, line => __LINE__, 'print' => 1, level => 0, key => "scan_storcli_error_0003", variables => {
path => $anvil->data->{path}{exe}{storcli64}, path => $anvil->data->{path}{exe}{storcli64},
}}); }});
$anvil->nice_exit({exit_code => 3}); $anvil->nice_exit({exit_code => 3});
} }

@ -1897,6 +1897,7 @@ Read UUID: .... [#!variable!read_uuid!#]
#!variable!xml!# #!variable!xml!#
======== ========
</key> </key>
<key name="warning_0069">[ Warning ] - Checking the mail queue appears to have failed. Output received was: [#!variable!output!#].</key>
</language> </language>
<!-- 日本語 --> <!-- 日本語 -->

@ -442,7 +442,7 @@ sub handle_periodic_tasks
# Check mail server config. # Check mail server config.
my $problem = $anvil->Email->check_config({debug => 3}); my $problem = $anvil->Email->check_config({debug => 3});
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 2, list => { problem => $problem }}); $anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 3, list => { problem => $problem }});
} }
# Now check to see if it's time to run daily tasks. # Now check to see if it's time to run daily tasks.

@ -648,7 +648,7 @@ EOF
undef $error; undef $error;
undef $return_code; undef $return_code;
($output, $error, $return_code) = $anvil->Remote->call({ ($output, $error, $return_code) = $anvil->Remote->call({
debug => 3, debug => 2,
shell_call => $anvil->data->{path}{exe}{'dnf'}." list installed ".$package, shell_call => $anvil->data->{path}{exe}{'dnf'}." list installed ".$package,
password => $anvil->data->{data}{password}, password => $anvil->data->{data}{password},
port => $anvil->data->{data}{ssh_port}, port => $anvil->data->{data}{ssh_port},

@ -1568,6 +1568,8 @@ sub load_packages
"curl.x86_64", "curl.x86_64",
"cyrus-sasl-gssapi.x86_64", "cyrus-sasl-gssapi.x86_64",
"cyrus-sasl-lib.x86_64", "cyrus-sasl-lib.x86_64",
"cyrus-sasl-md5.x86_64",
"cyrus-sasl-plain.x86_64",
"cyrus-sasl.x86_64", "cyrus-sasl.x86_64",
], ],
d => [ d => [
@ -1678,6 +1680,7 @@ sub load_packages
"flatpak.x86_64", "flatpak.x86_64",
"fontconfig.x86_64", "fontconfig.x86_64",
"fontpackages-filesystem.noarch", "fontpackages-filesystem.noarch",
"freeipmi.x86_64",
"freetype.x86_64", "freetype.x86_64",
"fribidi.x86_64", "fribidi.x86_64",
"fuse.x86_64", "fuse.x86_64",
@ -1774,6 +1777,7 @@ sub load_packages
"harfbuzz.x86_64", "harfbuzz.x86_64",
"hdparm.x86_64", "hdparm.x86_64",
"hicolor-icon-theme.noarch", "hicolor-icon-theme.noarch",
"hostname.x86_64",
"htop.x86_64", "htop.x86_64",
"httpd-filesystem.noarch", "httpd-filesystem.noarch",
"httpd-tools.x86_64", "httpd-tools.x86_64",
@ -1842,6 +1846,7 @@ sub load_packages
"kbd.x86_64", "kbd.x86_64",
"kernel-core.x86_64", "kernel-core.x86_64",
"kernel-doc.noarch", "kernel-doc.noarch",
"kernel-devel.x86_64",
"kernel-headers.x86_64", "kernel-headers.x86_64",
"kernel-modules.x86_64", "kernel-modules.x86_64",
"kernel-tools-libs.x86_64", "kernel-tools-libs.x86_64",
@ -2069,6 +2074,7 @@ sub load_packages
"libvirt-daemon-driver-storage-disk.x86_64", "libvirt-daemon-driver-storage-disk.x86_64",
"libvirt-daemon-driver-storage-gluster.x86_64", "libvirt-daemon-driver-storage-gluster.x86_64",
"libvirt-daemon-driver-storage-iscsi.x86_64", "libvirt-daemon-driver-storage-iscsi.x86_64",
"libvirt-daemon-driver-storage-iscsi-direct.x86_64",
"libvirt-daemon-driver-storage-logical.x86_64", "libvirt-daemon-driver-storage-logical.x86_64",
"libvirt-daemon-driver-storage-mpath.x86_64", "libvirt-daemon-driver-storage-mpath.x86_64",
"libvirt-daemon-driver-storage-rbd.x86_64", "libvirt-daemon-driver-storage-rbd.x86_64",
@ -2217,6 +2223,8 @@ sub load_packages
"perl-Class-Method-Modifiers.noarch", "perl-Class-Method-Modifiers.noarch",
"perl-Compress-Raw-Bzip2.x86_64", "perl-Compress-Raw-Bzip2.x86_64",
"perl-Compress-Raw-Zlib.x86_64", "perl-Compress-Raw-Zlib.x86_64",
"perl-Curses.x86_64",
"perl-Curses-UI.noarch",
"perl-DBD-Pg.x86_64", "perl-DBD-Pg.x86_64",
"perl-DBI.x86_64", "perl-DBI.x86_64",
"perl-Data-Dump.noarch", "perl-Data-Dump.noarch",
@ -2225,6 +2233,7 @@ sub load_packages
"perl-Data-OptList.noarch", "perl-Data-OptList.noarch",
"perl-Date-Manip.noarch", "perl-Date-Manip.noarch",
"perl-Data-Validate-Domain.noarch", "perl-Data-Validate-Domain.noarch",
"perl-Data-Validate-IP.noarch",
"perl-Devel-ArgNames.noarch", "perl-Devel-ArgNames.noarch",
"perl-Devel-Caller.x86_64", "perl-Devel-Caller.x86_64",
"perl-Devel-GlobalDestruction.noarch", "perl-Devel-GlobalDestruction.noarch",
@ -2355,6 +2364,7 @@ sub load_packages
"perl-Unicode-Normalize.x86_64", "perl-Unicode-Normalize.x86_64",
"perl-Variable-Magic.x86_64", "perl-Variable-Magic.x86_64",
"perl-WWW-RobotRules.noarch", "perl-WWW-RobotRules.noarch",
"perl-XML-LibXML.x86_64",
"perl-XML-NamespaceSupport.noarch", "perl-XML-NamespaceSupport.noarch",
"perl-XML-Parser.x86_64", "perl-XML-Parser.x86_64",
"perl-XML-SAX-Base.noarch", "perl-XML-SAX-Base.noarch",
@ -2455,6 +2465,7 @@ sub load_packages
"python3-pyOpenSSL.noarch", "python3-pyOpenSSL.noarch",
"python3-pycparser.noarch", "python3-pycparser.noarch",
"python3-pycurl.x86_64", "python3-pycurl.x86_64",
"python3-pyparsing.noarch",
"python3-pysocks.noarch", "python3-pysocks.noarch",
"python3-pyudev.noarch", "python3-pyudev.noarch",
"python3-requests.noarch", "python3-requests.noarch",
@ -2523,6 +2534,7 @@ sub load_packages
"samba-common.noarch", "samba-common.noarch",
"sbc.x86_64", "sbc.x86_64",
"sbd.x86_64", "sbd.x86_64",
"screen.x86_64",
"SDL.x86_64", "SDL.x86_64",
"seabios-bin.noarch", "seabios-bin.noarch",
"seavgabios-bin.noarch", "seavgabios-bin.noarch",
@ -2583,8 +2595,10 @@ sub load_packages
u => [ u => [
"udisks2.x86_64", "udisks2.x86_64",
"unbound-libs.x86_64", "unbound-libs.x86_64",
"unzip.x86_64",
"upower.x86_64", "upower.x86_64",
"usbredir.x86_64", "usbredir.x86_64",
"usbutils.x86_64",
"usermode.x86_64", "usermode.x86_64",
"userspace-rcu.x86_64", "userspace-rcu.x86_64",
"util-linux.x86_64", "util-linux.x86_64",
@ -2599,6 +2613,7 @@ sub load_packages
"virt-install.noarch", "virt-install.noarch",
"virt-manager-common.noarch", "virt-manager-common.noarch",
"virt-manager.noarch", "virt-manager.noarch",
"virt-top.x86_64",
"virt-what.x86_64", "virt-what.x86_64",
"volume_key-libs.x86_64", "volume_key-libs.x86_64",
"vte-profile.x86_64", "vte-profile.x86_64",
@ -2645,6 +2660,8 @@ sub load_packages
# These packages can't be downloaded on RHEL Striker dashboads as they usually are not entitled to # These packages can't be downloaded on RHEL Striker dashboads as they usually are not entitled to
$anvil->data->{ha_packages} = { $anvil->data->{ha_packages} = {
c => [ c => [
"clufter-bin.x86_64",
"clufter-common.noarch",
"corosync.x86_64", "corosync.x86_64",
"corosynclib.x86_64", "corosynclib.x86_64",
], ],
@ -2669,6 +2686,7 @@ sub load_packages
"pacemaker-libs.x86_64", "pacemaker-libs.x86_64",
"pacemaker-schemas.noarch", "pacemaker-schemas.noarch",
"pcs.x86_64", "pcs.x86_64",
"python3-clufter.noarch",
], ],
r => [ r => [
"resource-agents.x86_64", "resource-agents.x86_64",

Loading…
Cancel
Save