Skip to content
Permalink
Browse files

7799 FIX mcafee_webgateway_misc: Fixed crash if SNMP agent sends an e…

…mpty string for clients or sockets

Change-Id: I1eb87083bd9f56bea8f1b9cf324af060009b87c7
  • Loading branch information
si-23 committed Jun 13, 2019
1 parent 9af642e commit 553a2d1338d3607dd5735fd756137d0450d57339
Showing with 19 additions and 4 deletions.
  1. +11 −0 .werks/7799
  2. +8 −4 checks/mcafee_webgateway_misc
@@ -0,0 +1,11 @@
Title: mcafee_webgateway_misc: Fixed crash if SNMP agent sends an empty string for clients or sockets
Level: 1
Component: checks
Class: fix
Compatible: compat
Edition: cre
State: unknown
Version: 1.6.0b2
Date: 1560430870


@@ -30,11 +30,15 @@


def check_mcafee_webgateway_misc(_no_item, params, info):
clients, sockets = map(int, info[0])
for what, value, paramskey, perfkey in [
("Clients", clients, "clients", "connections"),
("Open network sockets", sockets, "network_sockets", "open_network_sockets"),
clients_str, sockets_str = info[0]
for what, value_str, paramskey, perfkey in [
("Clients", clients_str, "clients", "connections"),
("Open network sockets", sockets_str, "network_sockets", "open_network_sockets"),
]:
try:
value = int(value_str)
except ValueError:
continue
state = 0
infotext = '%s: %d' % (what, value)
warn, crit = params.get(paramskey, (None, None))

0 comments on commit 553a2d1

Please sign in to comment.
You can’t perform that action at this time.