Skip to content

Commit cb859e5

Browse files
author
Carl Chang
committed
update readme
1 parent 6f716b8 commit cb859e5

File tree

1 file changed

+16
-13
lines changed

1 file changed

+16
-13
lines changed

README.md

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
## check_snmp
22
#### Python script that checks components status against Dell or HPE servers with snmpwalk command
33

4-
Usage: `check_snmp.py <ip_or_hostname>`
4+
Usage: `check_snmp.py [-h] [-r] host`
55

6-
For example `check_snmp.py 192.168.1.120`
6+
For example `check_snmp.py -r 192.168.1.120`
77

88
The script will decide the manufacturer based on the OID returned on a initial call to snmpgetnext.
99

@@ -19,29 +19,32 @@ As one of my earliest Python projects, feel free to fork and make your own impro
1919
### Sample Output
2020
```
2121
sample@sample:~$ check_snmp.py -r 192.168.1.120
22-
Overall system status: ok
23-
Memory status: ok
24-
Physical disk status: ok
25-
Virtual disk status: ok
26-
Storage controller status: ok
27-
Cooling status: ok
28-
Temperature status: ok
29-
Power supply status: ok
30-
Integrated Management Log status: ok
22+
Overall system status: critical (critical)
23+
Processor status: ok (ok)
24+
Memory status: ok (ok|ok)
25+
Physical disk status: critical (online|online|removed|removed|removed|failed|online)
26+
Virtual disk status: critical (degraded)
27+
Storage controller status: ok (ok|ok)
28+
Cooling status: ok (ok)
29+
Temperature status: ok (ok|ok)
30+
Power supply status: ok (ok)
31+
Battery status: ok (ok)
3132
```
3233

3334
### Return Value
3435
Integer value that is inline with the Nagios exit codes.
3536

36-
The most severe status is preserved and used as return value.
37+
For each OID, if there are multiple results (e.g. there may be more than one disk in the system), the most severe status is preserved and used as return value.
38+
By default the exit code will be the most severe one of all the results from the OIDs.
39+
If `-r` option is specified, the script will only check the OIDs marked as **important** when returning.
3740

3841
Exit Code | Status
3942
--- | ---
4043
0 | OK
4144
1 | WARNING
4245
2 | CRITICAL
4346
3 | UNKNOWN
44-
47+
4548
### Loading MIB
4649
For Dell only one MIB module `IDRAC-MIB-SMIv2` needs to be specified in the snmpwalk command with `-m` option.
4750

0 commit comments

Comments
 (0)