1 /*****************************************************************************
3 * Nagios check_dummy plugin
6 * Copyright (c) 1999-2007 Nagios Plugins Development Team
8 * Last Modified: $Date$
12 * This file contains the check_dummy plugin
14 * This plugin will simply return the state corresponding to the numeric value
17 * This program is free software: you can redistribute it and/or modify
18 * it under the terms of the GNU General Public License as published by
19 * the Free Software Foundation, either version 3 of the License, or
20 * (at your option) any later version.
22 * This program is distributed in the hope that it will be useful,
23 * but WITHOUT ANY WARRANTY; without even the implied warranty of
24 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
25 * GNU General Public License for more details.
27 * You should have received a copy of the GNU General Public License
28 * along with this program. If not, see <http://www.gnu.org/licenses/>.
32 *****************************************************************************/
34 const char *progname
= "check_dummy";
35 const char *revision
= "$Revision$";
36 const char *copyright
= "1999-2007";
37 const char *email
= "nagiosplug-devel@lists.sourceforge.net";
42 void print_help (void);
43 void print_usage (void);
47 main (int argc
, char **argv
)
49 int result
= STATE_UNKNOWN
;
51 setlocale (LC_ALL
, "");
52 bindtextdomain (PACKAGE
, LOCALEDIR
);
56 usage4 (_("Could not parse arguments"));
57 else if (strcmp (argv
[1], "-V") == 0 || strcmp (argv
[1], "--version") == 0) {
58 print_revision (progname
, revision
);
61 else if (strcmp (argv
[1], "-h") == 0 || strcmp (argv
[1], "--help") == 0) {
65 else if (!is_integer (argv
[1]))
66 usage4 (_("Arguments to check_dummy must be an integer"));
68 result
= atoi (argv
[1]);
75 printf (_("WARNING"));
78 printf (_("CRITICAL"));
81 printf (_("UNKNOWN"));
84 printf (_("UNKNOWN"));
86 printf (_("Status %d is not a supported error state\n"), result
);
91 printf (": %s", argv
[2]);
103 print_revision (progname
, revision
);
105 printf ("Copyright (c) 1999 Ethan Galstad <nagios@nagios.org>\n");
106 printf (COPYRIGHT
, copyright
, email
);
108 printf ("%s\n", _("This plugin will simply return the state corresponding to the numeric value"));
110 printf ("%s\n", _("of the <state> argument with optional text"));
116 printf (_(UT_HELP_VRSN
));
118 printf (_(UT_SUPPORT
));
126 printf (_("Usage:"));
127 printf (" %s <integer state> [optional text]\n", progname
);