Code

check_pgsql: Fixed query perfdata output for empty warn/crit ranges.
authorSebastian Harl <sh@teamix.net>
Wed, 6 Apr 2011 14:59:19 +0000 (16:59 +0200)
committerSebastian Harl <sh@teamix.net>
Wed, 6 Apr 2011 14:59:19 +0000 (16:59 +0200)
Previously, "(null)" was printed (when using GNU's libc). This has been
changed to print the empty string instead.

plugins/check_pgsql.c

index fee9585fad81e939c29ea21917b8ef883168dd70..0f6eda479dee2f5c0862f853e0111310f9dc0b47 100644 (file)
@@ -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;
 }