monitoring-plugins / monitoring-plugins

Monitoring Plugins
https://www.monitoring-plugins.org
GNU General Public License v3.0
482 stars 283 forks source link

check_snmp give back snmpwalk results? #1767

Open cookie33 opened 2 years ago

cookie33 commented 2 years ago

Hi,

Is it possible to use check_snmp and get back a list of results like snmpwalk?

An example of snmpwalk being:

snmpwalk -c public -v 1 sw21-red.... -M +/home/sanmgr/firmware/v8.2.2d/mibs:/usr/share/snmp/mibs -m +BCCUSTOM-OPR-MIB:BRCD-FCIP-EXT-MIB:Brocade-REG-MIB:Brocade-TC:BROCADE-MAPS-MIB:CPQHOST-MIB:CPQRACK-MIB:FA-EXT-MIB:FCMGMT-MIB:LINK-INCIDENT-MIB:HA-MIB:SW-MIB swSfpRxPower
FA-EXT-MIB::swSfpRxPower.'....|*..........'.1 = STRING: "-1.7" dBm
FA-EXT-MIB::swSfpRxPower.'....|*..........'.2 = STRING: "-1.7" dBm
FA-EXT-MIB::swSfpRxPower.'....|*..........'.3 = STRING: "-1.9" dBm
FA-EXT-MIB::swSfpRxPower.'....|*..........'.4 = STRING: "-2.6" dBm
FA-EXT-MIB::swSfpRxPower.'....|*..........'.5 = STRING: "-2.7" dBm
FA-EXT-MIB::swSfpRxPower.'....|*..........'.6 = STRING: "-2.4" dBm
FA-EXT-MIB::swSfpRxPower.'....|*..........'.7 = STRING: "-2.9" dBm
FA-EXT-MIB::swSfpRxPower.'....|*..........'.8 = STRING: "-2.6" dBm
FA-EXT-MIB::swSfpRxPower.'....|*..........'.9 = STRING: "-2.7" dBm
FA-EXT-MIB::swSfpRxPower.'....|*..........'.10 = STRING: "-2.3" dBm
FA-EXT-MIB::swSfpRxPower.'....|*..........'.11 = STRING: "-31.0" dBm
FA-EXT-MIB::swSfpRxPower.'....|*..........'.12 = STRING: "-2.2" dBm
FA-EXT-MIB::swSfpRxPower.'....|*..........'.13 = STRING: "-2.3" dBm
FA-EXT-MIB::swSfpRxPower.'....|*..........'.14 = STRING: "-2.6" dBm
FA-EXT-MIB::swSfpRxPower.'....|*..........'.15 = STRING: "-2.0" dBm
FA-EXT-MIB::swSfpRxPower.'....|*..........'.16 = STRING: "-4.2" dBm
FA-EXT-MIB::swSfpRxPower.'....|*..........'.17 = STRING: "-2.9" dBm
FA-EXT-MIB::swSfpRxPower.'....|*..........'.18 = STRING: "-2.9" dBm
FA-EXT-MIB::swSfpRxPower.'....|*..........'.19 = STRING: "-3.0" dBm
FA-EXT-MIB::swSfpRxPower.'....|*..........'.20 = STRING: "-3.5" dBm
FA-EXT-MIB::swSfpRxPower.'....|*..........'.21 = STRING: "-2.6" dBm
FA-EXT-MIB::swSfpRxPower.'....|*..........'.22 = STRING: "-2.3" dBm
FA-EXT-MIB::swSfpRxPower.'....|*..........'.23 = STRING: "-2.6" dBm
FA-EXT-MIB::swSfpRxPower.'....|*..........'.24 = STRING: "-3.3" dBm
FA-EXT-MIB::swSfpRxPower.'....|*..........'.25 = STRING: "NA" dBm
FA-EXT-MIB::swSfpRxPower.'....|*..........'.26 = STRING: "NA" dBm
...

Is this possible. Or do you need to query each item seperatly?

sghosh151 commented 2 years ago

the point of check_snmp it raise an alert when something is wrong. just returing a dataset doesn't achieve that objective

cookie33 commented 2 years ago

I know that it should give an alert or not. But using a snmpwalk to get the same parameters for for instance all ports of a SAN switch makes life much easier than doing 90 checks for the same san switch over and over to see what the status is of a port on the switch. (if it has 90 ports)

sni commented 2 years ago

You might want to have a look at the check_nwc_health plugin. Afaik this plugin is capable of using walks.

cookie33 commented 2 years ago

Thanks. But this check is for network switches. A san switch is a different beast. And I do not think the check_nwc_health plugin is going to help us. But thanks again :)