CTOR-320-community-pr-fix-status-mapping-on-citrix-psu (#5022)

Co-authored-by: omercier <32134301+omercier@users.noreply.github.com>
This commit is contained in:
Evan-Adam 2024-05-15 16:25:24 +02:00 committed by GitHub
parent 799aa4e2b5
commit 73428460ca
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 175 additions and 11 deletions

View File

@ -23,23 +23,34 @@ package network::citrix::netscaler::snmp::mode::components::psu;
use strict;
use warnings;
my %map_psu_status = (
0 => 'not supported',
1 => 'not present',
2 => 'failed',
3 => 'normal',
);
my $mapping = {
sysHealthCounterName => { oid => '.1.3.6.1.4.1.5951.4.1.1.41.7.1.1' },
sysHealthCounterValue => { oid => '.1.3.6.1.4.1.5951.4.1.1.41.7.1.2', map => \%map_psu_status },
};
my $oid_nsSysHealthEntry = '.1.3.6.1.4.1.5951.4.1.1.41.7.1';
sub load {}
sub check {
my ($self) = @_;
my %map_psu_status;
if (!$self->{option_results}->{alternative_status_mapping}) {
%map_psu_status = (
0 => 'not supported',
1 => 'not present',
2 => 'failed',
3 => 'normal',
);
} else {
%map_psu_status = (
0 => 'normal',
1 => 'not present',
2 => 'failed',
3 => 'not supported',
);
}
my $mapping = {
sysHealthCounterName => { oid => '.1.3.6.1.4.1.5951.4.1.1.41.7.1.1' },
sysHealthCounterValue => { oid => '.1.3.6.1.4.1.5951.4.1.1.41.7.1.2', map => \%map_psu_status },
};
$self->{output}->output_add(long_msg => "Checking power supplies");
$self->{components}->{psu} = {name => 'psus', total => 0, skip => 0};

View File

@ -69,7 +69,7 @@ sub new {
my $self = $class->SUPER::new(package => __PACKAGE__, %options);
bless $self, $class;
$options{options}->add_options(arguments => {});
$options{options}->add_options(arguments => { "alternative-status-mapping:s" => { name => 'alternative_status_mapping', default => '' }});
return $self;
}
@ -119,6 +119,16 @@ Example: --warning='temperature,.,30'
Set critical threshold for 'temperature', 'fanspeed', 'voltage'(syntax: type,regexp,threshold)
Example: --critical='temperature,.*,40'
=item B<--alternative-status-mapping>
Depending on the Netscaler product, the translation of OID .1.3.6.1.4.1.5951.4.1.1.41.7.1.2 may diverge. The default interpretation of this OID is:
0 => not supported, 1 => not present, 2 => failed, 3 => normal.
With this option set to '1', the OID will be interpreted otherwise:
0 => normal, 1 => not present, 2 => failed, 3 => not supported.
=back
=cut

View File

@ -20,6 +20,7 @@ Datacore
deltaps
df
eth
fanspeed
Fortigate
Fortinet
ifAlias
@ -33,6 +34,7 @@ IpAddr
license-instances-usage-prct
MBean
NagVis
Netscaler
OID
oneaccess-sys-mib
out-bcast
@ -41,6 +43,7 @@ out-ucast
perfdata
powershell
proto
psu
queue-messages-inflighted
RRDCached
Sansymphony

View File

@ -0,0 +1,36 @@
*** Settings ***
Documentation Network citrix netscaler health
Resource ${CURDIR}${/}..${/}..${/}..${/}..${/}..${/}..${/}..${/}resources/import.resource
Test Timeout 120s
*** Variables ***
${CMD} ${CENTREON_PLUGINS} --plugin=network::citrix::netscaler::snmp::plugin
*** Test Cases ***
check psu components ${tc}/2
[Documentation] mib don't seem set on the meaning of .1.3.6.1.4.1.5951.4.1.1.41.7.1.2, some client report 0 = normal and other 0 = not supported.
[Tags] network citrix snmp
${command} Catenate
... ${CMD}
... --mode=health
... --hostname='127.0.0.1'
... --snmp-port='2024'
... --snmp-community='network/citrix/netscaler/snmp/mode/components/${community}'
... --component=psu
... --alternative-status-mapping='${alternative_status_mapping}'
${output} Run ${command}
${output} Strip String ${output}
Should Be Equal As Strings
... ${output}
... ${expected_result}
... \nWrong output result for command:\n${command}\n\nExpected:\n${expected_result}\nCommand output:\n${output}\n
Examples: tc alternative_status_mapping community expected_result --
... 1 true psu-citrix-v13 OK: All 4 components are ok [4/4 psus]. | 'count_psu'=4;;;;
... 2 ${EMPTY} psu-citrix-v13 UNKNOWN: Power supply '1' status is 'not supported' - Power supply '2' status is 'not supported' - Power supply '3' status is 'not supported' - Power supply '4' status is 'not supported' | 'count_psu'=4;;;;

View File

@ -0,0 +1,104 @@
.1.3.6.1.4.1.5951.4.1.1.41.7.1.1.9.68.105.115.107.48.83.105.122.101 = STRING: "Disk0Size"
.1.3.6.1.4.1.5951.4.1.1.41.7.1.1.9.68.105.115.107.48.85.115.101.100 = STRING: "Disk0Used"
.1.3.6.1.4.1.5951.4.1.1.41.7.1.1.9.68.105.115.107.49.83.105.122.101 = STRING: "Disk1Size"
.1.3.6.1.4.1.5951.4.1.1.41.7.1.1.9.68.105.115.107.49.85.115.101.100 = STRING: "Disk1Used"
.1.3.6.1.4.1.5951.4.1.1.41.7.1.1.10.68.105.115.107.48.65.118.97.105.108 = STRING: "Disk0Avail"
.1.3.6.1.4.1.5951.4.1.1.41.7.1.1.10.68.105.115.107.49.65.118.97.105.108 = STRING: "Disk1Avail"
.1.3.6.1.4.1.5951.4.1.1.41.7.1.1.11.68.105.115.107.48.69.114.114.111.114.115 = STRING: "Disk0Errors"
.1.3.6.1.4.1.5951.4.1.1.41.7.1.1.11.68.105.115.107.48.80.117.115.97.103.101 = STRING: "Disk0Pusage"
.1.3.6.1.4.1.5951.4.1.1.41.7.1.1.11.68.105.115.107.49.69.114.114.111.114.115 = STRING: "Disk1Errors"
.1.3.6.1.4.1.5951.4.1.1.41.7.1.1.11.68.105.115.107.49.80.117.115.97.103.101 = STRING: "Disk1Pusage"
.1.3.6.1.4.1.5951.4.1.1.41.7.1.1.12.67.80.85.70.97.110.48.83.112.101.101.100 = STRING: "CPUFan0Speed"
.1.3.6.1.4.1.5951.4.1.1.41.7.1.1.12.67.80.85.70.97.110.49.83.112.101.101.100 = STRING: "CPUFan1Speed"
.1.3.6.1.4.1.5951.4.1.1.41.7.1.1.13.65.117.120.105.108.105.97.114.121.70.97.110.48 = STRING: "AuxiliaryFan0"
.1.3.6.1.4.1.5951.4.1.1.41.7.1.1.13.65.117.120.105.108.105.97.114.121.70.97.110.49 = STRING: "AuxiliaryFan1"
.1.3.6.1.4.1.5951.4.1.1.41.7.1.1.13.65.117.120.105.108.105.97.114.121.70.97.110.50 = STRING: "AuxiliaryFan2"
.1.3.6.1.4.1.5951.4.1.1.41.7.1.1.13.65.117.120.105.108.105.97.114.121.70.97.110.51 = STRING: "AuxiliaryFan3"
.1.3.6.1.4.1.5951.4.1.1.41.7.1.1.14.65.117.120.105.108.105.97.114.121.77.105.115.99.48 = STRING: "AuxiliaryMisc0"
.1.3.6.1.4.1.5951.4.1.1.41.7.1.1.14.65.117.120.105.108.105.97.114.121.77.105.115.99.49 = STRING: "AuxiliaryMisc1"
.1.3.6.1.4.1.5951.4.1.1.41.7.1.1.14.66.97.116.116.101.114.121.86.111.108.116.97.103.101 = STRING: "BatteryVoltage"
.1.3.6.1.4.1.5951.4.1.1.41.7.1.1.14.83.121.115.116.101.109.70.97.110.83.112.101.101.100 = STRING: "SystemFanSpeed"
.1.3.6.1.4.1.5951.4.1.1.41.7.1.1.14.86.111.108.116.97.103.101.83.101.110.115.111.114.50 = STRING: "VoltageSensor2"
.1.3.6.1.4.1.5951.4.1.1.41.7.1.1.15.67.80.85.48.67.111.114.101.86.111.108.116.97.103.101 = STRING: "CPU0CoreVoltage"
.1.3.6.1.4.1.5951.4.1.1.41.7.1.1.15.67.80.85.48.84.101.109.112.101.114.97.116.117.114.101 = STRING: "CPU0Temperature"
.1.3.6.1.4.1.5951.4.1.1.41.7.1.1.15.67.80.85.49.67.111.114.101.86.111.108.116.97.103.101 = STRING: "CPU1CoreVoltage"
.1.3.6.1.4.1.5951.4.1.1.41.7.1.1.15.67.80.85.49.84.101.109.112.101.114.97.116.117.114.101 = STRING: "CPU1Temperature"
.1.3.6.1.4.1.5951.4.1.1.41.7.1.1.15.83.121.115.116.101.109.70.97.110.49.83.112.101.101.100 = STRING: "SystemFan1Speed"
.1.3.6.1.4.1.5951.4.1.1.41.7.1.1.15.83.121.115.116.101.109.70.97.110.50.83.112.101.101.100 = STRING: "SystemFan2Speed"
.1.3.6.1.4.1.5951.4.1.1.41.7.1.1.16.73.110.116.101.108.67.80.85.86.116.116.80.111.119.101.114 = STRING: "IntelCPUVttPower"
.1.3.6.1.4.1.5951.4.1.1.41.7.1.1.17.65.117.120.105.108.105.97.114.121.86.111.108.116.97.103.101.48 = STRING: "AuxiliaryVoltage0"
.1.3.6.1.4.1.5951.4.1.1.41.7.1.1.17.65.117.120.105.108.105.97.114.121.86.111.108.116.97.103.101.49 = STRING: "AuxiliaryVoltage1"
.1.3.6.1.4.1.5951.4.1.1.41.7.1.1.17.65.117.120.105.108.105.97.114.121.86.111.108.116.97.103.101.50 = STRING: "AuxiliaryVoltage2"
.1.3.6.1.4.1.5951.4.1.1.41.7.1.1.17.65.117.120.105.108.105.97.114.121.86.111.108.116.97.103.101.51 = STRING: "AuxiliaryVoltage3"
.1.3.6.1.4.1.5951.4.1.1.41.7.1.1.17.65.117.120.105.108.105.97.114.121.86.111.108.116.97.103.101.52 = STRING: "AuxiliaryVoltage4"
.1.3.6.1.4.1.5951.4.1.1.41.7.1.1.17.65.117.120.105.108.105.97.114.121.86.111.108.116.97.103.101.53 = STRING: "AuxiliaryVoltage5"
.1.3.6.1.4.1.5951.4.1.1.41.7.1.1.17.65.117.120.105.108.105.97.114.121.86.111.108.116.97.103.101.54 = STRING: "AuxiliaryVoltage6"
.1.3.6.1.4.1.5951.4.1.1.41.7.1.1.17.65.117.120.105.108.105.97.114.121.86.111.108.116.97.103.101.55 = STRING: "AuxiliaryVoltage7"
.1.3.6.1.4.1.5951.4.1.1.41.7.1.1.18.43.53.46.48.86.83.117.112.112.108.121.86.111.108.116.97.103.101 = STRING: "+5.0VSupplyVoltage"
.1.3.6.1.4.1.5951.4.1.1.41.7.1.1.18.45.53.46.48.86.83.117.112.112.108.121.86.111.108.116.97.103.101 = STRING: "-5.0VSupplyVoltage"
.1.3.6.1.4.1.5951.4.1.1.41.7.1.1.18.80.111.119.101.114.83.117.112.112.108.121.49.83.116.97.116.117.115 = STRING: "PowerSupply1Status"
.1.3.6.1.4.1.5951.4.1.1.41.7.1.1.18.80.111.119.101.114.83.117.112.112.108.121.50.83.116.97.116.117.115 = STRING: "PowerSupply2Status"
.1.3.6.1.4.1.5951.4.1.1.41.7.1.1.18.80.111.119.101.114.83.117.112.112.108.121.51.83.116.97.116.117.115 = STRING: "PowerSupply3Status"
.1.3.6.1.4.1.5951.4.1.1.41.7.1.1.18.80.111.119.101.114.83.117.112.112.108.121.52.83.116.97.116.117.115 = STRING: "PowerSupply4Status"
.1.3.6.1.4.1.5951.4.1.1.41.7.1.1.19.43.49.50.46.48.86.83.117.112.112.108.121.86.111.108.116.97.103.101 = STRING: "+12.0VSupplyVoltage"
.1.3.6.1.4.1.5951.4.1.1.41.7.1.1.19.45.49.50.46.48.86.83.117.112.112.108.121.86.111.108.116.97.103.101 = STRING: "-12.0VSupplyVoltage"
.1.3.6.1.4.1.5951.4.1.1.41.7.1.1.19.73.110.116.101.114.110.97.108.84.101.109.112.101.114.97.116.117.114.101 = STRING: "InternalTemperature"
.1.3.6.1.4.1.5951.4.1.1.41.7.1.1.21.65.117.120.105.108.105.97.114.121.84.101.109.112.101.114.97.116.117.114.101.48 = STRING: "AuxiliaryTemperature0"
.1.3.6.1.4.1.5951.4.1.1.41.7.1.1.21.65.117.120.105.108.105.97.114.121.84.101.109.112.101.114.97.116.117.114.101.49 = STRING: "AuxiliaryTemperature1"
.1.3.6.1.4.1.5951.4.1.1.41.7.1.1.21.65.117.120.105.108.105.97.114.121.84.101.109.112.101.114.97.116.117.114.101.50 = STRING: "AuxiliaryTemperature2"
.1.3.6.1.4.1.5951.4.1.1.41.7.1.1.21.65.117.120.105.108.105.97.114.121.84.101.109.112.101.114.97.116.117.114.101.51 = STRING: "AuxiliaryTemperature3"
.1.3.6.1.4.1.5951.4.1.1.41.7.1.1.21.77.97.105.110.51.46.51.86.83.117.112.112.108.121.86.111.108.116.97.103.101 = STRING: "Main3.3VSupplyVoltage"
.1.3.6.1.4.1.5951.4.1.1.41.7.1.1.24.83.116.97.110.100.98.121.51.46.51.86.83.117.112.112.108.121.86.111.108.116.97.103.101 = STRING: "Standby3.3VSupplyVoltage"
.1.3.6.1.4.1.5951.4.1.1.41.7.1.1.27.80.111.119.101.114.83.117.112.112.108.121.53.118.83.116.97.110.100.98.121.86.111.108.116.97.103.101 = STRING: "PowerSupply5vStandbyVoltage"
.1.3.6.1.4.1.5951.4.1.1.41.7.1.2.9.68.105.115.107.48.83.105.122.101 = STRING: "1585"
.1.3.6.1.4.1.5951.4.1.1.41.7.1.2.9.68.105.115.107.48.85.115.101.100 = STRING: "697"
.1.3.6.1.4.1.5951.4.1.1.41.7.1.2.9.68.105.115.107.49.83.105.122.101 = STRING: "14179"
.1.3.6.1.4.1.5951.4.1.1.41.7.1.2.9.68.105.115.107.49.85.115.101.100 = STRING: "6658"
.1.3.6.1.4.1.5951.4.1.1.41.7.1.2.10.68.105.115.107.48.65.118.97.105.108 = STRING: "761"
.1.3.6.1.4.1.5951.4.1.1.41.7.1.2.10.68.105.115.107.49.65.118.97.105.108 = STRING: "6386"
.1.3.6.1.4.1.5951.4.1.1.41.7.1.2.11.68.105.115.107.48.69.114.114.111.114.115 = STRING: "0"
.1.3.6.1.4.1.5951.4.1.1.41.7.1.2.11.68.105.115.107.48.80.117.115.97.103.101 = STRING: "47"
.1.3.6.1.4.1.5951.4.1.1.41.7.1.2.11.68.105.115.107.49.69.114.114.111.114.115 = STRING: "0"
.1.3.6.1.4.1.5951.4.1.1.41.7.1.2.11.68.105.115.107.49.80.117.115.97.103.101 = STRING: "51"
.1.3.6.1.4.1.5951.4.1.1.41.7.1.2.12.67.80.85.70.97.110.48.83.112.101.101.100 = STRING: "0"
.1.3.6.1.4.1.5951.4.1.1.41.7.1.2.12.67.80.85.70.97.110.49.83.112.101.101.100 = STRING: "0"
.1.3.6.1.4.1.5951.4.1.1.41.7.1.2.13.65.117.120.105.108.105.97.114.121.70.97.110.48 = STRING: "0"
.1.3.6.1.4.1.5951.4.1.1.41.7.1.2.13.65.117.120.105.108.105.97.114.121.70.97.110.49 = STRING: "0"
.1.3.6.1.4.1.5951.4.1.1.41.7.1.2.13.65.117.120.105.108.105.97.114.121.70.97.110.50 = STRING: "0"
.1.3.6.1.4.1.5951.4.1.1.41.7.1.2.13.65.117.120.105.108.105.97.114.121.70.97.110.51 = STRING: "0"
.1.3.6.1.4.1.5951.4.1.1.41.7.1.2.14.65.117.120.105.108.105.97.114.121.77.105.115.99.48 = STRING: "0"
.1.3.6.1.4.1.5951.4.1.1.41.7.1.2.14.65.117.120.105.108.105.97.114.121.77.105.115.99.49 = STRING: "0"
.1.3.6.1.4.1.5951.4.1.1.41.7.1.2.14.66.97.116.116.101.114.121.86.111.108.116.97.103.101 = STRING: "0"
.1.3.6.1.4.1.5951.4.1.1.41.7.1.2.14.83.121.115.116.101.109.70.97.110.83.112.101.101.100 = STRING: "0"
.1.3.6.1.4.1.5951.4.1.1.41.7.1.2.14.86.111.108.116.97.103.101.83.101.110.115.111.114.50 = STRING: "0"
.1.3.6.1.4.1.5951.4.1.1.41.7.1.2.15.67.80.85.48.67.111.114.101.86.111.108.116.97.103.101 = STRING: "0"
.1.3.6.1.4.1.5951.4.1.1.41.7.1.2.15.67.80.85.48.84.101.109.112.101.114.97.116.117.114.101 = STRING: "0"
.1.3.6.1.4.1.5951.4.1.1.41.7.1.2.15.67.80.85.49.67.111.114.101.86.111.108.116.97.103.101 = STRING: "0"
.1.3.6.1.4.1.5951.4.1.1.41.7.1.2.15.67.80.85.49.84.101.109.112.101.114.97.116.117.114.101 = STRING: "0"
.1.3.6.1.4.1.5951.4.1.1.41.7.1.2.15.83.121.115.116.101.109.70.97.110.49.83.112.101.101.100 = STRING: "0"
.1.3.6.1.4.1.5951.4.1.1.41.7.1.2.15.83.121.115.116.101.109.70.97.110.50.83.112.101.101.100 = STRING: "0"
.1.3.6.1.4.1.5951.4.1.1.41.7.1.2.16.73.110.116.101.108.67.80.85.86.116.116.80.111.119.101.114 = STRING: "0"
.1.3.6.1.4.1.5951.4.1.1.41.7.1.2.17.65.117.120.105.108.105.97.114.121.86.111.108.116.97.103.101.48 = STRING: "0"
.1.3.6.1.4.1.5951.4.1.1.41.7.1.2.17.65.117.120.105.108.105.97.114.121.86.111.108.116.97.103.101.49 = STRING: "0"
.1.3.6.1.4.1.5951.4.1.1.41.7.1.2.17.65.117.120.105.108.105.97.114.121.86.111.108.116.97.103.101.50 = STRING: "0"
.1.3.6.1.4.1.5951.4.1.1.41.7.1.2.17.65.117.120.105.108.105.97.114.121.86.111.108.116.97.103.101.51 = STRING: "0"
.1.3.6.1.4.1.5951.4.1.1.41.7.1.2.17.65.117.120.105.108.105.97.114.121.86.111.108.116.97.103.101.52 = STRING: "0"
.1.3.6.1.4.1.5951.4.1.1.41.7.1.2.17.65.117.120.105.108.105.97.114.121.86.111.108.116.97.103.101.53 = STRING: "0"
.1.3.6.1.4.1.5951.4.1.1.41.7.1.2.17.65.117.120.105.108.105.97.114.121.86.111.108.116.97.103.101.54 = STRING: "0"
.1.3.6.1.4.1.5951.4.1.1.41.7.1.2.17.65.117.120.105.108.105.97.114.121.86.111.108.116.97.103.101.55 = STRING: "0"
.1.3.6.1.4.1.5951.4.1.1.41.7.1.2.18.43.53.46.48.86.83.117.112.112.108.121.86.111.108.116.97.103.101 = STRING: "0"
.1.3.6.1.4.1.5951.4.1.1.41.7.1.2.18.45.53.46.48.86.83.117.112.112.108.121.86.111.108.116.97.103.101 = STRING: "0"
.1.3.6.1.4.1.5951.4.1.1.41.7.1.2.18.80.111.119.101.114.83.117.112.112.108.121.49.83.116.97.116.117.115 = STRING: "0"
.1.3.6.1.4.1.5951.4.1.1.41.7.1.2.18.80.111.119.101.114.83.117.112.112.108.121.50.83.116.97.116.117.115 = STRING: "0"
.1.3.6.1.4.1.5951.4.1.1.41.7.1.2.18.80.111.119.101.114.83.117.112.112.108.121.51.83.116.97.116.117.115 = STRING: "0"
.1.3.6.1.4.1.5951.4.1.1.41.7.1.2.18.80.111.119.101.114.83.117.112.112.108.121.52.83.116.97.116.117.115 = STRING: "0"
.1.3.6.1.4.1.5951.4.1.1.41.7.1.2.19.43.49.50.46.48.86.83.117.112.112.108.121.86.111.108.116.97.103.101 = STRING: "0"
.1.3.6.1.4.1.5951.4.1.1.41.7.1.2.19.45.49.50.46.48.86.83.117.112.112.108.121.86.111.108.116.97.103.101 = STRING: "0"
.1.3.6.1.4.1.5951.4.1.1.41.7.1.2.19.73.110.116.101.114.110.97.108.84.101.109.112.101.114.97.116.117.114.101 = STRING: "0"
.1.3.6.1.4.1.5951.4.1.1.41.7.1.2.21.65.117.120.105.108.105.97.114.121.84.101.109.112.101.114.97.116.117.114.101.48 = STRING: "0"
.1.3.6.1.4.1.5951.4.1.1.41.7.1.2.21.65.117.120.105.108.105.97.114.121.84.101.109.112.101.114.97.116.117.114.101.49 = STRING: "0"
.1.3.6.1.4.1.5951.4.1.1.41.7.1.2.21.65.117.120.105.108.105.97.114.121.84.101.109.112.101.114.97.116.117.114.101.50 = STRING: "0"
.1.3.6.1.4.1.5951.4.1.1.41.7.1.2.21.65.117.120.105.108.105.97.114.121.84.101.109.112.101.114.97.116.117.114.101.51 = STRING: "0"
.1.3.6.1.4.1.5951.4.1.1.41.7.1.2.21.77.97.105.110.51.46.51.86.83.117.112.112.108.121.86.111.108.116.97.103.101 = STRING: "0"
.1.3.6.1.4.1.5951.4.1.1.41.7.1.2.24.83.116.97.110.100.98.121.51.46.51.86.83.117.112.112.108.121.86.111.108.116.97.103.101 = STRING: "0"
.1.3.6.1.4.1.5951.4.1.1.41.7.1.2.27.80.111.119.101.114.83.117.112.112.108.121.53.118.83.116.97.110.100.98.121.86.111.108.116.97.103.101 = STRING: "0"