[nagiosplug] check_pgsql: Fixed query perfdata output for ...

Nagios Plugin Development nagios-plugins at users.sourceforge.net
Sat Aug 17 22:50:37 CEST 2013


 Module: nagiosplug
 Branch: master
 Commit: 58ef38e2bb9503f4fbcca5fb8b17ccaf47f9ed67
 Author: Sebastian Harl <sh at teamix.net>
   Date: Wed Apr  6 16:59:19 2011 +0200
    URL: http://nagiosplug.git.sf.net/git/gitweb.cgi?p=nagiosplug/nagiosplug;a=commit;h=58ef38e

check_pgsql: Fixed query perfdata output for empty warn/crit ranges.

Previously, "(null)" was printed (when using GNU's libc). This has been
changed to print the empty string instead.

---

 plugins/check_pgsql.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/plugins/check_pgsql.c b/plugins/check_pgsql.c
index edad116..2acddc4 100644
--- a/plugins/check_pgsql.c
+++ b/plugins/check_pgsql.c
@@ -578,7 +578,9 @@ do_query (PGconn *conn, char *query)
 						? _("CRITICAL")
 						: _("UNKNOWN"));
 	printf (_("'%s' returned %f"), query, value);
-	printf ("|query=%f;%s;%s;0\n", value, query_warning, query_critical);
+	printf ("|query=%f;%s;%s;0\n", value,
+			query_warning ? query_warning : "",
+			query_critical ? query_critical : "");
 	return my_status;
 }
 





More information about the Commits mailing list