summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 95c6a6d)
raw | patch | inline | side by side (parent: 95c6a6d)
author | Karl DeBisschop <kdebisschop@users.sourceforge.net> | |
Wed, 12 Nov 2003 06:05:38 +0000 (06:05 +0000) | ||
committer | Karl DeBisschop <kdebisschop@users.sourceforge.net> | |
Wed, 12 Nov 2003 06:05:38 +0000 (06:05 +0000) |
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@768 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 cb985cab78aca9b2180342e403a0902d39688ef1..750c47ea688db20d299e2df02405c4b8193de136 100644 (file)
--- a/plugins/check_snmp.c
+++ b/plugins/check_snmp.c
/* Test parameters */
case 'c': /* critical time threshold */
- if (strspn (optarg, "0123456789:,") < strlen (optarg)) {
- printf (_("Invalid critical threshold: %s\n"), optarg);
- print_usage ();
- exit (STATE_UNKNOWN);
- }
+ if (strspn (optarg, "0123456789:,") < strlen (optarg))
+ usage2 (_("Invalid critical threshold: %s\n"), optarg);
for (ptr = optarg; ptr && jj < MAX_OIDS; jj++) {
if (lu_getll (&lower_crit_lim[jj], ptr) == 1)
eval_method[jj] |= CRIT_LT;
}
break;
case 'w': /* warning time threshold */
- if (strspn (optarg, "0123456789:,") < strlen (optarg)) {
- printf (_("Invalid warning threshold: %s\n"), optarg);
- print_usage ();
- exit (STATE_UNKNOWN);
- }
+ if (strspn (optarg, "0123456789:,") < strlen (optarg))
+ usage2 (_("Invalid warning threshold: %s\n"), optarg);
for (ptr = optarg; ptr && ii < MAX_OIDS; ii++) {
if (lu_getll (&lower_warn_lim[ii], ptr) == 1)
eval_method[ii] |= WARN_LT;
}
labels[nlabels - 1] = optarg;
ptr = thisarg (optarg);
+ labels[nlabels - 1] = ptr;
if (strstr (ptr, "'") == ptr)
labels[nlabels - 1] = ptr + 1;
- else
- labels[nlabels - 1] = ptr;
while (ptr && (ptr = nextarg (ptr))) {
if (nlabels >= labels_size) {
labels_size += 8;
}
unitv[nunits - 1] = optarg;
ptr = thisarg (optarg);
+ unitv[nunits - 1] = ptr;
if (strstr (ptr, "'") == ptr)
unitv[nunits - 1] = ptr + 1;
- else
- unitv[nunits - 1] = ptr;
while (ptr && (ptr = nextarg (ptr))) {
if (nunits >= unitv_size) {
unitv_size += 8;
nextarg (char *str)
{
if (strstr (str, "'") == str) {
+ str[0] = 0;
if (strlen (str) > 1) {
str = strstr (str + 1, "'");
- str[0] = 0;
return (++str);
}
else {
- str[0] = 0;
return NULL;
}
}
if (strstr (str, ",") == str) {
+ str[0] = 0;
if (strlen (str) > 1) {
- str[0] = 0;
return (++str);
}
else {
- str[0] = 0;
return NULL;
}
}