SOURCES: nagios-plugins-check_hpjd-no-paper-out.patch (NEW) - new option to...
baggins
baggins at pld-linux.org
Fri Dec 5 20:16:33 CET 2008
Author: baggins Date: Fri Dec 5 19:16:33 2008 GMT
Module: SOURCES Tag: HEAD
---- Log message:
- new option to disable out of paper warnings
patch by Marek Marczykowski <marmarek at staszic.waw.pl>
---- Files affected:
SOURCES:
nagios-plugins-check_hpjd-no-paper-out.patch (NONE -> 1.1) (NEW)
---- Diffs:
================================================================
Index: SOURCES/nagios-plugins-check_hpjd-no-paper-out.patch
diff -u /dev/null SOURCES/nagios-plugins-check_hpjd-no-paper-out.patch:1.1
--- /dev/null Fri Dec 5 20:16:34 2008
+++ SOURCES/nagios-plugins-check_hpjd-no-paper-out.patch Fri Dec 5 20:16:28 2008
@@ -0,0 +1,68 @@
+diff -aru nagios-plugins-1.4.13.orig/plugins/check_hpjd.c nagios-plugins-1.4.13/plugins/check_hpjd.c
+--- plugins/check_hpjd.c 2008-05-07 12:02:42.000000000 +0200
++++ plugins/check_hpjd.c 2008-12-05 15:19:10.746605526 +0100
+@@ -70,6 +70,7 @@
+
+ char *community = NULL;
+ char *address = NULL;
++int nopaperout = 0;
+
+ int
+ main (int argc, char **argv)
+@@ -243,7 +244,9 @@
+ strcpy (errmsg, _("Paper Jam"));
+ }
+ else if (paper_out) {
+- result = STATE_WARNING;
++ if (!nopaperout) {
++ result = STATE_WARNING;
++ }
+ strcpy (errmsg, _("Out of Paper"));
+ }
+ else if (line_status == OFFLINE) {
+@@ -318,6 +321,7 @@
+ /* {"critical", required_argument,0,'c'}, */
+ /* {"warning", required_argument,0,'w'}, */
+ /* {"port", required_argument,0,'P'}, */
++ {"nopaperout", no_argument, 0, 'n'},
+ {"version", no_argument, 0, 'V'},
+ {"help", no_argument, 0, 'h'},
+ {0, 0, 0, 0}
+@@ -328,7 +332,7 @@
+
+
+ while (1) {
+- c = getopt_long (argc, argv, "+hVH:C:", longopts, &option);
++ c = getopt_long (argc, argv, "+hnVH:C:", longopts, &option);
+
+ if (c == -1 || c == EOF || c == 1)
+ break;
+@@ -345,6 +349,9 @@
+ case 'C': /* community */
+ community = strscpy (community, optarg);
+ break;
++ case 'n': /* nopaperout */
++ nopaperout = 1;
++ break;
+ case 'V': /* version */
+ print_revision (progname, revision);
+ exit (STATE_OK);
+@@ -404,7 +411,9 @@
+
+ printf (" %s\n", "-C, --community=STRING");
+ printf (" %s", _("The SNMP community name "));
++ printf (" %s\n", "-n, --nopaperout");
+ printf (_("(default=%s)"), DEFAULT_COMMUNITY);
++ printf (" %s\n", "No return WARNING state on \"Out of paper\"");
+ printf ("\n");
+
+ #ifdef NP_EXTRA_OPTS
+@@ -421,6 +430,6 @@
+ void
+ print_usage (void)
+ {
+- printf (_("Usage:"));
+- printf ("%s -H host [-C community]\n", progname);
++ printf (_("Usage:"));
++ printf ("%s -H host [-C community] [-n]\n", progname);
+ }
================================================================
More information about the pld-cvs-commit
mailing list