From 473c72811777e3e1d2abc1eb6f4b2d10b44f5611 Mon Sep 17 00:00:00 2001 From: Digimer Date: Thu, 13 May 2021 23:40:50 -0400 Subject: [PATCH] * Updated scan-ipmitool to use 'jump' thresholds for a common sensor name where duplicates with the hex address appended may exist. Signed-off-by: Digimer --- scancore-agents/scan-ipmitool/scan-ipmitool | 25 ++++++++++++--------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/scancore-agents/scan-ipmitool/scan-ipmitool b/scancore-agents/scan-ipmitool/scan-ipmitool index 13830326..ca6314d2 100755 --- a/scancore-agents/scan-ipmitool/scan-ipmitool +++ b/scancore-agents/scan-ipmitool/scan-ipmitool @@ -180,17 +180,8 @@ $anvil->data->{'scan-ipmitool'} = { 'RAID Controller' => { jump => 15, }, - # On Dells, 'Temp{1..4}' change a lot, so we bump the jump. - 'Temp1' => { - jump => 20, - }, - 'Temp2' => { - jump => 20, - }, - 'Temp3' => { - jump => 20, - }, - 'Temp4' => { + # On Dells, 'Temp (xxh)' change a lot, so we bump the jump. + 'Temp' => { jump => 20, }, }, @@ -1579,6 +1570,18 @@ sub process_temperature_change $anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 2, list => { jump => $jump }}); } + # We append the hex address some sensor names when there are duplicates. This deals with those. + if ($scan_ipmitool_sensor_name =~ /^(.*?) \(.*?h\)$/) + { + my $jump_name = $1; + $anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 2, list => { jump_name => $jump_name }}); + if ((exists $anvil->data->{'scan-ipmitool'}{thresholds}{$jump_name}) && ($anvil->data->{'scan-ipmitool'}{thresholds}{$jump_name}{jump})) + { + $jump = $anvil->data->{'scan-ipmitool'}{thresholds}{$jump_name}{jump}; + $anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 2, list => { jump => $jump }}); + } + } + # Final levels $anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 2, list => { host_name => $host_name,