Fixed a bug in Alert->check_condition_age() where, when the 'clear' parameter was set and the value was already 'clear', it would flip to 'set' erroniously.

Signed-off-by: Digimer <digimer@alteeve.ca>
main
Digimer 3 years ago
parent 0a9f81d852
commit 796814531e
  1. 5
      Anvil/Tools/Alert.pm
  2. 8
      scancore-agents/scan-network/scan-network
  3. 2
      tools/striker-db-report

@ -295,6 +295,7 @@ sub check_condition_age
# See if this variable has been set yet.
my ($variable_value, $variable_uuid, $epoch_modified_date, $modified_date) = $anvil->Database->read_variable({
debug => $debug,
variable_name => $name,
variable_source_table => $source_table,
variable_source_uuid => $host_uuid,
@ -319,8 +320,8 @@ sub check_condition_age
});
}
# if the value was 'clear', change it to 'set'.
if ($variable_value eq "clear")
# if the 'clear' parameter isn't set, and the value is 'clear', change it to 'set'.
if (($variable_value eq "clear") && (not $clear))
{
# Set it.
$variable_uuid = $anvil->Database->insert_or_update_variables({

@ -3457,9 +3457,11 @@ AND
# Don't set / clear interfaces that appear down but aren't named ifn/bcn/sn as they're probably
# unconfigured/unusued interfaces.
my $problem = 0;
my $check = 0;
if ($anvil->Network->is_our_interface({interface => $network_interface_name}))
my $problem = 0;
my $check = 0;
my $monitored = $anvil->Network->is_our_interface({interface => $network_interface_name});
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 2, list => { monitored => $monitored }});
if ($monitored)
{
# One we monitor
$check = 1;

@ -233,7 +233,7 @@ WHERE
{
foreach my $query (@{$queries})
{
$anvil->Log->entry({source => $THIS_FILE, line => __LINE__, level => 3, key => "log_0124", variables => { query => $query }});
$anvil->Log->entry({source => $THIS_FILE, line => __LINE__, level => 2, key => "log_0124", variables => { query => $query }});
my $results = $anvil->Database->query({query => $query, source => $THIS_FILE, line => __LINE__});
my $count = @{$results};
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 3, list => {

Loading…
Cancel
Save