Code

No more warn/crit values in performance data if -w and -c are not specified.
authorMatthias Eble <psychotrahe@users.sourceforge.net>
Tue, 29 May 2007 19:11:42 +0000 (19:11 +0000)
committerMatthias Eble <psychotrahe@users.sourceforge.net>
Tue, 29 May 2007 19:11:42 +0000 (19:11 +0000)
Thanks to Simon Bellwood (#1181554)

git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1722 f882894a-f735-0410-b71e-b25c423dba1c

plugins/check_tcp.c

index 57e1f0df0306a7d704f602e8f70a262a114d943b..a977077c3fce99b0586d0f697b22c29299d0c382 100644 (file)
@@ -366,16 +366,16 @@ main (int argc, char **argv)
        if(match == -2)
                printf ("|%s",
                                fperfdata ("time", elapsed_time, "s",
-                               TRUE, 0,
-                               TRUE, 0,
+                               (flags & FLAG_TIME_WARN ? TRUE : FALSE), 0,
+                               (flags & FLAG_TIME_CRIT ? TRUE : FALSE), 0,
                                TRUE, 0,
                                TRUE, socket_timeout)
                        );
        else
                printf("|%s",
                                fperfdata ("time", elapsed_time, "s",
-                               TRUE, warning_time,
-                               TRUE, critical_time,
+                               (flags & FLAG_TIME_WARN ? TRUE : FALSE), warning_time,
+                               (flags & FLAG_TIME_CRIT ? TRUE : FALSE), critical_time,
                                TRUE, 0,
                                TRUE, socket_timeout)
                        );