1
/*************************************************************
5
* Program: Dummy plugin for Nagios
7
* Copyright (c) 1999 Ethan Galstad (nagios@nagios.org)
9
* Last Modified: $Date: 2003/01/13 12:15:15 $
11
* Command line: CHECK_DUMMY <state>
15
* This plugin will simply return the state corresponding to the
16
* numerical value of the <state> argument.
18
* License Information:
20
* This program is free software; you can redistribute it and/or modify
21
* it under the terms of the GNU General Public License as published by
22
* the Free Software Foundation; either version 2 of the License, or
23
* (at your option) any later version.
25
* This program is distributed in the hope that it will be useful,
26
* but WITHOUT ANY WARRANTY; without even the implied warranty of
27
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
28
* GNU General Public License for more details.
30
* You should have received a copy of the GNU General Public License
31
* along with this program; if not, write to the Free Software
32
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
34
**************************************************************/
40
const char *progname = "check_dummy";
42
void print_help (const char *);
43
void print_usage (const char *);
46
main (int argc, char **argv)
51
printf ("Incorrect number of arguments supplied\n");
54
else if (strcmp (argv[1], "-V") == 0 || strcmp (argv[1], "--version") == 0) {
55
print_revision (argv[0], "$Revision: 1.2 $");
58
else if (strcmp (argv[1], "-h") == 0 || strcmp (argv[1], "--help") == 0) {
62
else if (!is_integer (argv[1])) {
63
print_usage (argv[0]);
66
result = atoi (argv[1]);
70
printf ("Status is OK\n");
73
printf ("Status is at WARNING level\n");
76
printf ("Status is CRITICAL\n");
79
printf ("Status is UNKNOWN\n");
80
result = STATE_UNKNOWN;
87
print_help (const char *cmd)
89
print_revision (cmd, "$Revision: 1.2 $");
90
printf ("Copyright (c) 1999 Ethan Galstad (nagios@nagios.org)\n"
94
("\nThis plugin will simply return the state corresponding to the numeric value\n"
95
"of the <state> argument.\n");
99
print_usage (const char *cmd)
101
printf ("Usage: %s <integer state>\n", cmd);