diff options
author | Kostyantyn Hushchyn <kgushtin@op5.com> | 2010-09-07 14:54:20 +0300 |
---|---|---|
committer | Jacob Hansen <jhansen@op5.com> | 2019-01-04 15:01:28 +0100 |
commit | f79f016238f436b94dfeb04c981de3a6d3e9d31c (patch) | |
tree | f3000e2ad132a5d987ff4f3fc593b273ee021f4d /plugins/check_hpjd.c | |
parent | ac6f101f057caa3083c092537e6dff97328cfd44 (diff) | |
download | monitoring-plugins-f79f016238f436b94dfeb04c981de3a6d3e9d31c.tar.gz |
check_hpjd: Added -D option to disable warning on 'out of paper'
Signed-off-by: Kostyantyn Hushchyn <kgushtin@op5.com>
Diffstat (limited to 'plugins/check_hpjd.c')
-rw-r--r-- | plugins/check_hpjd.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/plugins/check_hpjd.c b/plugins/check_hpjd.c index f159f5a2..65465567 100644 --- a/plugins/check_hpjd.c +++ b/plugins/check_hpjd.c @@ -67,6 +67,7 @@ void print_usage (void); char *community = NULL; char *address = NULL; char *port = NULL; +int check_paper_out = 1; int main (int argc, char **argv) @@ -240,7 +241,8 @@ main (int argc, char **argv) strcpy (errmsg, _("Paper Jam")); } else if (paper_out) { - result = STATE_WARNING; + if (check_paper_out) + result = STATE_WARNING; strcpy (errmsg, _("Out of Paper")); } else if (line_status == OFFLINE) { @@ -325,7 +327,7 @@ process_arguments (int argc, char **argv) while (1) { - c = getopt_long (argc, argv, "+hVH:C:p:", longopts, &option); + c = getopt_long (argc, argv, "+hVH:C:p:D", longopts, &option); if (c == -1 || c == EOF || c == 1) break; @@ -347,6 +349,8 @@ process_arguments (int argc, char **argv) usage2 (_("Port must be a positive short integer"), optarg); else port = atoi(optarg); + case 'D': /* disable paper out check*/ + check_paper_out = 0; break; case 'V': /* version */ print_revision (progname, NP_VERSION); @@ -420,6 +424,8 @@ print_help (void) printf (" %s", _("Specify the port to check ")); printf (_("(default=%s)"), DEFAULT_PORT); printf ("\n"); + printf (" %s\n", "-D"); + printf (" %s", _("Disable paper check ")); printf (UT_SUPPORT); } @@ -430,5 +436,5 @@ void print_usage (void) { printf ("%s\n", _("Usage:")); - printf ("%s -H host [-C community] [-p port]\n", progname); + printf ("%s -H host [-C community] [-p port] [-D]\n", progname); } |