summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 3d3ebef)
raw | patch | inline | side by side (parent: 3d3ebef)
author | Karl DeBisschop <kdebisschop@users.sourceforge.net> | |
Mon, 17 Nov 2003 11:45:57 +0000 (11:45 +0000) | ||
committer | Karl DeBisschop <kdebisschop@users.sourceforge.net> | |
Mon, 17 Nov 2003 11:45:57 +0000 (11:45 +0000) |
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@771 f882894a-f735-0410-b71e-b25c423dba1c
plugins/check_ups.c | patch | blob | history |
diff --git a/plugins/check_ups.c b/plugins/check_ups.c
index 335cb993ace0490f860927545ba16b76a5ea1239..116e888ce5c79d8610515dbda1f37d7537993f49 100644 (file)
--- a/plugins/check_ups.c
+++ b/plugins/check_ups.c
textdomain (PACKAGE);
ups_status = strdup ("N/A");
+ data = strdup ("");
if (process_arguments (argc, argv) != OK)
usage ("Invalid command arguments supplied\n");
else if (check_warn==TRUE && ups_utility_deviation>=warning_value) {
result = max_state (result, STATE_WARNING);
}
- asprintf (&data, "%s ",
+ asprintf (&data, "%s",
perfdata ("voltage", (long)(1000*ups_utility_voltage), "mV",
check_warn, (long)(1000*warning_value),
check_crit, (long)(1000*critical_value),
TRUE, 0, FALSE, 0));
} else {
- asprintf (&data, "%s ",
+ asprintf (&data, "%s",
perfdata ("voltage", (long)(1000*ups_utility_voltage), "mV",
FALSE, 0, FALSE, 0, TRUE, 0, FALSE, 0));
}
else if (check_warn==TRUE && ups_battery_percent<=warning_value) {
result = max_state (result, STATE_WARNING);
}
- asprintf (&data, "%s ",
+ asprintf (&data, "%s %s", data,
perfdata ("battery", (long)ups_battery_percent, "%",
check_warn, (long)(1000*warning_value),
check_crit, (long)(1000*critical_value),
TRUE, 0, TRUE, 100));
} else {
- asprintf (&data, "%s ",
+ asprintf (&data, "%s %s", data,
perfdata ("battery", (long)ups_battery_percent, "%",
FALSE, 0, FALSE, 0, TRUE, 0, TRUE, 100));
}
else if (check_warn==TRUE && ups_load_percent>=warning_value) {
result = max_state (result, STATE_WARNING);
}
- asprintf (&data, "%s ",
+ asprintf (&data, "%s %s", data,
perfdata ("load", (long)ups_load_percent, "%",
check_warn, (long)(1000*warning_value),
check_crit, (long)(1000*critical_value),
TRUE, 0, TRUE, 100));
} else {
- asprintf (&data, "%s ",
+ asprintf (&data, "%s %s", data,
perfdata ("load", (long)ups_load_percent, "%",
FALSE, 0, FALSE, 0, TRUE, 0, TRUE, 100));
}
else if (check_warn == TRUE && ups_temperature>=warning_value) {
result = max_state (result, STATE_WARNING);
}
- asprintf (&data, "%s ",
+ asprintf (&data, "%s %s", data,
perfdata ("temp", (long)ups_temperature, "degF",
check_warn, (long)(1000*warning_value),
check_crit, (long)(1000*critical_value),
TRUE, 0, FALSE, 0));
} else {
- asprintf (&data, "%s ",
+ asprintf (&data, "%s %s", data,
perfdata ("temp", (long)ups_temperature, "degF",
FALSE, 0, FALSE, 0, TRUE, 0, FALSE, 0));
}