centreon / centreon-plugins

Collection of standard plugins to discover and gather cloud-to-edge metrics and status across your whole IT infrastructure.
https://www.centreon.com
Apache License 2.0
311 stars 274 forks source link

network::juniper::ssg mode=hardware --exclude=fans #151

Closed ritouret closed 9 years ago

ritouret commented 9 years ago

Hello,

The exclude option does work for temperatures but does not work for fans : perl /usr/lib/nagios/plugins/centreon_plugins.pl --plugin=network::juniper::ssg::plugin --mode=hardware --component=all --exclude=fans,temperatures ... OK: All 2 components [1 modules, 1 psus] are ok. | Checking temperatures Skipping temperatures section. Checking fans Checking modules Module 'MGT Board' status is active [instance: 1]. Checking power supplies Power Supply '1' status is active.

garnier-quentin commented 9 years ago

Ok i see. I'll update completely the mode hardware. Thanks

ritouret commented 9 years ago

I don't know why but for one equipment, this mode does not work even if it works on 67 others equipments and even if snmpwalk is good for this one :

perl /usr/lib/nagios/plugins/centreon_plugins.pl --plugin=network::juniper::ssg::plugin --mode=hardware --component=all --exclude=fans,temperatures --hostname=host --snmp-version=2c --snmp-community=community --snmp-timeout=45 --snmp-retries=1 --verbose UNKNOWN: SNMP Table Request : Timeout Checking temperatures Skipping temperatures section. Checking fans

snmpwalk -m ALL -M /usr/share/snmp/mibs -v2c -c community host .1.3.6.1.4.1.3224.21 NETSCREEN-CHASSIS-MIB::nsPowerId.1 = INTEGER: 1 NETSCREEN-CHASSIS-MIB::nsPowerStatus.1 = INTEGER: 1 NETSCREEN-CHASSIS-MIB::nsPowerDesc.1 = STRING: Power NETSCREEN-CHASSIS-MIB::nsSlotId.1 = INTEGER: 1 NETSCREEN-CHASSIS-MIB::nsSlotType.1 = STRING: MGT Board NETSCREEN-CHASSIS-MIB::nsSlotStatus.1 = INTEGER: 1 NETSCREEN-CHASSIS-MIB::nsSlotSN.1 = STRING: 0162042011007199

garnier-quentin commented 9 years ago

Could you test Dominique please ? Option is not --exclude now but --filter (easier)

ritouret commented 9 years ago

Thanks Quentin. It works for all equipment now.

Should it indicates when a component is skipped ?

Here the result with --mode=hardware --component='.*' --filter=fans : OK: All 2 components are ok [1/1 module, 1/1 psus]. | Checking power supplies Power supply '1' status is 'active' [instance: 1] Checking fans Checking temperatures Checking modules Module 'MGT Board' status is 'active' [instance: 1]

garnier-quentin commented 9 years ago

It's because your option is wrong. Should be: --filter=fan

ritouret commented 9 years ago

Thank you Quentin.

Be carefull in the --help : it's module and not modules. --filter Exclude some parts (comma seperated list) (Example: --filter=psu --filter=modules) Can also exclude specific instance: --filter=fan,1

It works with one filter but not with comma separated filter : --filter=temperature : OK: All 2 components are ok [1/1 module, 1/1 psus]. | Checking power supplies Power supply '1' status is 'active' [instance: 1] Checking fans Checking temperatures Skipping temperature section. Checking modules Module 'MGT Board' status is 'active' [instance: 1]

--filter=fan OK: All 2 components are ok [1/1 module, 1/1 psus]. | Checking power supplies Power supply '1' status is 'active' [instance: 1] Checking fans Skipping fan section. Checking temperatures Checking modules Module 'MGT Board' status is 'active' [instance: 1]

--filter=fan,temperature OK: All 2 components are ok [1/1 module, 1/1 psus]. | Checking power supplies Power supply '1' status is 'active' [instance: 1] Checking fans Checking temperatures Checking modules Module 'MGT Board' status is 'active' [instance: 1]

garnier-quentin commented 9 years ago

Thanks i have fixed the help. It's like that: --filter=fan --filter=temperature

ritouret commented 9 years ago

It's better through this way : --filter=fan --filter=temperature OK: All 2 components are ok [1/1 module, 1/1 psus]. | Checking power supplies Power supply '1' status is 'active' [instance: 1] Checking fans Skipping fan section. Checking temperatures Skipping temperature section. Checking modules Module 'MGT Board' status is 'active' [instance: 1]

You should also remove " (comma seperated list) " in the help section for --filter ...