mhoogveld / check_cisco_ip_sla Goto Github PK
View Code? Open in Web Editor NEWMonitoring plugin for checking the status of IP SLAs on Cisco devices
License: GNU General Public License v3.0
Monitoring plugin for checking the status of IP SLAs on Cisco devices
License: GNU General Public License v3.0
Hi Martin.
I think that based on oidref (http://oidref.com/1.3.6.1.4.1.9.9.42.1.2.9.1.5) , the 'connection_lost' should only be checked if the rtt_type is 1 or 9
a lazy fix would be
if self.rtt_dict[requested_entry]["conn_lost_occurred"] and "echo" in self.get_rtt_type_description(rtt_type).lower(): failed_count += 1
The reason for this, is I have some udp-jitter probes reporting Connection lost, however I can't confirm if the object was a different rtt_type originally. I also haven't tested creating an icmp echo probe, then changing the type to udp_jitter, and seeing if it clears the previous value.
Thanks
Add support for rtt's of type http, including performance data from the rttMonLatestHttpOperTable
Hi,
Thanks for the plugin.
When running it against an icmp-echo entry that is failing, the script returns "OK".
***# ./check_cisco_ip_sla.py -H sr-gva-itrb12-vdcl3-1 -v2 -c sal3ve -m check -e 1000 --verbose 2 --perf
Using parameters:
Hostname: ***
SNMP-version: ***
Community: ***
Security-name: ***
Security-level: ***
Password: ***
Auth-protocol: ***
Auth-password: ***
Priv-protocol: ***
Priv-password: ***
Mode: check
SLA entries: 1000
Perf-data: True
Critical-pct: 100
Warning-pct: 50
Critical: None
Warning: None
Critical Average Jitter: None
Warning Average Jitter: None
Critical MOS: None
Warning MOS: None
Critical ICPIF: None
Warning ICPIF: None
Verbosity: 2
Starting SNMP-walk for rttMonCtrlAdminTable (.1.3.6.1.4.1.9.9.42.1.2.1.1)
Starting SNMP-walk for rttMonCtrlOperTable (.1.3.6.1.4.1.9.9.42.1.2.9.1)
Starting SNMP-walk for rttMonLatestRttOperTable (.1.3.6.1.4.1.9.9.42.1.2.10.1)
Starting SNMP-walk for rttMonLatestJitterOperTable (.1.3.6.1.4.1.9.9.42.1.5.2.1)
OK - 1 OK | 'rtt'=0ms
***#
An snmpwalk on that OID correctly returns 4 (timeout).
***# snmpwalk *** .1.3.6.1.4.1.9.9.42.1.2.10.1.2.1000
***enterprises.9.9.42.1.2.10.1.2.1000 = INTEGER: 4
***#
Would you be able to assist?
Many thanks
When using python3.7+ there is apparently an issue coming from easysnmp:
easysnmp/easysnmp#108
When I try to install and use check_cisco_ip_sla in Ubuntu 20.04 with python 3.8.2,
I get this error:
Traceback (most recent call last): File "./check_cisco_ip_sla.py", line 931, in <module> result = checker.run() File "./check_cisco_ip_sla.py", line 76, in run self.read_rtt_entries() File "./check_cisco_ip_sla.py", line 298, in read_rtt_entries rtt_ctrl_admin_entries = self.session.walk(".1.3.6.1.4.1.9.9.42.1.2.1.1") File "/usr/local/lib/python3.8/dist-packages/easysnmp/session.py", line 467, in walk interface.walk(self, varlist) SystemError: <built-in function walk> returned NULL without setting an error
Adding support for SNMP v3 should be quite easy.
Just adding some command-line parameters and passing them through to easysnmp when creating a Session should do the trick.
We have IPSLA checks setup for VoIP jitter and MOS score. Is it possible to add these metrics into the returned perfdata?
Sample output of one of our IPSLA configs:
IPSLAs Latest Operation Statistics
IPSLA operation id: 101292
Type of operation: udp-jitter
Latest RTT: 42 milliseconds
Latest operation start time: 13:37:28 gmt Mon Mar 20 2017
Latest operation return code: OK
RTT Values:
Number Of RTT: 1000 RTT Min/Avg/Max: 41/42/75 milliseconds
Latency one-way time:
Number of Latency one-way Samples: 1000
Source to Destination Latency one way Min/Avg/Max: 19/20/53 milliseconds
Destination to Source Latency one way Min/Avg/Max: 21/22/27 milliseconds
Jitter Time:
Number of SD Jitter Samples: 999
Number of DS Jitter Samples: 999
Source to Destination Jitter Min/Avg/Max: 0/1/15 milliseconds
Destination to Source Jitter Min/Avg/Max: 0/1/5 milliseconds
Packet Loss Values:
Loss Source to Destination: 0
Source to Destination Loss Periods Number: 0
Source to Destination Loss Period Length Min/Max: 0/0
Source to Destination Inter Loss Period Length Min/Max: 0/0
Loss Destination to Source: 0
Destination to Source Loss Periods Number: 0
Destination to Source Loss Period Length Min/Max: 0/0
Destination to Source Inter Loss Period Length Min/Max: 0/0
Out Of Sequence: 0 Tail Drop: 0
Packet Late Arrival: 0 Packet Skipped: 0
Voice Score Values:
Calculated Planning Impairment Factor (ICPIF): 11
MOS score: 4.06
Number of successes: 9
Number of failures: 0
The rttMonReactAdminTable also contains rttMonCtrlOperConnectionLostOccurred and rttMonCtrlOperOverThresholdOccurred. These values might also contain valuable information.
I get the following error message.
[vagrant@vagrant-centos64 check-scripts]$ LD_PRELOAD=/usr/local/lib/libnetsnmp.so python2.7 check_cisco_ip_sla.py -H 10.10.10.10 -c secret -m check -e 2
Traceback (most recent call last):
File "check_cisco_ip_sla.py", line 357, in
result = checker.run()
File "check_cisco_ip_sla.py", line 41, in run
self.check()
File "check_cisco_ip_sla.py", line 309, in check
if self.rtt_dict[requested_entry]["timeout_occured"]:
KeyError: 'timeout_occured'
Changing line 309 to
if "timeout_occured" in self.rtt_dict[requested_entry]:
seems to fix it.
Hi,
I got the following prolem, when running with --entries all: (python 3.6)
Using parameters:
Hostname: XXX
SNMP-version: 3
Community: public
Security-name: XXX
Security-level: authPriv
Password: None
Auth-protocol: SHA
Auth-password: XXX
Priv-protocol: AES
Priv-password: XXX
Mode: check
SLA entries: all
Perf-data: True
Critical-pct: 100
Warning-pct: 50
Critical: None
Warning: None
Critical MOS: None
Warning MOS: None
Critical ICPIF: None
Warning ICPIF: None
Verbosity: 2
Starting SNMP-walk for rttMonCtrlAdminTable (.1.3.6.1.4.1.9.9.42.1.2.1.1)
Starting SNMP-walk for rttMonCtrlOperTable (.1.3.6.1.4.1.9.9.42.1.2.9.1)
Starting SNMP-walk for rttMonLatestRttOperTable (.1.3.6.1.4.1.9.9.42.1.2.10.1)
Starting SNMP-walk for rttMonLatestJitterOperTable (.1.3.6.1.4.1.9.9.42.1.5.2.1)
<class 'dict_keys'>
Traceback (most recent call last):
File "./check_cisco_ip_sla.py", line 931, in
result = checker.run()
File "./check_cisco_ip_sla.py", line 84, in run
self.check()
File "./check_cisco_ip_sla.py", line 845, in check
requested_entries.sort(key=int)
The problem is this:
https://stackoverflow.com/questions/28039155/dict-items-object-has-no-attribute-sortreplace-min
I solved it by changed the following line (line 841):
requested_entries = self.rtt_dict.keys()
to:
requested_entries = list(self.rtt_dict.keys())
It's working now with pyhon 3.6 as well :)
Thanks,
Daniel
When trying current master on CentOS 7.6 with either Python 2.7.5 or Python 3.6.8, check mode will error out with:
$ python3 ./check_cisco_ip_sla.py -H 1.2.3.4 -v 2 -c MyCommunity --perf -m check
Traceback (most recent call last):
File "./check_cisco_ip_sla.py", line 953, in <module>
result = checker.run()
File "./check_cisco_ip_sla.py", line 84, in run
self.check()
File "./check_cisco_ip_sla.py", line 882, in check
if self.rtt_dict[requested_entry]["conn_lost_occurred"]:
KeyError: 'conn_lost_occurred'
Line 882, 885 and 888 are checking for some dict keys that in my case were not present, thus giving the KeyError.
Example output
$ python3 ./check_cisco_ip_sla.py --hostname 10.1.1.1 -c public -m list
SLAs available:
10
Exception ignored in: <bound method Session.__del__ of <easysnmp.session.Session object at 0x7f284b9a6470>>
Traceback (most recent call last):
File "/home/maarten/.local/lib/python3.4/site-packages/easysnmp/session.py", line 478, in __del__
TypeError: 'NoneType' object is not callable
To prevent having to specify passwords on the command line, it should be possible to load (some) options from a configuration file. This prevents sensitive data showing up in process lists or the Nagios configuration and stores passwords in a place where proper access control can be enforced.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.