* Disabled firewalling for now. There appears to be an issue starting up with DRBD.

* Updated Convert->time() to return whatever was passed in instead of '#!error!#'.

Signed-off-by: Digimer <digimer@alteeve.ca>
main
Digimer 2 years ago
parent 171ea74000
commit 7fd6185445
  1. 2
      Anvil/Tools/Convert.pm
  2. 13
      Anvil/Tools/Database.pm
  3. 3
      Anvil/Tools/Network.pm
  4. 2
      Anvil/Tools/System.pm
  5. 1
      scancore-agents/scan-apc-ups/scan-apc-ups
  6. 4
      scancore-agents/scan-apc-ups/scan-apc-ups.xml
  7. 2
      scancore-agents/scan-drbd/scan-drbd.xml
  8. 2
      tools/anvil-daemon
  9. 11
      tools/anvil-manage-firewall

@ -1365,7 +1365,7 @@ sub time
if ($time =~ /\D/) if ($time =~ /\D/)
{ {
$anvil->Log->entry({source => $THIS_FILE, line => __LINE__, level => 0, priority => "err", key => "log_0294", variables => { 'time' => $time }}); $anvil->Log->entry({source => $THIS_FILE, line => __LINE__, level => 0, priority => "err", key => "log_0294", variables => { 'time' => $time }});
return("#!error!#"); return($time);
} }
# The suffix used for each unit of time will depend on the requested suffix type. # The suffix used for each unit of time will depend on the requested suffix type.

@ -2707,8 +2707,11 @@ WHERE
next if not $anvil->data->{file_locations}{file_location_uuid}{$file_location_uuid}{file_location_active}; next if not $anvil->data->{file_locations}{file_location_uuid}{$file_location_uuid}{file_location_active};
my $file_uuid = $anvil->data->{file_locations}{file_location_uuid}{$file_location_uuid}{file_location_file_uuid}; my $file_uuid = $anvil->data->{file_locations}{file_location_uuid}{$file_location_uuid}{file_location_file_uuid};
next if not exists $anvil->data->{files}{file_uuid}{$file_uuid};
my $file_name = $anvil->data->{files}{file_uuid}{$file_uuid}{file_name}; my $file_name = $anvil->data->{files}{file_uuid}{$file_uuid}{file_name};
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => $debug, list => { $anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 2, list => {
file_uuid => $file_uuid, file_uuid => $file_uuid,
file_name => $file_name, file_name => $file_name,
}}); }});
@ -2720,7 +2723,7 @@ WHERE
$anvil->data->{anvils}{anvil_uuid}{$anvil_uuid}{file_uuid}{$file_uuid}{file_size} = $anvil->data->{files}{file_uuid}{$file_uuid}{file_size}; $anvil->data->{anvils}{anvil_uuid}{$anvil_uuid}{file_uuid}{$file_uuid}{file_size} = $anvil->data->{files}{file_uuid}{$file_uuid}{file_size};
$anvil->data->{anvils}{anvil_uuid}{$anvil_uuid}{file_uuid}{$file_uuid}{file_md5sum} = $anvil->data->{files}{file_uuid}{$file_uuid}{file_md5sum}; $anvil->data->{anvils}{anvil_uuid}{$anvil_uuid}{file_uuid}{$file_uuid}{file_md5sum} = $anvil->data->{files}{file_uuid}{$file_uuid}{file_md5sum};
$anvil->data->{anvils}{anvil_uuid}{$anvil_uuid}{file_uuid}{$file_uuid}{file_type} = $anvil->data->{files}{file_uuid}{$file_uuid}{file_type}; $anvil->data->{anvils}{anvil_uuid}{$anvil_uuid}{file_uuid}{$file_uuid}{file_type} = $anvil->data->{files}{file_uuid}{$file_uuid}{file_type};
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => $debug, list => { $anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 2, list => {
"anvils::anvil_uuid::${anvil_uuid}::file_uuid::${file_uuid}::file_name" => $anvil->data->{anvils}{anvil_uuid}{$anvil_uuid}{file_uuid}{$file_uuid}{file_name}, "anvils::anvil_uuid::${anvil_uuid}::file_uuid::${file_uuid}::file_name" => $anvil->data->{anvils}{anvil_uuid}{$anvil_uuid}{file_uuid}{$file_uuid}{file_name},
"anvils::anvil_uuid::${anvil_uuid}::file_uuid::${file_uuid}::file_directory" => $anvil->data->{anvils}{anvil_uuid}{$anvil_uuid}{file_uuid}{$file_uuid}{file_directory}, "anvils::anvil_uuid::${anvil_uuid}::file_uuid::${file_uuid}::file_directory" => $anvil->data->{anvils}{anvil_uuid}{$anvil_uuid}{file_uuid}{$file_uuid}{file_directory},
"anvils::anvil_uuid::${anvil_uuid}::file_uuid::${file_uuid}::file_size" => $anvil->Convert->bytes_to_human_readable({'bytes' => $anvil->data->{anvils}{anvil_uuid}{$anvil_uuid}{file_uuid}{$file_uuid}{file_size}})." (".$anvil->Convert->add_commas({number => $anvil->data->{anvils}{anvil_uuid}{$anvil_uuid}{file_uuid}{$file_uuid}{file_size}}).")", "anvils::anvil_uuid::${anvil_uuid}::file_uuid::${file_uuid}::file_size" => $anvil->Convert->bytes_to_human_readable({'bytes' => $anvil->data->{anvils}{anvil_uuid}{$anvil_uuid}{file_uuid}{$file_uuid}{file_size}})." (".$anvil->Convert->add_commas({number => $anvil->data->{anvils}{anvil_uuid}{$anvil_uuid}{file_uuid}{$file_uuid}{file_size}}).")",
@ -2730,7 +2733,7 @@ WHERE
# Make it so that we can list the files by name. # Make it so that we can list the files by name.
$anvil->data->{anvils}{anvil_uuid}{$anvil_uuid}{file_name}{$file_name}{file_uuid} = $file_uuid; $anvil->data->{anvils}{anvil_uuid}{$anvil_uuid}{file_name}{$file_name}{file_uuid} = $file_uuid;
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => $debug, list => { $anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 2, list => {
"anvils::anvil_uuid::${anvil_uuid}::file_name::${file_name}::file_uuid" => $anvil->data->{anvils}{anvil_uuid}{$anvil_uuid}{file_name}{$file_name}{file_uuid}, "anvils::anvil_uuid::${anvil_uuid}::file_name::${file_name}::file_uuid" => $anvil->data->{anvils}{anvil_uuid}{$anvil_uuid}{file_name}{$file_name}{file_uuid},
}}); }});
} }
@ -17399,8 +17402,8 @@ sub _age_out_data
} }
# Now process power and tempoerature, if not disabled. # Now process power and tempoerature, if not disabled.
my $age = $anvil->data->{scancore}{database}{age_out}; my $age = $anvil->data->{scancore}{database}{age_out} ? $anvil->data->{scancore}{database}{age_out} : 24;
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => $debug, list => { age => $age }}); $anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 2, list => { age => $age }});
if ($age =~ /\D/) if ($age =~ /\D/)
{ {

@ -254,6 +254,7 @@ sub check_firewall
$anvil->Log->entry({source => $THIS_FILE, line => __LINE__, level => $debug, key => "log_0125", variables => { method => "Network->check_firewall()" }}); $anvil->Log->entry({source => $THIS_FILE, line => __LINE__, level => $debug, key => "log_0125", variables => { method => "Network->check_firewall()" }});
my $running = 0; my $running = 0;
return(0);
# Make sure firewalld is running. # Make sure firewalld is running.
my $firewalld_running = $anvil->System->check_daemon({daemon => $anvil->data->{sys}{daemon}{firewalld}}); my $firewalld_running = $anvil->System->check_daemon({daemon => $anvil->data->{sys}{daemon}{firewalld}});
@ -2968,6 +2969,8 @@ sub manage_firewall
zone => $zone zone => $zone
}}); }});
return(0);
# Before we do anything, is the firewall even running? # Before we do anything, is the firewall even running?
my $firewalld_running = $anvil->Network->check_firewall({debug => $debug}); my $firewalld_running = $anvil->Network->check_firewall({debug => $debug});
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => $debug, list => { firewalld_running => $firewalld_running }}); $anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => $debug, list => { firewalld_running => $firewalld_running }});

@ -5212,6 +5212,8 @@ sub _load_firewalld_zones
my $debug = defined $parameter->{debug} ? $parameter->{debug} : 3; my $debug = defined $parameter->{debug} ? $parameter->{debug} : 3;
$anvil->Log->entry({source => $THIS_FILE, line => __LINE__, level => $debug, key => "log_0125", variables => { method => "System->_load_firewalld_zones()" }}); $anvil->Log->entry({source => $THIS_FILE, line => __LINE__, level => $debug, key => "log_0125", variables => { method => "System->_load_firewalld_zones()" }});
return(0);
my $directory = $anvil->data->{path}{directories}{firewalld_services}; my $directory = $anvil->data->{path}{directories}{firewalld_services};
$anvil->Log->entry({source => $THIS_FILE, line => __LINE__, level => $debug, key => "log_0018", variables => { directory => $directory }}); $anvil->Log->entry({source => $THIS_FILE, line => __LINE__, level => $debug, key => "log_0018", variables => { directory => $directory }});
if (not -d $directory) if (not -d $directory)

@ -937,6 +937,7 @@ WHERE
low_transfer_voltage => $low_transfer_voltage, low_transfer_voltage => $low_transfer_voltage,
clear_low_transfer => $clear_low_transfer, clear_low_transfer => $clear_low_transfer,
}; };
# holdup_time => $anvil->Convert->time({'time' => $scan_apc_ups_output_estimated_runtime}),
my $lost_voltage_key = $scan_apc_ups_uuid."::scan_apc_ups_input_voltage_lost"; my $lost_voltage_key = $scan_apc_ups_uuid."::scan_apc_ups_input_voltage_lost";
my $low_voltage_key = $scan_apc_ups_uuid."::scan_apc_ups_input_voltage_low"; my $low_voltage_key = $scan_apc_ups_uuid."::scan_apc_ups_input_voltage_low";

@ -162,7 +162,9 @@ Warning: If the UPS battery is the only high temperature, it could be a sign tha
<key name="scan_apc_ups_warning_0024">The input voltage for the UPS: [#!variable!ups_name!#] has risen from: [#!variable!old_value!# vAC] to: [#!variable!new_value!# vAC].</key> <key name="scan_apc_ups_warning_0024">The input voltage for the UPS: [#!variable!ups_name!#] has risen from: [#!variable!old_value!# vAC] to: [#!variable!new_value!# vAC].</key>
<key name="scan_apc_ups_warning_0025">The input voltage for the UPS: [#!variable!ups_name!#] has dropped from: [#!variable!old_value!# vAC] to: [#!variable!new_value!# vAC].</key> <key name="scan_apc_ups_warning_0025">The input voltage for the UPS: [#!variable!ups_name!#] has dropped from: [#!variable!old_value!# vAC] to: [#!variable!new_value!# vAC].</key>
<key name="scan_apc_ups_warning_0026">The UPS: [#!variable!ups_name!#] has lost input power! The input voltage dropped from: [#!variable!old_value!# vAC] to: [#!variable!new_value!# vAC].</key> <key name="scan_apc_ups_warning_0026">The UPS: [#!variable!ups_name!#] has lost input power! The input voltage dropped from: [#!variable!old_value!# vAC] to: [#!variable!new_value!# vAC].</key>
<key name="scan_apc_ups_warning_0027">The input voltage for the UPS: [#!variable!ups_name!#] has dropped below the low-voltage transfer level! The voltage dropped from: [#!variable!old_value!# vAC] to: [#!variable!new_value!# vAC]. The low-voltage transfer voltage is: [#!variable!low_transfer_voltage!#].</key> <key name="scan_apc_ups_warning_0027">
The input voltage for the UPS: [#!variable!ups_name!#] has dropped below the low-voltage transfer level! The voltage dropped from: [#!variable!old_value!# vAC] to: [#!variable!new_value!# vAC]. The low-voltage transfer voltage is: [#!variable!low_transfer_voltage!#].
</key>
<key name="scan_apc_ups_warning_0028">The input voltage for the UPS: [#!variable!ups_name!#] has dropped back down below the high-voltage transfer level and is operating normally again. The voltage changed from: [#!variable!old_value!# vAC] to: [#!variable!new_value!# vAC]. The clear high-voltage threshold is: [#!variable!clear_high_transfer!#].</key> <key name="scan_apc_ups_warning_0028">The input voltage for the UPS: [#!variable!ups_name!#] has dropped back down below the high-voltage transfer level and is operating normally again. The voltage changed from: [#!variable!old_value!# vAC] to: [#!variable!new_value!# vAC]. The clear high-voltage threshold is: [#!variable!clear_high_transfer!#].</key>
<key name="scan_apc_ups_warning_0029">The highest input voltage seen in the last 60 seconds for the UPS: [#!variable!ups_name!#] has changed from: [#!variable!old_value!# vAC] to: [#!variable!new_value!# vAC].</key> <key name="scan_apc_ups_warning_0029">The highest input voltage seen in the last 60 seconds for the UPS: [#!variable!ups_name!#] has changed from: [#!variable!old_value!# vAC] to: [#!variable!new_value!# vAC].</key>
<key name="scan_apc_ups_warning_0030">The lowest input voltage seen in the last 60 seconds for the UPS: [#!variable!ups_name!#] has changed from: [#!variable!old_value!# vAC] to: [#!variable!new_value!# vAC].</key> <key name="scan_apc_ups_warning_0030">The lowest input voltage seen in the last 60 seconds for the UPS: [#!variable!ups_name!#] has changed from: [#!variable!old_value!# vAC] to: [#!variable!new_value!# vAC].</key>

@ -233,6 +233,8 @@ The global common configuration file: [#!variable!file!#] needs to be updated. T
<key name="scan_drbd_state_attaching_explain">Transient state while reading meta data.</key> <key name="scan_drbd_state_attaching_explain">Transient state while reading meta data.</key>
<key name="scan_drbd_state_detaching_name">Detaching</key> <key name="scan_drbd_state_detaching_name">Detaching</key>
<key name="scan_drbd_state_detaching_explain">Transient state while detaching and waiting for ongoing IOs to complete.</key> <key name="scan_drbd_state_detaching_explain">Transient state while detaching and waiting for ongoing IOs to complete.</key>
<key name="scan_drbd_state_DELETED_name">Deleted</key>
<key name="scan_drbd_state_DELETED_explain">This disk was deleted.</key>
<key name="scan_drbd_state_failed_name">Failed</key> <key name="scan_drbd_state_failed_name">Failed</key>
<key name="scan_drbd_state_failed_explain">Transient state following an I/O failure report by the local block device. Next state: Diskless. Note: Despite the name, this is rarely an actual issue.</key> <key name="scan_drbd_state_failed_explain">Transient state following an I/O failure report by the local block device. Next state: Diskless. Note: Despite the name, this is rarely an actual issue.</key>
<key name="scan_drbd_state_negotiating_name">Negotiating</key> <key name="scan_drbd_state_negotiating_name">Negotiating</key>

@ -1194,6 +1194,8 @@ sub check_firewall
{ {
my ($anvil) = @_; my ($anvil) = @_;
return(0);
# Don't call this if we're not configured yet. # Don't call this if we're not configured yet.
my $configured = $anvil->System->check_if_configured({debug => 3}); my $configured = $anvil->System->check_if_configured({debug => 3});
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 3, list => { configured => $configured }}); $anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 3, list => { configured => $configured }});

@ -64,13 +64,21 @@ if ($anvil->data->{switches}{'job-uuid'})
{ {
$anvil->Job->clear(); $anvil->Job->clear();
$anvil->Job->get_job_details(); $anvil->Job->get_job_details();
# $anvil->Job->update_progress({
# progress => 1,
# job_picked_up_by => $$,
# job_picked_up_at => time,
# message => "message_0134",
# });
$anvil->Job->update_progress({ $anvil->Job->update_progress({
progress => 1, progress => 100,
job_picked_up_by => $$, job_picked_up_by => $$,
job_picked_up_at => time, job_picked_up_at => time,
message => "message_0134", message => "message_0134",
}); });
exit(0);
if ($anvil->data->{jobs}{job_data} =~ /server=(.*)$/) if ($anvil->data->{jobs}{job_data} =~ /server=(.*)$/)
{ {
$anvil->data->{switches}{server} = $1 if not $anvil->data->{switches}{server}; $anvil->data->{switches}{server} = $1 if not $anvil->data->{switches}{server};
@ -81,6 +89,7 @@ if ($anvil->data->{switches}{'job-uuid'})
} }
} }
exit(0);
# This used to do all the work, but that's now moved to the method below. So all we do here now is call it. # This used to do all the work, but that's now moved to the method below. So all we do here now is call it.
$anvil->Network->manage_firewall(); $anvil->Network->manage_firewall();

Loading…
Cancel
Save