summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 11c3dda)
raw | patch | inline | side by side (parent: 11c3dda)
author | Ton Voon <tonvoon@users.sourceforge.net> | |
Tue, 2 Sep 2003 15:04:02 +0000 (15:04 +0000) | ||
committer | Ton Voon <tonvoon@users.sourceforge.net> | |
Tue, 2 Sep 2003 15:04:02 +0000 (15:04 +0000) |
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@709 f882894a-f735-0410-b71e-b25c423dba1c
plugins/check_procs.c | patch | blob | history |
diff --git a/plugins/check_procs.c b/plugins/check_procs.c
index 8a3f7ac2f543522ab399d6f9e286b4ac75d3f988..e0ee524c0ec2de46bfb88e6f34fe7fdfa0d4e7fc 100644 (file)
--- a/plugins/check_procs.c
+++ b/plugins/check_procs.c
}
}
- if (fmt != "") {
- printf (" with %s", fmt);
+ if (strcmp(fmt,"") != 0) {
+ printf (_(" with %s"), fmt);
}
if ( verbose >= 1 && fails != "" )
break;
case 'p': /* process id */
if (sscanf (optarg, "%d%[^0-9]", &ppid, tmp) == 1) {
- asprintf (&fmt, "%s%sPPID = %d", fmt, (options ? ", " : ""), ppid);
+ asprintf (&fmt, "%s%sPPID = %d", (fmt ? fmt : "") , (options ? ", " : ""), ppid);
options |= PPID;
break;
}
break;
else
statopts = optarg;
- asprintf (&fmt, _("%s%sSTATE = %s"), fmt, (options ? ", " : ""), statopts);
+ asprintf (&fmt, _("%s%sSTATE = %s"), (fmt ? fmt : ""), (options ? ", " : ""), statopts);
options |= STAT;
break;
case 'u': /* user or user id */
uid = pw->pw_uid;
}
user = pw->pw_name;
- asprintf (&fmt, _("%s%sUID = %d (%s)"), fmt, (options ? ", " : ""),
+ asprintf (&fmt, _("%s%sUID = %d (%s)"), (fmt ? fmt : ""), (options ? ", " : ""),
uid, user);
options |= USER;
break;
break;
else
prog = optarg;
- asprintf (&fmt, _("%s%scommand name '%s'"), fmt, (options ? ", " : ""),
+ asprintf (&fmt, _("%s%scommand name '%s'"), (fmt ? fmt : ""), (options ? ", " : ""),
prog);
options |= PROG;
break;
break;
else
args = optarg;
- asprintf (&fmt, _("%s%sargs '%s'"), fmt, (options ? ", " : ""), args);
+ asprintf (&fmt, _("%s%sargs '%s'"), (fmt ? fmt : ""), (options ? ", " : ""), args);
options |= ARGS;
break;
case 'r': /* RSS */
if (sscanf (optarg, "%d%[^0-9]", &rss, tmp) == 1) {
- asprintf (&fmt, _("%s%sRSS >= %d"), fmt, (options ? ", " : ""), rss);
+ asprintf (&fmt, _("%s%sRSS >= %d"), (fmt ? fmt : ""), (options ? ", " : ""), rss);
options |= RSS;
break;
}
exit (STATE_UNKNOWN);
case 'z': /* VSZ */
if (sscanf (optarg, "%d%[^0-9]", &vsz, tmp) == 1) {
- asprintf (&fmt, _("%s%sVSZ >= %d"), fmt, (options ? ", " : ""), vsz);
+ asprintf (&fmt, _("%s%sVSZ >= %d"), (fmt ? fmt : ""), (options ? ", " : ""), vsz);
options |= VSZ;
break;
}
case 'P': /* PCPU */
/* TODO: -P 1.5.5 is accepted */
if (sscanf (optarg, "%f%[^0-9.]", &pcpu, tmp) == 1) {
- asprintf (&fmt, _("%s%sPCPU >= %.2f"), fmt, (options ? ", " : ""), pcpu);
+ asprintf (&fmt, _("%s%sPCPU >= %.2f"), (fmt ? fmt : ""), (options ? ", " : ""), pcpu);
options |= PCPU;
break;
}
cmax = atoi (argv[c++]);
if (statopts == NULL && argv[c]) {
asprintf (&statopts, "%s", argv[c++]);
- asprintf (&fmt, _("%s%sSTATE = %s"), fmt, (options ? ", " : ""), statopts);
+ asprintf (&fmt, _("%s%sSTATE = %s"), (fmt ? fmt : ""), (options ? ", " : ""), statopts);
options |= STAT;
}