1 --- nagios-plugins-2.1.3/plugins/check_hpjd.c~ 2016-09-13 19:59:41.000000000 +0300
2 +++ nagios-plugins-2.1.3/plugins/check_hpjd.c 2016-09-13 20:00:10.839538694 +0300
4 #define DEFAULT_COMMUNITY "public"
5 #define DEFAULT_PORT "161"
7 -const char *option_summary = "-H host [-C community]\n";
8 +const char *option_summary = "-H host [-C community] [-n]\n";
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"
13 char *community = NULL;
19 main (int argc, char **argv)
21 strcpy (errmsg, _("Paper Jam"));
24 - result = STATE_WARNING;
26 + result = STATE_WARNING;
28 strcpy (errmsg, _("Out of Paper"));
30 else if (line_status == OFFLINE) {
32 /* {"critical", required_argument,0,'c'}, */
33 /* {"warning", required_argument,0,'w'}, */
34 {"port", required_argument,0,'p'},
35 + {"nopaperout", no_argument, 0, 'n'},
36 {"version", no_argument, 0, 'V'},
37 {"help", no_argument, 0, 'h'},
43 - c = getopt_long (argc, argv, "+hVH:C:p:", longopts, &option);
44 + c = getopt_long (argc, argv, "+hnVH:C:p:", longopts, &option);
46 if (c == -1 || c == EOF || c == 1)
49 case 'C': /* community */
50 community = strscpy (community, optarg);
52 + case 'n': /* nopaperout */
55 case 'V': /* version */
56 print_revision (progname, revision);
60 printf (" %s\n", "-C, --community=STRING");
61 printf (" %s", _("The SNMP community name "));
62 + printf (" %s\n", "-n, --nopaperout");
63 printf (_("(default=%s)"), DEFAULT_COMMUNITY);
64 + printf (" %s\n", "No return WARNING state on \"Out of paper\"");
71 printf ("%s\n", _("Usage:"));
72 - printf ("%s -H host [-C community] [-p port]\n", progname);
73 + printf ("%s -H host [-C community] [-p port] [-n]\n", progname);