|
10 | 10 | For more info on IP SLA's, see the manual for your Cisco device on IP SLA's. |
11 | 11 | """ |
12 | 12 |
|
| 13 | +from __future__ import division, print_function, absolute_import |
13 | 14 | import argparse |
14 | 15 | import math |
15 | 16 | from decimal import * |
@@ -251,8 +252,8 @@ def print_output(self): |
251 | 252 | def create_snmp_session(self): |
252 | 253 | self.session = Session( |
253 | 254 | hostname=self.options.hostname, |
254 | | - community=self.options.community, |
255 | 255 | version=int(self.options.snmp_version), |
| 256 | + community=self.options.community, |
256 | 257 | security_username=self.options.security_name, |
257 | 258 | security_level=self.options.security_level, |
258 | 259 | auth_protocol=self.options.auth_protocol, |
@@ -386,7 +387,7 @@ def read_rtt_entries(self): |
386 | 387 | rtt_info_type = oid_parts[-1] |
387 | 388 | rtt_entry = str(item.oid_index) |
388 | 389 |
|
389 | | - if not rtt_entry in latest_jitters: |
| 390 | + if rtt_entry not in latest_jitters: |
390 | 391 | latest_jitters[rtt_entry] = dict() |
391 | 392 |
|
392 | 393 | try: |
@@ -490,10 +491,10 @@ def read_rtt_entries(self): |
490 | 491 |
|
491 | 492 | elif "42" == rtt_info_type: |
492 | 493 | # rttMonLatestJitterOperMOS (42) |
493 | | - MOS = Decimal(item.value) |
494 | | - if MOS >= 100: |
495 | | - MOS = MOS / 100 |
496 | | - latest_jitters[rtt_entry]["MOS"] = MOS |
| 494 | + mos = Decimal(item.value) |
| 495 | + if mos >= 100: |
| 496 | + mos = mos / 100 |
| 497 | + latest_jitters[rtt_entry]["MOS"] = mos |
497 | 498 |
|
498 | 499 | elif "43" == rtt_info_type: |
499 | 500 | # rttMonLatestJitterOperICPIF (43) |
|
0 commit comments