You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+16-13Lines changed: 16 additions & 13 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,9 +1,9 @@
1
1
## check_snmp
2
2
#### Python script that checks components status against Dell or HPE servers with snmpwalk command
3
3
4
-
Usage: `check_snmp.py <ip_or_hostname>`
4
+
Usage: `check_snmp.py [-h] [-r] host`
5
5
6
-
For example `check_snmp.py 192.168.1.120`
6
+
For example `check_snmp.py -r 192.168.1.120`
7
7
8
8
The script will decide the manufacturer based on the OID returned on a initial call to snmpgetnext.
9
9
@@ -19,29 +19,32 @@ As one of my earliest Python projects, feel free to fork and make your own impro
19
19
### Sample Output
20
20
```
21
21
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)
31
32
```
32
33
33
34
### Return Value
34
35
Integer value that is inline with the Nagios exit codes.
35
36
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.
37
40
38
41
Exit Code | Status
39
42
--- | ---
40
43
0 | OK
41
44
1 | WARNING
42
45
2 | CRITICAL
43
46
3 | UNKNOWN
44
-
47
+
45
48
### Loading MIB
46
49
For Dell only one MIB module `IDRAC-MIB-SMIv2` needs to be specified in the snmpwalk command with `-m` option.
0 commit comments