diff --git a/checks/cisco_asa_connections b/checks/cisco_asa_connections index 0f36212d73b5f9833411a4badc5ef6abeff7f556..ce7eab947b1b6358e34a2770f8f52055f56ff5d1 100644 --- a/checks/cisco_asa_connections +++ b/checks/cisco_asa_connections @@ -8,45 +8,46 @@ # 24.03.2016: changed "snmp_scan_function" from ".1.3.6.1.2.1.1.2.0" to ".1.3.6.1.2.1.1.1.0" # 02.07.2016: fixed crit/warn to >= # 09.01.2018: some fine tuning (changed infotext) +# 13.02.2020: changed snmp_info from ".1.3.6.1.4.1.9.9.147.1.2.2.2.1.5" to more specific "1.3.6.1.4.1.9.9.147.1.2.2.2.1.5.40" # # sample snmp walk # -# .1.3.6.1.4.1.9.9.147.1.2.2.2.1.5.40.6 = Gauge32: 16684 -# .1.3.6.1.4.1.9.9.147.1.2.2.2.1.5.40.7 = Gauge32: 46797 +# .1.3.6.1.4.1.9.9.147.1.2.2.2.1.5.40.6 = Gauge32: 4987 +# .1.3.6.1.4.1.9.9.147.1.2.2.2.1.5.40.7 = Gauge32: 17517 # # sample info # -# [[u'16684'], [u'46797']] +# [[u'4987', u'17517']] # # connection levels (war,crit,minimum) cisco_asa_connections_default_levels = (3000, 5000,100) def inventory_cisco_asa_connections(info): - current_connections = info[0] - max_connections = info[1] - return [(None, cisco_asa_connections_default_levels)] + if len(info) > 0: + return [(None, cisco_asa_connections_default_levels)] -def check_cisco_asa_connections(item, params, info): - warn, crit, minimum = params - current_connections = int(info[0][0]) - max_connections = int(info[1][0]) - perfdata = [('current_connections', current_connections, warn, crit, '', ''), ('max_connections', max_connections)] - infotext = 'item not found' +def check_cisco_asa_connections(_no_item, params, info): + if len(info) > 0: + warn, crit, minimum = params + current_connections = int(info[0][0]) + max_connections = int(info[0][1]) + perfdata = [('current_connections', current_connections, warn, crit, '', ''), ('max_connections', max_connections)] + infotext = '' - if current_connections >= crit: - infotext = '%d (>=%d)(!!)/%d current/max connections' % (current_connections, crit, max_connections) - return 2, infotext, perfdata - elif current_connections >= warn: - infotext = '%d (>=%d)(!)/%d current/max connections' % (current_connections, warn, max_connections) - return 1, infotext, perfdata - elif current_connections < minimum: - infotext = '%d (<%d)(!!)/%d current/max connections' % (current_connections, minimum, max_connections) - return 2, infotext, perfdata - else: - infotext = '%d/%d current/max connections' % (current_connections, max_connections) - return 0, infotext, perfdata + if current_connections >= crit: + infotext = '%d (>=%d)(!!)/%d current/max connections' % (current_connections, crit, max_connections) + return 2, infotext, perfdata + elif current_connections >= warn: + infotext = '%d (>=%d)(!)/%d current/max connections' % (current_connections, warn, max_connections) + return 1, infotext, perfdata + elif current_connections < minimum: + infotext = '%d (<%d)(!!)/%d current/max connections' % (current_connections, minimum, max_connections) + return 2, infotext, perfdata + else: + infotext = '%d/%d current/max connections' % (current_connections, max_connections) + return 0, infotext, perfdata check_info['cisco_asa_connections'] = { @@ -56,7 +57,8 @@ check_info['cisco_asa_connections'] = { 'has_perfdata' : True, 'group' : 'cisco_asa_connections', 'snmp_scan_function' : lambda oid: oid('.1.3.6.1.2.1.1.1.0').lower().startswith('cisco adaptive security appliance'), - 'snmp_info' : ('.1.3.6.1.4.1.9.9.147.1.2.2.2.1', [ - '5' # CISCO-FIREWALL-MIB::cfwConnectionStatValue + 'snmp_info' : ('.1.3.6.1.4.1.9.9.147.1.2.2.2.1.5.40', [ # CISCO-FIREWALL-MIB::cfwConnectionStatValue.protoIp + '6', # CISCO-FIREWALL-MIB::cfwConnectionStatValue.protoIp.currentInUse + '7', # CISCO-FIREWALL-MIB::cfwConnectionStatValue.protoIp.high ]), } diff --git a/cisco_asa_connections.mkp b/cisco_asa_connections.mkp index 855d6ccf29e88e64ade038fcfbc0b51b169eab64..f1b767230768bec07b5f76275dad01c44ee61829 100644 Binary files a/cisco_asa_connections.mkp and b/cisco_asa_connections.mkp differ