mirror of
https://github.com/centreon/centreon-plugins.git
synced 2025-07-06 13:24:38 +02:00
enh(dell/os10): hardware mode - add os version (#2998)
This commit is contained in:
parent
5cdc7f7ac1
commit
ace8d2c3de
@ -30,6 +30,7 @@ sub set_system {
|
|||||||
|
|
||||||
$self->{regexp_threshold_numeric_check_section_option} = '^(?:temperature)$';
|
$self->{regexp_threshold_numeric_check_section_option} = '^(?:temperature)$';
|
||||||
|
|
||||||
|
$self->{cb_hook1} = 'get_system_information';
|
||||||
$self->{cb_hook2} = 'snmp_execute';
|
$self->{cb_hook2} = 'snmp_execute';
|
||||||
|
|
||||||
$self->{thresholds} = {
|
$self->{thresholds} = {
|
||||||
@ -39,7 +40,7 @@ sub set_system {
|
|||||||
['cardProblem', 'CRITICAL'],
|
['cardProblem', 'CRITICAL'],
|
||||||
['diagMode', 'OK'],
|
['diagMode', 'OK'],
|
||||||
['cardAbsent', 'OK'],
|
['cardAbsent', 'OK'],
|
||||||
['offline', 'OK'],
|
['offline', 'OK']
|
||||||
],
|
],
|
||||||
operational => [
|
operational => [
|
||||||
['up', 'OK'],
|
['up', 'OK'],
|
||||||
@ -49,14 +50,34 @@ sub set_system {
|
|||||||
['dormant', 'OK'],
|
['dormant', 'OK'],
|
||||||
['notPresent', 'OK'],
|
['notPresent', 'OK'],
|
||||||
['lowerLayerDown', 'OK'],
|
['lowerLayerDown', 'OK'],
|
||||||
['failed', 'CRITICAL'],
|
['failed', 'CRITICAL']
|
||||||
],
|
]
|
||||||
};
|
};
|
||||||
|
|
||||||
$self->{components_path} = 'network::dell::os10::snmp::mode::components';
|
$self->{components_path} = 'network::dell::os10::snmp::mode::components';
|
||||||
$self->{components_module} = ['card', 'temperature', 'fan', 'fantray', 'psu'];
|
$self->{components_module} = ['card', 'temperature', 'fan', 'fantray', 'psu'];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
sub get_system_information {
|
||||||
|
my ($self, %options) = @_;
|
||||||
|
|
||||||
|
my $oid_sysdescr = '.1.3.6.1.2.1.1.1.0';
|
||||||
|
my $result = $options{snmp}->get_leef(oids => [$oid_sysdescr]);
|
||||||
|
|
||||||
|
my $version = 'unknown';
|
||||||
|
if (defined($result->{$oid_sysdescr}) && $result->{$oid_sysdescr} =~ /OS Version: ([0-9\.]+)/msi) {
|
||||||
|
$version = $1;
|
||||||
|
$version =~ s/\.$//;
|
||||||
|
}
|
||||||
|
$self->{output}->output_add(
|
||||||
|
long_msg => sprintf(
|
||||||
|
'os version: %s',
|
||||||
|
$version
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
sub snmp_execute {
|
sub snmp_execute {
|
||||||
my ($self, %options) = @_;
|
my ($self, %options) = @_;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user