check_apaches: Add slots check
This commit is contained in:
parent
5bdf0dd8d2
commit
598eeab975
|
@ -71,6 +71,18 @@ class CheckApaches(MonitoringPlugin):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
||||||
|
def check_slots(self, target='open', warn='', crit=''):
|
||||||
|
pd = {'label':'slots_open', 'unit':'', 'warn':warn, 'crit': crit, 'min':0}
|
||||||
|
|
||||||
|
if target == 'open':
|
||||||
|
returncode = self.value_wc_to_returncode(self.apache_states['.'], warn, crit)
|
||||||
|
output = '%d open slots' % self.apache_states['.']
|
||||||
|
pd['value'] = self.apache_states['.']
|
||||||
|
pd['label'] = 'slots_open'
|
||||||
|
|
||||||
|
return self.remember_check('slots', returncode, output, perfdata=[pd], target=target)
|
||||||
|
|
||||||
|
|
||||||
def check_worker(self, target='busy', warn='', crit=''):
|
def check_worker(self, target='busy', warn='', crit=''):
|
||||||
pd = {'label':'worker_busy', 'unit':'', 'warn':warn, 'crit': crit, 'min':0}
|
pd = {'label':'worker_busy', 'unit':'', 'warn':warn, 'crit': crit, 'min':0}
|
||||||
|
|
||||||
|
@ -176,7 +188,9 @@ def main():
|
||||||
for quad in checks:
|
for quad in checks:
|
||||||
(check, target, warn, crit) = tuple(quad)
|
(check, target, warn, crit) = tuple(quad)
|
||||||
|
|
||||||
if check == 'worker':
|
if check == 'slots':
|
||||||
|
result = plugin.check_slots(target, warn, crit)
|
||||||
|
elif check == 'worker':
|
||||||
result = plugin.check_worker(target, warn, crit)
|
result = plugin.check_worker(target, warn, crit)
|
||||||
else:
|
else:
|
||||||
result = plugin.remember_check(check, plugin.RETURNCODE['UNKNOWN'], 'Unknown check "' + check + '"!')
|
result = plugin.remember_check(check, plugin.RETURNCODE['UNKNOWN'], 'Unknown check "' + check + '"!')
|
||||||
|
|
Loading…
Reference in a new issue