summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 93ac456)
raw | patch | inline | side by side (parent: 93ac456)
author | Karl DeBisschop <kdebisschop@users.sourceforge.net> | |
Sun, 20 Oct 2002 18:49:00 +0000 (18:49 +0000) | ||
committer | Karl DeBisschop <kdebisschop@users.sourceforge.net> | |
Sun, 20 Oct 2002 18:49:00 +0000 (18:49 +0000) |
back out change at line 225 in r1.4
(values were mismatched to format string, so output was nonsense)
(I left a comment showing a construct that should work, but it fails for PHBs:
if my disk gets nearly full, they want 'CRITICAL - 99%' not 'CRITICAL - Gauge32: 99')
(If someine has a rationale for the change, maybe it could be done as an option? - it seems
fairly clear that the Web display should be sensible to PHBs so long as there's no real loss)
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@143 f882894a-f735-0410-b71e-b25c423dba1c
(values were mismatched to format string, so output was nonsense)
(I left a comment showing a construct that should work, but it fails for PHBs:
if my disk gets nearly full, they want 'CRITICAL - 99%' not 'CRITICAL - Gauge32: 99')
(If someine has a rationale for the change, maybe it could be done as an option? - it seems
fairly clear that the Web display should be sensible to PHBs so long as there's no real loss)
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@143 f882894a-f735-0410-b71e-b25c423dba1c
plugins/check_snmp.c | patch | blob | history |
diff --git a/plugins/check_snmp.c b/plugins/check_snmp.c
index eae52ca8777f4b0c6c95c945da3b6a368e7a513f..220be234c6dc0cfddbdfc8292dd554f89367317c 100644 (file)
--- a/plugins/check_snmp.c
+++ b/plugins/check_snmp.c
usage ("Incorrect arguments supplied\n");
/* create the command line to execute */
- command_line = ssprintf
- (command_line,
+ asprintf
+ (&command_line,
"%s -p %s -m ALL -v 1 %s -c %s %s",
PATH_TO_SNMPGET, port, server_address, community, oid);
p2 = strpbrk (p2, "0123456789");
response_value[i] = strtoul (p2, NULL, 10);
iresult = check_num (i);
- /*For consistency- full SNMP response every time */
- show = ssprintf (show, "%d", response);
+ asprintf (&show, "%lu", response_value[i]);
+ /*asprintf (&show, "%s", response); */
}
else if (eval_method[i] & CRIT_STRING) {
result = max_state (result, iresult);
if (nlabels > 1 && i < nlabels && labels[i] != NULL)
- outbuff = ssprintf
- (outbuff,
+ asprintf
+ (&outbuff,
"%s%s%s %s%s%s",
outbuff,
(i == 0) ? " " : output_delim,
labels[i], mark (iresult), show, mark (iresult));
else
- outbuff = ssprintf
- (outbuff,
- "%s%s%s%s%s",
- outbuff,
+ asprintf (&outbuff, "%s%s%s%s%s", outbuff,
(i == 0) ? " " : output_delim, mark (iresult), show, mark (iresult));
if (nunits > 0 && i < nunits)
- outbuff = ssprintf (outbuff, "%s %s", outbuff, unitv[i]);
+ asprintf (&outbuff, "%s %s", outbuff, unitv[i]);
i++;