Skip to content

Commit 26af961

Browse files
Fixes for wrong NSCA/Nagios exit code on success
1 parent 8fa5e72 commit 26af961

File tree

3 files changed

+5
-3
lines changed

3 files changed

+5
-3
lines changed

mongodb_consistent_backup/Main.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -443,10 +443,11 @@ def run(self):
443443

444444
# send notifications of backup state
445445
try:
446-
self.notify.notify("%s: backup '%s' succeeded in %s secs" % (
446+
self.notify.notify("%s: '%s/%s' succeeded in %.2f secs" % (
447447
self.program_name,
448448
self.config.backup.name,
449-
self.timer.duration(self.timer)
449+
self.backup_time,
450+
self.timer.duration(self.timer_name)
450451
), True)
451452
self.notify.run()
452453
self.notify.close()

mongodb_consistent_backup/Notify/Notify.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ def run(self, *args):
2727
state = self._task.failed
2828
if success:
2929
state = self._task.success
30-
self._task.run(success, message)
30+
self._task.run(state, message)
3131
except:
3232
continue
3333
self.timers.stop(self.stage)

mongodb_consistent_backup/Notify/Nsca/Nsca.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ def run(self, ret_code, output):
6060
self.check_name,
6161
self.server
6262
))
63+
logging.debug('NSCA report message: "%s", return code: %i, check host/name: "%s/%s"' % (output, ret_code, self.check_host, self.check_name))
6364
# noinspection PyBroadException
6465
try:
6566
self.notifier.svc_result(self.check_host, self.check_name, ret_code, str(output))

0 commit comments

Comments
 (0)