summaryrefslogtreecommitdiffstats
path: root/web/attachments/24999-check_snmp.patch.txt
diff options
context:
space:
mode:
Diffstat (limited to 'web/attachments/24999-check_snmp.patch.txt')
-rw-r--r--web/attachments/24999-check_snmp.patch.txt124
1 files changed, 124 insertions, 0 deletions
diff --git a/web/attachments/24999-check_snmp.patch.txt b/web/attachments/24999-check_snmp.patch.txt
new file mode 100644
index 0000000..f56dd49
--- /dev/null
+++ b/web/attachments/24999-check_snmp.patch.txt
@@ -0,0 +1,124 @@
1*** check_snmp.c.orig Wed Jun 12 20:13:42 2002
2--- check_snmp.c Wed Jun 12 20:15:07 2002
3*************** int errcode, excode;
4*** 94,99 ****
5--- 94,100 ----
6
7 char *server_address = NULL;
8 char *community = NULL;
9+ char *mibslist = NULL;
10 char oid[MAX_INPUT_BUFFER] = "";
11 char *label = NULL;
12 char *units = NULL;
13*************** main (int argc, char **argv)
14*** 143,152 ****
15 usage ("Incorrect arguments supplied\n");
16
17 /* create the command line to execute */
18! command_line = ssprintf
19! (command_line,
20! "%s -m ALL -v 1 %s %s %s",
21! PATH_TO_SNMPGET, server_address, community, oid);
22
23 /* run the command */
24 child_process = spopen (command_line);
25--- 144,159 ----
26 usage ("Incorrect arguments supplied\n");
27
28 /* create the command line to execute */
29! if (mibslist == NULL)
30! command_line = ssprintf
31! (command_line,
32! "%s -v 1 %s %s %s",
33! PATH_TO_SNMPGET, server_address, community, oid);
34! else
35! command_line = ssprintf
36! (command_line,
37! "%s -m %s -v 1 %s %s %s",
38! PATH_TO_SNMPGET, mibslist, server_address, community, oid);
39
40 /* run the command */
41 child_process = spopen (command_line);
42*************** call_getopt (int argc, char **argv)
43*** 368,373 ****
44--- 375,381 ----
45 {"warning", required_argument, 0, 'w'},
46 {"hostname", required_argument, 0, 'H'},
47 {"community", required_argument, 0, 'C'},
48+ {"mibslist", required_argument, 0, 'm'},
49 {"oid", required_argument, 0, 'o'},
50 {"object", required_argument, 0, 'o'},
51 {"delimiter", required_argument, 0, 'd'},
52*************** call_getopt (int argc, char **argv)
53*** 385,394 ****
54 while (1) {
55 #ifdef HAVE_GETOPT_H
56 c =
57! getopt_long (argc, argv, "+?hVt:c:w:H:C:o:d:D:s:R:r:l:u:",
58 long_options, &option_index);
59 #else
60! c = getopt (argc, argv, "+?hVt:c:w:H:C:o:d:D:s:R:r:l:u:");
61 #endif
62
63 if (c == -1 || c == EOF)
64--- 393,402 ----
65 while (1) {
66 #ifdef HAVE_GETOPT_H
67 c =
68! getopt_long (argc, argv, "+?hVt:c:w:H:C:m:o:d:D:s:R:r:l:u:",
69 long_options, &option_index);
70 #else
71! c = getopt (argc, argv, "+?hVt:c:w:H:C:m:o:d:D:s:R:r:l:u:");
72 #endif
73
74 if (c == -1 || c == EOF)
75*************** call_getopt (int argc, char **argv)
76*** 401,406 ****
77--- 409,415 ----
78 case 'w':
79 case 'H':
80 case 'C':
81+ case 'm':
82 case 'o':
83 case 'd':
84 case 'D':
85*************** call_getopt (int argc, char **argv)
86*** 466,471 ****
87--- 475,483 ----
88 case 'C': /* group or community */
89 community = strscpy (community, optarg);
90 break;
91+ case 'm': /* mibs list */
92+ mibslist = strscpy (mibslist, optarg);
93+ break;
94 case 'o': /* object identifier */
95 for (ptr = optarg; (ptr = index (ptr, ',')); ptr++)
96 ptr[0] = ' ';
97*************** void
98*** 577,583 ****
99 print_usage (void)
100 {
101 printf
102! ("Usage: check_snmp -H <ip_address> -o <OID> [-w warn_range] [-c crit_range] \n"
103 " [-C community] [-s string] [-r regex] [-R regexi] [-t timeout]\n"
104 " [-l label] [-u units] [-d delimiter] [-D output-delimiter]\n"
105 " check_snmp --help\n" " check_snmp --version\n");
106--- 589,595 ----
107 print_usage (void)
108 {
109 printf
110! ("Usage: check_snmp -m <mibs_list> -H <ip_address> -o <OID> [-w warn_range] [-c crit_range] \n"
111 " [-C community] [-s string] [-r regex] [-R regexi] [-t timeout]\n"
112 " [-l label] [-u units] [-d delimiter] [-D output-delimiter]\n"
113 " check_snmp --help\n" " check_snmp --version\n");
114*************** print_help (char *cmd)
115*** 595,600 ****
116--- 607,614 ----
117 " Print detailed help screen\n"
118 " -V, --version\n"
119 " Print version information\n"
120+ " -m, --mibslist=STRING\n"
121+ " Specify which mibs to use (defaults to default mib list)\n"
122 " -H, --hostname=HOST\n"
123 " Name or IP address of the device you wish to query\n"
124 " -o, --oid=OID(s)\n"