diff options
Diffstat (limited to 'web/attachments/394815-woo')
| -rw-r--r-- | web/attachments/394815-woo | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/web/attachments/394815-woo b/web/attachments/394815-woo new file mode 100644 index 0000000..352f7de --- /dev/null +++ b/web/attachments/394815-woo | |||
| @@ -0,0 +1,49 @@ | |||
| 1 | --- orig/plugins/check_hpjd.c 2010-07-27 21:47:16.000000000 +0100 | ||
| 2 | +++ new/plugins/check_hpjd.c 2010-11-30 12:25:56.000000000 +0000 | ||
| 3 | @@ -41,7 +41,7 @@ | ||
| 4 | #define DEFAULT_COMMUNITY "public" | ||
| 5 | |||
| 6 | |||
| 7 | -const char *option_summary = "-H host [-C community]\n"; | ||
| 8 | +const char *option_summary = "-H host [-C community] [-p port]\n"; | ||
| 9 | |||
| 10 | #define HPJD_LINE_STATUS ".1.3.6.1.4.1.11.2.3.9.1.1.2.1" | ||
| 11 | #define HPJD_PAPER_STATUS ".1.3.6.1.4.1.11.2.3.9.1.1.2.2" | ||
| 12 | @@ -66,6 +66,7 @@ | ||
| 13 | |||
| 14 | char *community = NULL; | ||
| 15 | char *address = NULL; | ||
| 16 | +short port = 161; | ||
| 17 | |||
| 18 | int | ||
| 19 | main (int argc, char **argv) | ||
| 20 | @@ -119,8 +120,8 @@ | ||
| 21 | HPJD_GD_DOOR_OPEN, HPJD_GD_PAPER_OUTPUT, HPJD_GD_STATUS_DISPLAY); | ||
| 22 | |||
| 23 | /* get the command to run */ | ||
| 24 | - sprintf (command_line, "%s -OQa -m : -v 1 -c %s %s %s", PATH_TO_SNMPGET, community, | ||
| 25 | - address, query_string); | ||
| 26 | + sprintf (command_line, "%s -OQa -m : -v 1 -c %s %s:%hd %s", PATH_TO_SNMPGET, community, | ||
| 27 | + address, port, query_string); | ||
| 28 | |||
| 29 | /* run the command */ | ||
| 30 | child_process = spopen (command_line); | ||
| 31 | @@ -324,7 +325,7 @@ | ||
| 32 | |||
| 33 | |||
| 34 | while (1) { | ||
| 35 | - c = getopt_long (argc, argv, "+hVH:C:", longopts, &option); | ||
| 36 | + c = getopt_long (argc, argv, "+hVH:C:p:", longopts, &option); | ||
| 37 | |||
| 38 | if (c == -1 || c == EOF || c == 1) | ||
| 39 | break; | ||
| 40 | @@ -347,6 +348,9 @@ | ||
| 41 | case 'h': /* help */ | ||
| 42 | print_help (); | ||
| 43 | exit (STATE_OK); | ||
| 44 | + case 'p': /* port */ | ||
| 45 | + port = (short) atoi(optarg); | ||
| 46 | + break; | ||
| 47 | case '?': /* help */ | ||
| 48 | usage5 (); | ||
| 49 | } | ||
