Skip to content

Commit

Permalink
Add a message if check_nrpe can't connect
Browse files Browse the repository at this point in the history
If check_nrpe can't connect it prints on stderr (which we ignore) and it
returns 255. It's the only case where it returns this code, according to
check_nrpe.c.
  • Loading branch information
danieljakots committed Apr 15, 2018
1 parent 6d07405 commit 40717e3
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions mownitoring.py
Expand Up @@ -133,6 +133,8 @@ def check_status(check, host, port, machine, notifiers, conn):
"""Choose if we send an alert."""
timestamp = datetime.datetime.now()
status, message = check_nrpe(check, host, port)
if status == 255:
message = "Connection refused"
c = conn.cursor()
param = (machine, check)
try:
Expand Down

0 comments on commit 40717e3

Please sign in to comment.