From d62900d712ed8c471dc5cdcb3474f0104dd704dc Mon Sep 17 00:00:00 2001 From: Digimer Date: Thu, 15 Jul 2021 23:04:23 -0400 Subject: [PATCH] Fixed a bug where the wrong string key was used when a network interface comes, goes or changes it's bond_uuid reference. Also changed the alert level of vnetX interfaces that disappear to notice level. Signed-off-by: Digimer --- scancore-agents/scan-network/scan-network | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/scancore-agents/scan-network/scan-network b/scancore-agents/scan-network/scan-network index 176d1332..3c16531e 100755 --- a/scancore-agents/scan-network/scan-network +++ b/scancore-agents/scan-network/scan-network @@ -1437,10 +1437,10 @@ sub check_interfaces new => $new_bond_name." (".$new_bond_uuid.")", }; - $anvil->Log->entry({source => $THIS_FILE, line => __LINE__, level => 1, key => "scan_network_alert_0012", variables => $variables}); + $anvil->Log->entry({source => $THIS_FILE, line => __LINE__, level => 1, key => $key, variables => $variables}); $anvil->Alert->register({ alert_level => "warning", - message => "scan_network_alert_0012", + message => $key, variables => $variables, set_by => $THIS_FILE, }); @@ -1936,6 +1936,10 @@ sub check_interfaces rx => $anvil->Convert->add_commas({number => $rx_bytes})." (".$anvil->Convert->bytes_to_human_readable({'bytes' => $rx_bytes}).")", }; + # If this a vnet device, it's only a notice message as this is expected when a VM migrates or + # shuts down. + my $alert_level = $network_interface_name =~ /^vnet/ ? "notice" : "warning"; + $anvil->Log->entry({source => $THIS_FILE, line => __LINE__, level => 1, key => "scan_network_alert_0059", variables => $variables}); $anvil->Alert->register({ alert_level => "warning",