mirror of
				https://github.com/centreon/centreon-plugins.git
				synced 2025-10-31 11:23:50 +01:00 
			
		
		
		
	Refs #5787
This commit is contained in:
		
							parent
							
								
									ff350db96e
								
							
						
					
					
						commit
						c6d5777632
					
				| @ -157,7 +157,7 @@ sub check_errors { | |||||||
| 
 | 
 | ||||||
|     for (my $i = 1; $i <= 11; $i++) { |     for (my $i = 1; $i <= 11; $i++) { | ||||||
|         next if (!defined($self->{results}->{$oid_rcDeviceError . '.' . $i . '.0'})); |         next if (!defined($self->{results}->{$oid_rcDeviceError . '.' . $i . '.0'})); | ||||||
|         my $instance = $map_errors{$self->{results}->{$oid_rcDeviceError . '.' . $i . '.0'}}; |         my $instance = $map_errors{$i}; | ||||||
|         my $state = $self->{results}->{$oid_rcDeviceError . '.' . $i . '.0'}; |         my $state = $self->{results}->{$oid_rcDeviceError . '.' . $i . '.0'}; | ||||||
| 
 | 
 | ||||||
|         next if ($self->check_exclude(section => 'error', instance => $instance)); |         next if ($self->check_exclude(section => 'error', instance => $instance)); | ||||||
|  | |||||||
| @ -40,9 +40,13 @@ use base qw(centreon::plugins::mode); | |||||||
| use strict; | use strict; | ||||||
| use warnings; | use warnings; | ||||||
| 
 | 
 | ||||||
|  | my $oid_rcDeviceStsPowerSupply1_entry = '.1.3.6.1.4.1.15004.4.2.2.4'; | ||||||
| my $oid_rcDeviceStsPowerSupply1 = '.1.3.6.1.4.1.15004.4.2.2.4.0'; | my $oid_rcDeviceStsPowerSupply1 = '.1.3.6.1.4.1.15004.4.2.2.4.0'; | ||||||
|  | my $oid_rcDeviceStsPowerSupply2_entry = '.1.3.6.1.4.1.15004.4.2.2.5'; | ||||||
| my $oid_rcDeviceStsPowerSupply2 = '.1.3.6.1.4.1.15004.4.2.2.5.0'; | my $oid_rcDeviceStsPowerSupply2 = '.1.3.6.1.4.1.15004.4.2.2.5.0'; | ||||||
|  | my $oid_rcDeviceStsFanBank1_entry = '.1.3.6.1.4.1.15004.4.2.2.10'; | ||||||
| my $oid_rcDeviceStsFanBank1 = '.1.3.6.1.4.1.15004.4.2.2.10.0'; | my $oid_rcDeviceStsFanBank1 = '.1.3.6.1.4.1.15004.4.2.2.10.0'; | ||||||
|  | my $oid_rcDeviceStsFanBank2_entry = '.1.3.6.1.4.1.15004.4.2.2.11'; | ||||||
| my $oid_rcDeviceStsFanBank2 = '.1.3.6.1.4.1.15004.4.2.2.11.0'; | my $oid_rcDeviceStsFanBank2 = '.1.3.6.1.4.1.15004.4.2.2.11.0'; | ||||||
| 
 | 
 | ||||||
| my $thresholds = { | my $thresholds = { | ||||||
| @ -129,12 +133,14 @@ sub run { | |||||||
|     # $options{snmp} = snmp object |     # $options{snmp} = snmp object | ||||||
|     $self->{snmp} = $options{snmp}; |     $self->{snmp} = $options{snmp}; | ||||||
|      |      | ||||||
|     $self->{results} = $self->{snmp}->get_leef(oids => [ |     # There is a bug with get_leef and snmpv1. | ||||||
|                                                 $oid_rcDeviceStsPowerSupply1, |     $self->{results} = $self->{snmp}->get_multiple_table(oids => [ | ||||||
|                                                 $oid_rcDeviceStsPowerSupply2, |                                                 { oid => $oid_rcDeviceStsPowerSupply1_entry }, | ||||||
|                                                 $oid_rcDeviceStsFanBank1, |                                                 { oid => $oid_rcDeviceStsPowerSupply2_entry }, | ||||||
|                                                 $oid_rcDeviceStsFanBank2, |                                                 { oid => $oid_rcDeviceStsFanBank1_entry }, | ||||||
|                                                ]); |                                                 { oid => $oid_rcDeviceStsFanBank2_entry }, | ||||||
|  |                                                ], | ||||||
|  |                                                return_type => 1); | ||||||
| 
 | 
 | ||||||
|     if ($self->{option_results}->{component} eq 'all') {     |     if ($self->{option_results}->{component} eq 'all') {     | ||||||
|         $self->check_fan(); |         $self->check_fan(); | ||||||
| @ -238,10 +244,11 @@ sub check_fan { | |||||||
|     my $instance = 0; |     my $instance = 0; | ||||||
|     foreach my $value (($self->{results}->{$oid_rcDeviceStsFanBank1}, $self->{results}->{$oid_rcDeviceStsFanBank2})) { |     foreach my $value (($self->{results}->{$oid_rcDeviceStsFanBank1}, $self->{results}->{$oid_rcDeviceStsFanBank2})) { | ||||||
|         $instance++; |         $instance++; | ||||||
|  |         next if (!defined($value)); | ||||||
|         my $fan_state = $value; |         my $fan_state = $value; | ||||||
| 
 | 
 | ||||||
|         next if ($self->check_exclude(section => 'fan', instance => $instance)); |         next if ($self->check_exclude(section => 'fan', instance => $instance)); | ||||||
|         next if ($map_states_fan{$fan_state} ne 'notPresent' &&  |         next if ($map_states_fan{$fan_state} eq 'notPresent' &&  | ||||||
|                  $self->absent_problem(section => 'fan', instance => $instance)); |                  $self->absent_problem(section => 'fan', instance => $instance)); | ||||||
|          |          | ||||||
|         $self->{components}->{fan}->{total}++; |         $self->{components}->{fan}->{total}++; | ||||||
| @ -265,10 +272,11 @@ sub check_psu { | |||||||
|     my $instance = 0; |     my $instance = 0; | ||||||
|     foreach my $value (($self->{results}->{$oid_rcDeviceStsPowerSupply1}, $self->{results}->{$oid_rcDeviceStsPowerSupply2})) { |     foreach my $value (($self->{results}->{$oid_rcDeviceStsPowerSupply1}, $self->{results}->{$oid_rcDeviceStsPowerSupply2})) { | ||||||
|         $instance++; |         $instance++; | ||||||
|  |         next if (!defined($value)); | ||||||
|         my $psu_state = $value; |         my $psu_state = $value; | ||||||
| 
 | 
 | ||||||
|         next if ($self->check_exclude(section => 'psu', instance => $instance)); |         next if ($self->check_exclude(section => 'psu', instance => $instance)); | ||||||
|         next if ($map_states_psu{$psu_state} ne 'notPresent' &&  |         next if ($map_states_psu{$psu_state} eq 'notPresent' &&  | ||||||
|                  $self->absent_problem(section => 'psu', instance => $instance)); |                  $self->absent_problem(section => 'psu', instance => $instance)); | ||||||
|          |          | ||||||
|         $self->{components}->{psu}->{total}++; |         $self->{components}->{psu}->{total}++; | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user