Module: check_mk
Branch: master
Commit: 5891419849c7c13109321bbe84d1f3be041d8ef8
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=5891419849c7c1…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Wed Dec 12 14:35:44 2012 +0100
plesk_backups: Handling exceptions in agent code correctly
---
checks/plesk_backups | 7 +++++--
1 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/checks/plesk_backups b/checks/plesk_backups
index ebb838d..ba56346 100644
--- a/checks/plesk_backups
+++ b/checks/plesk_backups
@@ -35,8 +35,11 @@ def check_plesk_backups(item, params, info):
if item != line[0]:
continue
- if len(line) != 5:
- if line[1] == '4':
+ if len(line) != 5 or line[1] != '0':
+ if line[1] == '2':
+ return (3, 'UNKNOWN - Error in agent (%s)' % '
'.join(line[1:]))
+
+ elif line[1] == '4':
state = params.get('no_backup_configured_state', 1)
return (state, '%s - No backup configured' %
nagios_state_names[state])