summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 3d88b61)
raw | patch | inline | side by side (parent: 3d88b61)
author | Karl DeBisschop <kdebisschop@users.sourceforge.net> | |
Thu, 7 Nov 2002 14:30:08 +0000 (14:30 +0000) | ||
committer | Karl DeBisschop <kdebisschop@users.sourceforge.net> | |
Thu, 7 Nov 2002 14:30:08 +0000 (14:30 +0000) |
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@171 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 38ce940bfdcc454a87859267d8fbdfa9509ae4ec..4a51a2945bdc4d18cb8eaaf712791955a1f6303b 100644 (file)
--- a/plugins/check_snmp.c
+++ b/plugins/check_snmp.c
char *server_address = NULL;
char *community = NULL;
-char *oid = NULL;
+char *oid = "";
char *label = NULL;
char *units = NULL;
char *port = NULL;
char input_buffer[MAX_INPUT_BUFFER];
char *command_line = NULL;
char *response = NULL;
- char *outbuff = NULL;
+ char *outbuff = "";
char *output = NULL;
char *ptr = NULL;
char *p2 = NULL;
labels = malloc (labels_size);
unitv = malloc (unitv_size);
- outbuff = strscpy (outbuff, "");
for (i = 0; i < MAX_OIDS; i++)
eval_method[i] = CHECK_UNDEF;
i = 0;
usage ("Incorrect arguments supplied\n");
/* create the command line to execute */
- asprintf (&command_line, "%s -p %s -m ALL -v 1 %s -c %s %s",
- PATH_TO_SNMPGET, port, server_address, community, oid);
+ asprintf (&command_line, "%s -m ALL -v 1 -c %s %s:%s %s",
+ PATH_TO_SNMPGET, community, server_address, port, oid);
if (verbose)
printf ("%s\n", command_line);
result = max_state (result, STATE_WARNING);
if (nunits > 0)
- printf ("%s %s -%s\n", label, state_text (result), outbuff);
- else
printf ("%s %s -%s %s\n", label, state_text (result), outbuff, units);
+ else
+ printf ("%s %s -%s\n", label, state_text (result), outbuff);
return result;
}