mirror of
https://github.com/centreon/centreon-plugins.git
synced 2025-07-27 15:44:21 +02:00
+ Fix cisco ucs mode equipment (WIP)
This commit is contained in:
parent
5ef71b0e19
commit
a88a7e8f6b
@ -50,7 +50,7 @@ sub check {
|
|||||||
foreach my $oid ($self->{snmp}->oid_lex_sort(keys %{$self->{results}->{$oid_cucsComputeBladeDn}})) {
|
foreach my $oid ($self->{snmp}->oid_lex_sort(keys %{$self->{results}->{$oid_cucsComputeBladeDn}})) {
|
||||||
$oid =~ /\.(\d+)$/;
|
$oid =~ /\.(\d+)$/;
|
||||||
my $instance = $1;
|
my $instance = $1;
|
||||||
my $fan_dn = $self->{results}->{$oid_cucsComputeBladeDn}->{$oid};
|
my $blade_dn = $self->{results}->{$oid_cucsComputeBladeDn}->{$oid};
|
||||||
my $result = $self->{snmp}->map_instance(mapping => $mapping1, results => $self->{results}->{$mapping1->{cucsComputeBladePresence}->{oid}}, instance => $instance);
|
my $result = $self->{snmp}->map_instance(mapping => $mapping1, results => $self->{results}->{$mapping1->{cucsComputeBladePresence}->{oid}}, instance => $instance);
|
||||||
my $result2 = $self->{snmp}->map_instance(mapping => $mapping2, results => $self->{results}->{$mapping2->{cucsComputeBladeOperState}->{oid}}, instance => $instance);
|
my $result2 = $self->{snmp}->map_instance(mapping => $mapping2, results => $self->{results}->{$mapping2->{cucsComputeBladeOperState}->{oid}}, instance => $instance);
|
||||||
|
|
||||||
@ -58,11 +58,11 @@ sub check {
|
|||||||
next if ($self->check_exclude(section => 'blade', instance => $blade_dn));
|
next if ($self->check_exclude(section => 'blade', instance => $blade_dn));
|
||||||
|
|
||||||
$self->{output}->output_add(long_msg => sprintf("blade '%s' state is '%s' [presence: %s].",
|
$self->{output}->output_add(long_msg => sprintf("blade '%s' state is '%s' [presence: %s].",
|
||||||
$blade_dn, $result2->{cucsComputeBladeOperState}),
|
$blade_dn, $result2->{cucsComputeBladeOperState},
|
||||||
$result->{cucsComputeBladePresence})
|
$result->{cucsComputeBladePresence})
|
||||||
));
|
);
|
||||||
|
|
||||||
my $exit = $self->get_severity(section => 'default.presence', label => 'blade.presence', value => $result->{cucsComputeBladePresence}));
|
my $exit = $self->get_severity(section => 'blade.presence', label => 'default.presence', value => $result->{cucsComputeBladePresence});
|
||||||
if (!$self->{output}->is_status(value => $exit, compare => 'ok', litteral => 1)) {
|
if (!$self->{output}->is_status(value => $exit, compare => 'ok', litteral => 1)) {
|
||||||
$self->{output}->output_add(severity => $exit,
|
$self->{output}->output_add(severity => $exit,
|
||||||
short_msg => sprintf("blade '%s' presence is: '%s'",
|
short_msg => sprintf("blade '%s' presence is: '%s'",
|
||||||
@ -73,11 +73,11 @@ sub check {
|
|||||||
|
|
||||||
$self->{components}->{blade}->{total}++;
|
$self->{components}->{blade}->{total}++;
|
||||||
|
|
||||||
$exit = $self->get_severity(section => 'default.overall_status', label => 'blade.overall_status', value => $result2->{cucsComputeBladeOperState}));
|
$exit = $self->get_severity(section => 'blade.overall_status', label => 'default.overall_status', value => $result2->{cucsComputeBladeOperState});
|
||||||
if (!$self->{output}->is_status(value => $exit, compare => 'ok', litteral => 1)) {
|
if (!$self->{output}->is_status(value => $exit, compare => 'ok', litteral => 1)) {
|
||||||
$self->{output}->output_add(severity => $exit,
|
$self->{output}->output_add(severity => $exit,
|
||||||
short_msg => sprintf("blade '%s' state is '%s'.",
|
short_msg => sprintf("blade '%s' state is '%s'",
|
||||||
$blade_dn, $result2->{cucsComputeBladeOperState})
|
$blade_dn, $result2->{cucsComputeBladeOperState}
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -57,12 +57,12 @@ sub check {
|
|||||||
$self->{components}->{chassis}->{total}++;
|
$self->{components}->{chassis}->{total}++;
|
||||||
|
|
||||||
$self->{output}->output_add(long_msg => sprintf("chassis '%s' state is '%s'.",
|
$self->{output}->output_add(long_msg => sprintf("chassis '%s' state is '%s'.",
|
||||||
$chassis_dn, $result->{cucsEquipmentChassisOperState}
|
$chassis_dn, $result->{cucsEquipmentChassisOperState})
|
||||||
));
|
);
|
||||||
my $exit = $self->get_severity(section => 'default.operability', label => 'chassis.operability', value => $result->{cucsEquipmentChassisOperState});
|
my $exit = $self->get_severity(section => 'chassis.operability', label => 'default.operability', value => $result->{cucsEquipmentChassisOperState});
|
||||||
if (!$self->{output}->is_status(value => $exit, compare => 'ok', litteral => 1)) {
|
if (!$self->{output}->is_status(value => $exit, compare => 'ok', litteral => 1)) {
|
||||||
$self->{output}->output_add(severity => $exit,
|
$self->{output}->output_add(severity => $exit,
|
||||||
short_msg => sprintf("chassis '%s' state is '%s'.",
|
short_msg => sprintf("chassis '%s' state is '%s'",
|
||||||
$chassis_dn, $result->{cucsEquipmentChassisOperState}
|
$chassis_dn, $result->{cucsEquipmentChassisOperState}
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
@ -59,10 +59,10 @@ sub check {
|
|||||||
|
|
||||||
$self->{output}->output_add(long_msg => sprintf("fan '%s' state is '%s' [presence: %s].",
|
$self->{output}->output_add(long_msg => sprintf("fan '%s' state is '%s' [presence: %s].",
|
||||||
$fan_dn, $result2->{cucsEquipmentFanOperState},
|
$fan_dn, $result2->{cucsEquipmentFanOperState},
|
||||||
$result->{cucsEquipmentFanPresence}
|
$result->{cucsEquipmentFanPresence})
|
||||||
));
|
);
|
||||||
|
|
||||||
my $exit = $self->get_severity(section => 'default.presence', label => 'fan.presence', value => $result->{cucsEquipmentFanPresence});
|
my $exit = $self->get_severity(section => 'fan.presence', label => 'default.presence', value => $result->{cucsEquipmentFanPresence});
|
||||||
if (!$self->{output}->is_status(value => $exit, compare => 'ok', litteral => 1)) {
|
if (!$self->{output}->is_status(value => $exit, compare => 'ok', litteral => 1)) {
|
||||||
$self->{output}->output_add(severity => $exit,
|
$self->{output}->output_add(severity => $exit,
|
||||||
short_msg => sprintf("fan '%s' presence is: '%s'",
|
short_msg => sprintf("fan '%s' presence is: '%s'",
|
||||||
@ -73,7 +73,7 @@ sub check {
|
|||||||
|
|
||||||
$self->{components}->{fan}->{total}++;
|
$self->{components}->{fan}->{total}++;
|
||||||
|
|
||||||
$exit = $self->get_severity(section => 'default.operability', label => 'fan.operability', value => $result2->{cucsEquipmentFanOperState});
|
$exit = $self->get_severity(section => 'fan.operability', label => 'default.operability', value => $result2->{cucsEquipmentFanOperState});
|
||||||
if (!$self->{output}->is_status(value => $exit, compare => 'ok', litteral => 1)) {
|
if (!$self->{output}->is_status(value => $exit, compare => 'ok', litteral => 1)) {
|
||||||
$self->{output}->output_add(severity => $exit,
|
$self->{output}->output_add(severity => $exit,
|
||||||
short_msg => sprintf("fan '%s' state is '%s'.",
|
short_msg => sprintf("fan '%s' state is '%s'.",
|
||||||
|
@ -59,21 +59,21 @@ sub check {
|
|||||||
|
|
||||||
$self->{output}->output_add(long_msg => sprintf("Fabric extender '%s' state is '%s' [presence: %s].",
|
$self->{output}->output_add(long_msg => sprintf("Fabric extender '%s' state is '%s' [presence: %s].",
|
||||||
$fex_dn, $result2->{cucsEquipmentFexOperState},
|
$fex_dn, $result2->{cucsEquipmentFexOperState},
|
||||||
$result->{cucsEquipmentFexPresence}
|
$result->{cucsEquipmentFexPresence})
|
||||||
));
|
);
|
||||||
|
|
||||||
my $exit = $self->get_severity(section => 'default.presence', label => 'fex.presence', value => $result->{cucsEquipmentFexPresence});
|
my $exit = $self->get_severity(section => 'fex.presence', label => 'default.presence', value => $result->{cucsEquipmentFexPresence});
|
||||||
if (!$self->{output}->is_status(value => $exit, compare => 'ok', litteral => 1)) {
|
if (!$self->{output}->is_status(value => $exit, compare => 'ok', litteral => 1)) {
|
||||||
$self->{output}->output_add(severity => $exit,
|
$self->{output}->output_add(severity => $exit,
|
||||||
short_msg => sprintf("Fabric extender '%s' presence is: '%s'",
|
short_msg => sprintf("Fabric extender '%s' presence is: '%s'",
|
||||||
$fex_dn, $result->{cucsEquipmentFexPresence}
|
$fex_dn, $result->{cucsEquipmentFexPresence})
|
||||||
);
|
);
|
||||||
next;
|
next;
|
||||||
}
|
}
|
||||||
|
|
||||||
$self->{components}->{fex}->{total}++;
|
$self->{components}->{fex}->{total}++;
|
||||||
|
|
||||||
$exit = $self->get_severity(section => 'default.presence', label => 'fex.operability', value => $result2->{cucsEquipmentFexOperState});
|
$exit = $self->get_severity(section => 'fex.presence', label => 'default.operability', value => $result2->{cucsEquipmentFexOperState});
|
||||||
if (!$self->{output}->is_status(value => $exit, compare => 'ok', litteral => 1)) {
|
if (!$self->{output}->is_status(value => $exit, compare => 'ok', litteral => 1)) {
|
||||||
$self->{output}->output_add(severity => $exit,
|
$self->{output}->output_add(severity => $exit,
|
||||||
short_msg => sprintf("Fabric extender '%s' state is '%s'.",
|
short_msg => sprintf("Fabric extender '%s' state is '%s'.",
|
||||||
|
@ -60,10 +60,10 @@ sub check {
|
|||||||
|
|
||||||
$self->{output}->output_add(long_msg => sprintf("IO cards '%s' state is '%s' [presence: %s].",
|
$self->{output}->output_add(long_msg => sprintf("IO cards '%s' state is '%s' [presence: %s].",
|
||||||
$iocard_dn, $result2->{cucsEquipmentIOCardOperState},
|
$iocard_dn, $result2->{cucsEquipmentIOCardOperState},
|
||||||
$result->{cucsEquipmentIOCardPresence}
|
$result->{cucsEquipmentIOCardPresence})
|
||||||
));
|
);
|
||||||
|
|
||||||
my $exit = $self->get_severity(section => 'default.presence', label => 'iocard.presence', value => $result->{cucsEquipmentIOCardPresence});
|
my $exit = $self->get_severity(section => 'iocard.presence', label => 'default.presence', value => $result->{cucsEquipmentIOCardPresence});
|
||||||
if (!$self->{output}->is_status(value => $exit, compare => 'ok', litteral => 1)) {
|
if (!$self->{output}->is_status(value => $exit, compare => 'ok', litteral => 1)) {
|
||||||
$self->{output}->output_add(severity => $exit,
|
$self->{output}->output_add(severity => $exit,
|
||||||
short_msg => sprintf("IO cards '%s' presence is: '%s'",
|
short_msg => sprintf("IO cards '%s' presence is: '%s'",
|
||||||
|
@ -60,10 +60,10 @@ sub check {
|
|||||||
|
|
||||||
$self->{output}->output_add(long_msg => sprintf("power supply '%s' state is '%s' [presence: %s].",
|
$self->{output}->output_add(long_msg => sprintf("power supply '%s' state is '%s' [presence: %s].",
|
||||||
$psu_dn, $result2->{cucsEquipmentPsuOperState},
|
$psu_dn, $result2->{cucsEquipmentPsuOperState},
|
||||||
$result->{cucsEquipmentPsuPresence}
|
$result->{cucsEquipmentPsuPresence})
|
||||||
));
|
);
|
||||||
|
|
||||||
my $exit = $self->get_severity(section => 'default.presence', label => 'psu.presence', value => $result->{cucsEquipmentPsuPresence});
|
my $exit = $self->get_severity(section => 'psu.presence', label => 'default.presence', value => $result->{cucsEquipmentPsuPresence});
|
||||||
if (!$self->{output}->is_status(value => $exit, compare => 'ok', litteral => 1)) {
|
if (!$self->{output}->is_status(value => $exit, compare => 'ok', litteral => 1)) {
|
||||||
$self->{output}->output_add(severity => $exit,
|
$self->{output}->output_add(severity => $exit,
|
||||||
short_msg => sprintf("power supply '%s' presence is: '%s'",
|
short_msg => sprintf("power supply '%s' presence is: '%s'",
|
||||||
@ -74,7 +74,7 @@ sub check {
|
|||||||
|
|
||||||
$self->{components}->{psu}->{total}++;
|
$self->{components}->{psu}->{total}++;
|
||||||
|
|
||||||
$exit = $self->get_severity(section => 'default.operability', label => 'psu.operability', value => $result2->{cucsEquipmentPsuOperState});
|
$exit = $self->get_severity(section => 'psu.operability', label => 'default.operability', value => $result2->{cucsEquipmentPsuOperState});
|
||||||
if (!$self->{output}->is_status(value => $exit, compare => 'ok', litteral => 1)) {
|
if (!$self->{output}->is_status(value => $exit, compare => 'ok', litteral => 1)) {
|
||||||
$self->{output}->output_add(severity => $exit,
|
$self->{output}->output_add(severity => $exit,
|
||||||
short_msg => sprintf("power supply '%s' state is '%s'.",
|
short_msg => sprintf("power supply '%s' state is '%s'.",
|
||||||
|
@ -80,7 +80,7 @@ our @EXPORT_OK = qw($thresholds %mapping_presence %mapping_operability %mapping_
|
|||||||
10 => 'ok',
|
10 => 'ok',
|
||||||
11 => 'discovery',
|
11 => 'discovery',
|
||||||
12 => 'config',
|
12 => 'config',
|
||||||
13 => 'unconfig'
|
13 => 'unconfig',
|
||||||
14 => 'power-off',
|
14 => 'power-off',
|
||||||
15 => 'restart',
|
15 => 'restart',
|
||||||
20 => 'maintenance',
|
20 => 'maintenance',
|
||||||
|
Loading…
x
Reference in New Issue
Block a user