[Nagiosplug-checkins] nagiosplug/plugins check_snmp.c,1.65,1.66
Benoit Mortier
opensides at users.sourceforge.net
Fri Oct 20 01:56:07 CEST 2006
- Previous message: [Nagiosplug-checkins] nagiosplug/plugins check_radius.c, 1.22, 1.23 check_real.c, 1.26, 1.27 check_smtp.c, 1.53, 1.54 check_ssh.c, 1.29, 1.30 check_swap.c, 1.55, 1.56 check_tcp.c, 1.79, 1.80 check_time.c, 1.27, 1.28 check_ups.c, 1.29, 1.30 check_users.c, 1.20, 1.21 negate.c, 1.25, 1.26 urlize.c, 1.20, 1.21
- Next message: [Nagiosplug-checkins] nagiosplug/plugins-root check_dhcp.c, 1.5, 1.6
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
Update of /cvsroot/nagiosplug/nagiosplug/plugins
In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv16303/plugins
Modified Files:
check_snmp.c
Log Message:
adding missing check_snmp
Index: check_snmp.c
===================================================================
RCS file: /cvsroot/nagiosplug/nagiosplug/plugins/check_snmp.c,v
retrieving revision 1.65
retrieving revision 1.66
diff -u -d -r1.65 -r1.66
--- check_snmp.c 19 Oct 2006 19:36:00 -0000 1.65
+++ check_snmp.c 19 Oct 2006 23:56:04 -0000 1.66
@@ -11,6 +11,9 @@
*
* This file contains the check_snmp plugin
*
+* Check status of remote machines and obtain sustem information via SNMP
+*
+*
* License Information:
*
* This program is free software; you can redistribute it and/or modify
@@ -93,8 +96,8 @@
regex_t preg;
regmatch_t pmatch[10];
char timestamp[10] = "";
-char errbuf[MAX_INPUT_BUFFER] = "";
-char perfstr[MAX_INPUT_BUFFER] = "";
+char errbuf[MAX_INPUT_BUFFER];
+char perfstr[MAX_INPUT_BUFFER];
int cflags = REG_EXTENDED | REG_NOSUB | REG_NEWLINE;
int eflags = 0;
int errcode, excode;
@@ -151,7 +154,8 @@
char *ptr = NULL;
char *p2 = NULL;
char *show = NULL;
- char type[8] = "";
+ char type[8];
+ char *str[MAX_INPUT_BUFFER];
setlocale (LC_ALL, "");
bindtextdomain (PACKAGE, LOCALEDIR);
@@ -253,10 +257,6 @@
}
/* We strip out the datatype indicator for PHBs */
-
- /* Clean up type array - Sol10 does not necessarily zero it out */
- bzero(type, sizeof(type));
-
if (strstr (response, "Gauge: "))
show = strstr (response, "Gauge: ") + 7;
else if (strstr (response, "Gauge32: "))
@@ -348,11 +348,8 @@
i++;
- strcat(perfstr, "=");
- strcat(perfstr, show);
- if (type)
- strcat(perfstr, type);
- strcat(perfstr, " ");
+ asprintf(str, "=%s%s;;;; ", show, type ? type : "");
+ strcat(perfstr, *str);
} /* end while (ptr) */
@@ -1002,11 +999,9 @@
print_usage (void)
{
printf (_("Usage:"));
- printf ("%s -H <ip_address> -o <OID> [-w warn_range] [-c crit_range] \n\
- [-C community] [-s string] [-r regex] [-R regexi]\n\
- [-t timeout] [-e retries]\n\
- [-l label] [-u units] [-p port-number] [-d delimiter]\n\
- [-D output-delimiter] [-m miblist] [-P snmp version]\n\
- [-L seclevel] [-U secname] [-a authproto] [-A authpasswd]\n\
- [-X privpasswd]\n", progname);
+ printf ("%s -H <ip_address> -o <OID> [-w warn_range] [-c crit_range]\n",progname);
+ printf ("[-C community] [-s string] [-r regex] [-R regexi] [-t timeout] [-e retries]\n");
+ printf ("[-l label] [-u units] [-p port-number] [-d delimiter] [-D output-delimiter]\n");
+ printf ("[-m miblist] [-P snmp version] [-L seclevel] [-U secname] [-a authproto]\n");
+ printf ("[-A authpasswd] [-X privpasswd]\n");
}
- Previous message: [Nagiosplug-checkins] nagiosplug/plugins check_radius.c, 1.22, 1.23 check_real.c, 1.26, 1.27 check_smtp.c, 1.53, 1.54 check_ssh.c, 1.29, 1.30 check_swap.c, 1.55, 1.56 check_tcp.c, 1.79, 1.80 check_time.c, 1.27, 1.28 check_ups.c, 1.29, 1.30 check_users.c, 1.20, 1.21 negate.c, 1.25, 1.26 urlize.c, 1.20, 1.21
- Next message: [Nagiosplug-checkins] nagiosplug/plugins-root check_dhcp.c, 1.5, 1.6
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
More information about the Commits
mailing list