Fixed service output for warn/crit states, cleared mixed indentation.

This commit is contained in:
George Pochiscan 2021-12-13 11:40:14 +02:00
parent cefba89f21
commit 2392bc8390
6 changed files with 16 additions and 19 deletions

Binary file not shown.

View File

@ -43,12 +43,12 @@ def check_infoblox_aat5_count(item, params, info):
if count > warn:
if count > crit:
state = 2
count_info = "(crit above %s)" % crit
count_info = "Number of AAT5 Requests is %s (crit above %s requests)" % (count, crit)
else:
state = 1
count_info = "(warn above %s)" % warn
count_info = "Number of AAT5 Requests is %s (warn above %s requests)" % (count, warn)
else:
count_info = "Count is is %s" % count
count_info = "Number of AAT5 Requests is %s" % count
yield state, count_info, [('Count', count, warn, crit)]
check_info['infoblox_aat5_count'] = {

View File

@ -33,9 +33,7 @@ def inventory_infoblox_aat5_latency(info):
yield item, {}
def check_infoblox_aat5_latency(item, params, info):
print item
latency=int(info[0][0])
print params
if params:
warn, crit = params['infoblox_latency']
else:
@ -45,12 +43,12 @@ def check_infoblox_aat5_latency(item, params, info):
if latency > warn:
if latency > crit:
state = 2
latency_info = "(crit above %s)" % crit
latency_info = "Latency is %s ms (crit above %s ms)" % (latency, crit)
else:
state = 1
latency_info = "(warn above %s)" % warn
latency_info = "Latency is %s ms (warn above %s ms)" % (latency, warn)
else:
latency_info = "Latency is %s" % latency
latency_info = "Latency is %s ms" % latency
yield state, latency_info, [('Latency', latency, warn, crit)]
check_info['infoblox_aat5_latency'] = {

View File

@ -44,12 +44,12 @@ def check_infoblox_nonaat5_count(item, params, info):
if count > warn:
if count > crit:
state = 2
count_info = "(crit above %s)" % crit
count_info = "Number of NonAAT5 Requests is %s (crit above %s requests)" % (count, crit)
else:
state = 1
count_info = "(warn above %s)" % warn
count_info = "Number of NonAAT5 Requests is %s (warn above %s requests)" % (count, warn)
else:
count_info = "Count is is %s" % count
count_info = "Number of NonAAT5 Requests is %s" % count
yield state, count_info, [('Count', count, warn, crit)]
check_info['infoblox_nonaat5_count'] = {

View File

@ -35,7 +35,6 @@ def inventory_infoblox_nonaat5_latency(info):
def check_infoblox_nonaat5_latency(item, params, info):
latency=int(info[0][0])
print params
if params:
warn, crit = params['infoblox_latency']
else:
@ -45,12 +44,12 @@ def check_infoblox_nonaat5_latency(item, params, info):
if latency > warn:
if latency > crit:
state = 2
latency_info = "(crit above %s)" % crit
latency_info = "Latency is %s ms (crit above %s ms)" % (latency, crit)
else:
state = 1
latency_info = "(warn above %s)" % warn
latency_info = "Latency is %s ms (warn above %s ms)" % (latency, warn)
else:
latency_info = "Latency is %s" % latency
latency_info = "Latency is %s ms" % latency
yield state, latency_info, [('Latency', latency, warn, crit)]
check_info['infoblox_nonaat5_latency'] = {