From c0d7d2c27916497022098e58a0f02e655c792191 Mon Sep 17 00:00:00 2001 From: Jim Hague Date: Mon, 15 Jan 2018 10:21:39 +0000 Subject: [PATCH] Print exit status at end of main output line. --- src/tools/getdns_server_mon.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/tools/getdns_server_mon.c b/src/tools/getdns_server_mon.c index 36666ac9..3275a3b1 100644 --- a/src/tools/getdns_server_mon.c +++ b/src/tools/getdns_server_mon.c @@ -983,6 +983,24 @@ int main(int ATTR_UNUSED(ac), char *av[]) ++f) { if (strcmp(testname, f->name) == 0) { exit_value_t xit = f->func(&test_info, av); + switch(xit) { + case 0: + fputs(" OK", test_info.errout); + break; + + case 1: + fputs(" WARNING", test_info.errout); + break; + + case 2: + fputs(" CRITICAL", test_info.errout); + break; + + default: + fputs(" UNKNOWN", test_info.errout); + break; + + } fputc('\n', test_info.errout); exit(xit); }