Skip to content

Commit b8977bd

Browse files
committed
Fixed issue reading numerical oid strings caused by the changes made in the previous commit.
Added metadata tags and a docstring at the top of the file
1 parent 88cf116 commit b8977bd

File tree

1 file changed

+19
-5
lines changed

1 file changed

+19
-5
lines changed

check_cisco_ip_sla.py

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,24 @@
11
#!/usr/bin/python
22

3+
"""
4+
This plugin can check the status of one or more IP SLA entries on a Cisco IOS device.
5+
IP SLAs can be used to monitor IP service levels for various IP applications and services. See the Cisco website
6+
for more details on SLA entries and their use. One simple usage example is to monitor a multi-connection
7+
failover routing setup to monitor SLAs which ping the other end of each line. SLA's can be set up to monitor
8+
a line/route and when this line goes down, the corresponding SLA will go down which this plugin can monitor.
9+
This is just one example, however SLAs can be configured for various other tasks.
10+
For more info on IP SLA's, see the manual for your Cisco device on IP SLA's.
11+
"""
12+
313
import argparse
414
from easysnmp import Session
515
from easysnmp.exceptions import *
616

7-
__author__ = "[email protected]"
17+
__author__ = "Maarten Hoogveld"
18+
__version__ = "1.0.1"
19+
__email__ = "[email protected]"
20+
__licence__ = "GPL-3.0"
21+
__status__ = "Production"
822

923

1024
class CiscoIpSlaChecker:
@@ -207,8 +221,8 @@ def read_rtt_entries(self):
207221
rtt_ctrl_admin_entries = self.session.walk(".1.3.6.1.4.1.9.9.42.1.2.1.1")
208222
for item in rtt_ctrl_admin_entries:
209223
oid_parts = str(item.oid).split(".")
210-
rtt_entry = oid_parts[-1]
211-
rtt_info_type = oid_parts[-2]
224+
rtt_info_type = oid_parts[-1]
225+
rtt_entry = str(item.oid_index)
212226

213227
if rtt_entry not in self.rtt_dict:
214228
self.rtt_dict[rtt_entry] = dict()
@@ -227,8 +241,8 @@ def read_rtt_entries(self):
227241
rtt_ctrl_oper_entries = self.session.walk(".1.3.6.1.4.1.9.9.42.1.2.9.1")
228242
for item in rtt_ctrl_oper_entries:
229243
oid_parts = str(item.oid).split(".")
230-
rtt_entry = oid_parts[-1]
231-
rtt_info_type = oid_parts[-2]
244+
rtt_info_type = oid_parts[-1]
245+
rtt_entry = str(item.oid_index)
232246

233247
if "5" == rtt_info_type:
234248
# rttMonCtrlOperConnectionLostOccurred (5)

0 commit comments

Comments
 (0)