Plugin(network::stormshield::snmp) - Mode(Hardware) : Issue on temperature value not used (#5188)

Co-authored-by: Lucie Dubrunfaut <ldubrunfaut@CNTR-PORT-A198>
Co-authored-by: sfarouq-ext <116093375+sfarouq-ext@users.noreply.github.com>
Refs : CTOR-631
This commit is contained in:
Lucie Dubrunfaut 2024-09-30 14:42:30 +02:00 committed by GitHub
parent e0033d0172
commit 11482e4d40
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 38 additions and 1 deletions

View File

@ -58,7 +58,7 @@ sub check {
)
);
my ($exit, $warn, $crit, $checked) = $self->get_severity_numeric(section => 'temperature', instance => $instance, value => $result->{tempValue});
my ($exit, $warn, $crit, $checked) = $self->get_severity_numeric(section => 'temperature', instance => $instance, value => $result->{cpuTemp});
if (!$self->{output}->is_status(value => $exit, compare => 'ok', litteral => 1)) {
$self->{output}->output_add(
severity => $exit,

View File

@ -0,0 +1,34 @@
*** Settings ***
Documentation Check Stormshield equipment
Resource ${CURDIR}${/}..${/}..${/}..${/}resources/import.resource
Test Timeout 120s
*** Variables ***
${CMD} ${CENTREON_PLUGINS} --plugin=network::stormshield::snmp::plugin
*** Test Cases ***
hardware ${tc}
[Tags] network Stormshield
${command} Catenate
... ${CMD}
... --mode=hardware
... --hostname=${HOSTNAME}
... --snmp-version=${SNMPVERSION}
... --snmp-port=${SNMPPORT}
... --snmp-community=network/stormshield/snmp/stormshield-fake
... --snmp-timeout=1
... ${extra_options}
Ctn Run Command And Check Result As Strings ${command} ${expected_result}
Examples: tc extra_options expected_result --
... 1 --critical='temperature,.*,50' CRITICAL: temperature 'cpu1' is 70 celsius | 'cpu1#hardware.temperature.celsius'=70C;;0:50;0; 'cpu2#hardware.temperature.celsius'=30C;;0:50;0; 'cpu3#hardware.temperature.celsius'=0C;;0:50;0; 'hardware.temperature.count'=3;;;;
... 2 --threshold-overload='disk,WARNING,missing' OK: All 3 components are ok [3/3 temperatures]. | 'cpu1#hardware.temperature.celsius'=70C;;;0; 'cpu2#hardware.temperature.celsius'=30C;;;0; 'cpu3#hardware.temperature.celsius'=0C;;;0; 'hardware.temperature.count'=3;;;;
... 3 --warning='temperature,.*,40' WARNING: temperature 'cpu1' is 70 celsius | 'cpu1#hardware.temperature.celsius'=70C;0:40;;0; 'cpu2#hardware.temperature.celsius'=30C;0:40;;0; 'cpu3#hardware.temperature.celsius'=0C;0:40;;0; 'hardware.temperature.count'=3;;;;
... 4 --warning='temperature,cpu1,60' WARNING: temperature 'cpu1' is 70 celsius | 'cpu1#hardware.temperature.celsius'=70C;0:60;;0; 'cpu2#hardware.temperature.celsius'=30C;;;0; 'cpu3#hardware.temperature.celsius'=0C;;;0; 'hardware.temperature.count'=3;;;;
... 5 --critical='temperature,cpu1,75' OK: All 3 components are ok [3/3 temperatures]. | 'cpu1#hardware.temperature.celsius'=70C;;0:75;0; 'cpu2#hardware.temperature.celsius'=30C;;;0; 'cpu3#hardware.temperature.celsius'=0C;;;0; 'hardware.temperature.count'=3;;;;
... 6 --warning='temperature,cpu1,300' --critical='temperature,cpu1,17' CRITICAL: temperature 'cpu1' is 70 celsius | 'cpu1#hardware.temperature.celsius'=70C;0:300;0:17;0; 'cpu2#hardware.temperature.celsius'=30C;;;0; 'cpu3#hardware.temperature.celsius'=0C;;;0; 'hardware.temperature.count'=3;;;;

View File

@ -0,0 +1,3 @@
.1.3.6.1.4.1.11256.1.10.7.1.2.1 = INTEGER: 70
.1.3.6.1.4.1.11256.1.10.7.1.2.2 = INTEGER: 30
.1.3.6.1.4.1.11256.1.10.7.1.2.3 = INTEGER: 0