1 /*****************************************************************************
3 * Monitoring check_dummy plugin
6 * Copyright (c) 1999-2007 Monitoring Plugins Development Team
10 * This file contains the check_dummy plugin
12 * This plugin will simply return the state corresponding to the numeric value
15 * This program is free software: you can redistribute it and/or modify
16 * it under the terms of the GNU General Public License as published by
17 * the Free Software Foundation, either version 3 of the License, or
18 * (at your option) any later version.
20 * This program is distributed in the hope that it will be useful,
21 * but WITHOUT ANY WARRANTY; without even the implied warranty of
22 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23 * GNU General Public License for more details.
25 * You should have received a copy of the GNU General Public License
26 * along with this program. If not, see <http://www.gnu.org/licenses/>.
29 *****************************************************************************/
31 const char *progname
= "check_dummy";
32 const char *copyright
= "1999-2007";
33 const char *email
= "devel@monitoring-plugins.org";
38 void print_help (void);
39 void print_usage (void);
43 main (int argc
, char **argv
)
45 int result
= STATE_UNKNOWN
;
47 setlocale (LC_ALL
, "");
48 bindtextdomain (PACKAGE
, LOCALEDIR
);
52 usage4 (_("Could not parse arguments"));
53 else if (strcmp (argv
[1], "-V") == 0 || strcmp (argv
[1], "--version") == 0) {
54 print_revision (progname
, NP_VERSION
);
57 else if (strcmp (argv
[1], "-h") == 0 || strcmp (argv
[1], "--help") == 0) {
61 else if (!is_integer (argv
[1]))
62 usage4 (_("Arguments to check_dummy must be an integer"));
64 result
= atoi (argv
[1]);
71 printf (_("WARNING"));
74 printf (_("CRITICAL"));
77 printf (_("UNKNOWN"));
80 printf (_("UNKNOWN"));
82 printf (_("Status %d is not a supported error state\n"), result
);
87 printf (": %s", argv
[2]);
99 print_revision (progname
, NP_VERSION
);
101 printf ("Copyright (c) 1999 Ethan Galstad <nagios@nagios.org>\n");
102 printf (COPYRIGHT
, copyright
, email
);
104 printf ("%s\n", _("This plugin will simply return the state corresponding to the numeric value"));
106 printf ("%s\n", _("of the <state> argument with optional text"));
112 printf (UT_HELP_VRSN
);
122 printf ("%s\n", _("Usage:"));
123 printf (" %s <integer state> [optional text]\n", progname
);