index f1568d5a393f81aa7769d4bbe1c79346ff428f8f..013858863f10d89b2925ea3183b3eaca1e0bcad9 100644 (file)
--- a/plugins/check_cluster.c
+++ b/plugins/check_cluster.c
/*****************************************************************************
- *
- * CHECK_CLUSTER2.C - Host and Service Cluster Plugin for Nagios 2.x
- *
- * Copyright (c) 2000-2004 Ethan Galstad (nagios@nagios.org)
- * Copyright (c) 2007 nagios-plugins team
- * License: GPL
- * Last Modified: $Date$
- *
- * License Information:
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- * $Id$
- *
-******************************************************************************/
+*
+* check_cluster.c - Host and Service Cluster Plugin for Nagios 2.x
+*
+* License: GPL
+* Copyright (c) 2000-2004 Ethan Galstad (nagios@nagios.org)
+* Copyright (c) 2007 Nagios Plugins Development Team
+*
+* This program is free software: you can redistribute it and/or modify
+* it under the terms of the GNU General Public License as published by
+* the Free Software Foundation, either version 3 of the License, or
+* (at your option) any later version.
+*
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU General Public License for more details.
+*
+* You should have received a copy of the GNU General Public License
+* along with this program. If not, see <http://www.gnu.org/licenses/>.
+*
+*
+*****************************************************************************/
const char *progname = "check_cluster";
-const char *revision = "$Revision$";
-const char *copyright = "2007";
+const char *copyright = "2000-2007";
const char *email = "nagiosplug-devel@lists.sourceforge.net";
#include "common.h"
int return_code=STATE_OK;
thresholds *thresholds = NULL;
+ setlocale (LC_ALL, "");
+ bindtextdomain (PACKAGE, LOCALEDIR);
+ textdomain (PACKAGE);
+
+ /* Parse extra opts if any */
+ argv=np_extra_opts(&argc, argv, progname);
+
if(process_arguments(argc,argv)==ERROR)
usage(_("Could not parse arguments"));
}
}
}
-
+
/* return the status of the cluster */
if(check_type==CHECK_SERVICES){
int process_arguments(int argc, char **argv){
int c;
int option=0;
- static struct option longopts[]={
+ static struct option longopts[]={
{"data", required_argument,0,'d'},
{"warning", required_argument,0,'w'},
{"critical", required_argument,0,'c'},
break;
case 'V': /* version */
- print_revision (progname, revision);
+ print_revision (progname, NP_VERSION);
exit (STATE_OK);
break;
void
print_help(void)
{
- print_revision(progname, revision);
+ print_revision(progname, NP_VERSION);
printf ("Copyright (c) 2000-2004 Ethan Galstad (nagios@nagios.org)\n");
printf(COPYRIGHT, copyright, email);
printf("\n");
printf("%s\n", _("Options:"));
+ printf(_(UT_EXTRA_OPTS));
printf (" %s\n", "-s, --service");
printf (" %s\n", _("Check service cluster status"));
printf (" %s\n", "-h, --host");
printf (" %s\n", _("non-OK state in order to return a WARNING status level"));
printf (" %s\n", "-c, --critical=THRESHOLD");
printf (" %s\n", _("Specifies the range of hosts or services in cluster that must be in a"));
- printf (" %s\n", _(" non-OK state in order to return a CRITICAL status level"));
+ printf (" %s\n", _("non-OK state in order to return a CRITICAL status level"));
printf (" %s\n", "-d, --data=LIST");
printf (" %s\n", _("The status codes of the hosts or services in the cluster, separated by"));
printf (" %s\n", _("commas"));
printf("\n");
printf("%s\n", _("Notes:"));
- printf(" %s\n", _("See:"));
- printf(" %s\n", ("http://nagiosplug.sourceforge.net/developer-guidelines.html#THRESHOLDFORMAT"));
- printf(" %s\n", _("for THRESHOLD format and examples."));
+ printf(_(UT_THRESHOLDS_NOTES));
+#ifdef NP_EXTRA_OPTS
+ printf ("\n");
+ printf (_(UT_EXTRA_OPTS_NOTES));
+#endif
printf(_(UT_SUPPORT));
- printf("\n");
}