1 /******************************************************************************
3 * Nagios check_dummy plugin
6 * Copyright (c) 1999-2006 nagios-plugins 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 * License Information:
19 * This program is free software; you can redistribute it and/or modify
20 * it under the terms of the GNU General Public License as published by
21 * the Free Software Foundation; either version 2 of the License, or
22 * (at your option) any later version.
24 * This program is distributed in the hope that it will be useful,
25 * but WITHOUT ANY WARRANTY; without even the implied warranty of
26 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
27 * GNU General Public License for more details.
29 * You should have received a copy of the GNU General Public License
30 * along with this program; if not, write to the Free Software
31 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
35 ******************************************************************************/
37 const char *progname
= "check_dummy";
38 const char *revision
= "$Revision$";
39 const char *copyright
= "1999-2006";
40 const char *email
= "nagiosplug-devel@lists.sourceforge.net";
45 void print_help (void);
46 void print_usage (void);
50 main (int argc
, char **argv
)
52 int result
= STATE_UNKNOWN
;
54 setlocale (LC_ALL
, "");
55 bindtextdomain (PACKAGE
, LOCALEDIR
);
59 usage4 (_("Could not parse arguments"));
60 else if (strcmp (argv
[1], "-V") == 0 || strcmp (argv
[1], "--version") == 0) {
61 print_revision (progname
, revision
);
64 else if (strcmp (argv
[1], "-h") == 0 || strcmp (argv
[1], "--help") == 0) {
68 else if (!is_integer (argv
[1]))
69 usage4 (_("Arguments to check_dummy must be an integer"));
71 result
= atoi (argv
[1]);
78 printf (_("WARNING"));
81 printf (_("CRITICAL"));
84 printf (_("UNKNOWN"));
87 printf (_("UNKNOWN"));
89 printf (_("Status %d is not a supported error state\n"), result
);
94 printf (": %s", argv
[2]);
106 print_revision (progname
, revision
);
108 printf ("Copyright (c) 1999 Ethan Galstad <nagios@nagios.org>\n");
109 printf (COPYRIGHT
, copyright
, email
);
111 printf ("%s\n", _("This plugin will simply return the state corresponding to the numeric value"));
113 printf ("%s\n", _("of the <state> argument with optional text"));
119 printf (_(UT_HELP_VRSN
));
121 printf (_(UT_SUPPORT
));
129 printf (_("Usage:"));
130 printf (" %s <integer state> [optional text]\n", progname
);