11## check_snmp
22#### Python script that checks components status against Dell or HPE servers with snmpwalk command
33
4- Usage: ` check_snmp.py [-h] [-v VERSION] [-c COMMUNITY] [-r] host `
4+ ```
5+ usage: check_snmp.py [-h] [-v VERSION] [-c COMMUNITY] [-r] [-f] host
6+
7+ positional arguments:
8+ host The host to connect to.
9+
10+ optional arguments:
11+ -h, --help show this help message and exit
12+ -v VERSION The SNMP version to use.
13+ -c COMMUNITY The community string to use.
14+ -r Respect properties marked as important when other results contain errors.
15+ -f Include additional format like colors in the output.
16+ ```
517
6- For example ` check_snmp.py -r 192.168.1.120 `
18+ For example ` check_snmp.py -r -f 192.168.1.120 `
719
820By default SNMP version ** v2c** and community string ** public** will be used. Different values can be specified with ` -v ` and ` -c ` respectively.
921The script will decide the manufacturer based on the OID returned on a initial call to snmpgetnext.
@@ -18,19 +30,7 @@ As one of my earliest Python projects, feel free to fork and make your own impro
1830--------------
1931
2032### Sample Output
21- ```
22- sample@sample:~$ ./check_snmp.py -r 192.168.1.120
23- Overall system status: critical (critical)
24- Processor status: ok (ok)
25- Memory status: ok (ok|ok)
26- Physical disk status: critical (online|online|removed|removed|removed|failed|online)
27- Virtual disk status: critical (degraded)
28- Storage controller status: ok (ok|ok)
29- Cooling status: ok (ok)
30- Temperature status: ok (ok|ok)
31- Power supply status: ok (ok)
32- Battery status: ok (ok)
33- ```
33+ ![ sample] ( https://i.imgur.com/QowbHdr.png )
3434
3535### Return Value
3636Integer value that is inline with the Nagios exit codes.
0 commit comments