1 /*****************************************************************************
3 * Monitoring check_dummy plugin
6 * Copyright (c) 1999-2024 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-2024";
33 const char *email
= "devel@monitoring-plugins.org";
38 static void print_help(void);
39 void print_usage(void);
41 int main(int argc
, char **argv
) {
42 int result
= STATE_UNKNOWN
;
44 setlocale(LC_ALL
, "");
45 bindtextdomain(PACKAGE
, LOCALEDIR
);
49 usage4(_("Could not parse arguments"));
50 else if (strcmp(argv
[1], "-V") == 0 || strcmp(argv
[1], "--version") == 0) {
51 print_revision(progname
, NP_VERSION
);
53 } else if (strcmp(argv
[1], "-h") == 0 || strcmp(argv
[1], "--help") == 0) {
56 } else if (!is_integer(argv
[1]))
57 usage4(_("Arguments to check_dummy must be an integer"));
59 result
= atoi(argv
[1]);
69 printf(_("CRITICAL"));
77 printf(_("Status %d is not a supported error state\n"), result
);
82 printf(": %s", argv
[2]);
89 void print_help(void) {
90 print_revision(progname
, NP_VERSION
);
92 printf("Copyright (c) 1999 Ethan Galstad <nagios@nagios.org>\n");
93 printf(COPYRIGHT
, copyright
, email
);
95 printf("%s\n", _("This plugin will simply return the state corresponding to the numeric value"));
97 printf("%s\n", _("of the <state> argument with optional text"));
103 printf(UT_HELP_VRSN
);
108 void print_usage(void) {
109 printf("%s\n", _("Usage:"));
110 printf(" %s <integer state> [optional text]\n", progname
);