summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: cbbfed3)
raw | patch | inline | side by side (parent: cbbfed3)
author | Benoit Mortier <opensides@users.sourceforge.net> | |
Sun, 18 Jun 2006 19:36:48 +0000 (19:36 +0000) | ||
committer | Benoit Mortier <opensides@users.sourceforge.net> | |
Sun, 18 Jun 2006 19:36:48 +0000 (19:36 +0000) |
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1434 f882894a-f735-0410-b71e-b25c423dba1c
14 files changed:
diff --git a/plugins/check_disk.c b/plugins/check_disk.c
index 001800b1b55ed5abd9887832b6074a807aa14e8a..8a824c1f8dc4554dc9c1a774fe100374278c5f70 100644 (file)
--- a/plugins/check_disk.c
+++ b/plugins/check_disk.c
/******************************************************************************
-
- The Nagios Plugins are free software; you can redistribute them
- and/or modify them 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$
-
+*
+* Nagios check_disk plugin
+*
+* License: GPL
+* Copyright (c) 1999-2006 nagios-plugins team
+*
+* Last Modified: $Date$
+*
+* Description:
+*
+* This file contains the check_disk plugin
+*
+* 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$
+*
*****************************************************************************/
const char *progname = "check_disk";
const char *program_name = "check_disk"; /* Required for coreutils libs */
const char *revision = "$Revision$";
-const char *copyright = "1999-2005";
+const char *copyright = "1999-2006";
const char *email = "nagiosplug-devel@lists.sourceforge.net";
/*
printf ("Copyright (c) 1999 Ethan Galstad <nagios@nagios.org>\n");
printf (COPYRIGHT, copyright, email);
- printf (_("This plugin checks the amount of used disk space on a mounted file system"));
- printf (_("and generates an alert if free space is less than one of the threshold values"));
+ printf ("%s\n", _("This plugin checks the amount of used disk space on a mounted file system"));
+ printf ("%s\n", _("and generates an alert if free space is less than one of the threshold values"));
printf ("\n\n");
diff --git a/plugins/check_time.c b/plugins/check_time.c
index ff94d9b3a3a94bcb4f0ed763ad645e10149d2110..84cdcd531bdb5cd5451a2ec20f41ce0359527af4 100644 (file)
--- a/plugins/check_time.c
+++ b/plugins/check_time.c
/******************************************************************************
-
- 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$
-
+*
+* Nagios check_time plugin
+*
+* License: GPL
+* Copyright (c) 1999-2006 nagios-plugins team
+*
+* Last Modified: $Date$
+*
+* Description:
+*
+* This file contains the check_time plugin
+*
+* 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$
+*
******************************************************************************/
const char *progname = "check_time";
const char *revision = "$Revision$";
-const char *copyright = "1999-2004";
+const char *copyright = "1999-2006";
const char *email = "nagiosplug-devel@lists.sourceforge.net";
#include "common.h"
printf ("Copyright (c) 1999 Ethan Galstad\n");
printf (COPYRIGHT, copyright, email);
- printf (_("This plugin will check the time on the specified host.\n\n"));
+ printf ("%s\n", _("This plugin will check the time on the specified host."));
+
+ printf ("\n\n");
print_usage ();
printf (_(UT_HOST_PORT), 'p', myport);
- printf (_("\
- -u, --udp\n\
- Use UDP to connect, not TCP\n\
- -w, --warning-variance=INTEGER\n\
- Time difference (sec.) necessary to result in a warning status\n\
- -c, --critical-variance=INTEGER\n\
- Time difference (sec.) necessary to result in a critical status\n\
- -W, --warning-connect=INTEGER\n\
- Response time (sec.) necessary to result in warning status\n\
- -C, --critical-connect=INTEGER\n\
- Response time (sec.) necessary to result in critical status\n"));
+ printf (" %s\n", "-u, --udp");
+ printf (" %s\n", _("Use UDP to connect, not TCP"));
+ printf (" %s\n", "-w, --warning-variance=INTEGER");
+ printf (" %s\n", _("Time difference (sec.) necessary to result in a warning status"));
+ printf (" %s\n", "-c, --critical-variance=INTEGER");
+ printf (" %s\n", _("Time difference (sec.) necessary to result in a critical status"));
+ printf (" %s\n", "-W, --warning-connect=INTEGER");
+ printf (" %s\n", _("Response time (sec.) necessary to result in warning status"));
+ printf (" %s\n", "-C, --critical-connect=INTEGER");
+ printf (" %s\n", _("Response time (sec.) necessary to result in critical status"));
printf (_(UT_TIMEOUT), DEFAULT_SOCKET_TIMEOUT);
-
printf (_(UT_SUPPORT));
}
void
print_usage (void)
{
- printf ("\
-Usage: %s -H <host_address> [-p port] [-u] [-w variance] [-c variance]\n\
- [-W connect_time] [-C connect_time] [-t timeout]\n", progname);
+ printf (_("Usage:"));
+ printf ("%s -H <host_address> [-p port] [-u] [-w variance] [-c variance]\n",progname);
+ printf (" [-W connect_time] [-C connect_time] [-t timeout]\n");
}
diff --git a/plugins/check_udp.c b/plugins/check_udp.c
index e7d5280cba0c64fc3387266aac43d2e64dc2b095..a712871c70060295057c6f3cabfe8dc0e3a5d6e9 100644 (file)
--- a/plugins/check_udp.c
+++ b/plugins/check_udp.c
/******************************************************************************
-
- 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$
-
+*
+* Nagios check_udp plugin
+*
+* License: GPL
+* Copyright (c) 1999-2006 nagios-plugins team
+*
+* Last Modified: $Date$
+*
+* Description:
+*
+* This file contains the check_udp plugin
+*
+* 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$
+*
*****************************************************************************/
const char *progname = "check_udp";
const char *revision = "$Revision$";
-const char *copyright = "1999-2004";
+const char *copyright = "1999-2006";
const char *email = "nagiosplug-devel@lists.sourceforge.net";
#include "common.h"
printf ("Copyright (c) 1999 Ethan Galstad\n");
printf (COPYRIGHT, copyright, email);
- printf (_("\
- This plugin tests an UDP connection with the specified host.\n\n"));
+ printf ("%s\n", _("This plugin tests an UDP connection with the specified host."));
+
+ printf ("\n\n");
print_usage ();
printf (_(UT_HOST_PORT), 'p', "none");
- printf (_("\
- -e, --expect=STRING <optional>\n\
- String to expect in first line of server response\n\
- -s, --send=STRING <optional>\n\
- String to send to the server when initiating the connection\n"));
+ printf (" %s\n", "-e, --expect=STRING <optional>");
+ printf (" %s\n", _("String to expect in first line of server response"));
+ printf (" %s\n", "-s, --send=STRING <optional>");
+ printf (" %s\n", _("String to send to the server when initiating the connection"));
printf (_(UT_WARN_CRIT));
printf (_(UT_VERBOSE));
- printf (_("\
-This plugin will attempt to connect to the specified port on the host.\n\
-Successful connects return STATE_OK, refusals and timeouts return\n\
-STATE_CRITICAL, other errors return STATE_UNKNOWN.\n\n"));
-
+ printf ("%s\n", _("This plugin will attempt to connect to the specified port on the host."));
+ printf (" %s\n", _("Successful connects return STATE_OK, refusals and timeouts return"));
+ printf (" %s\n", _("STATE_CRITICAL, other errors return STATE_UNKNOWN."));
+
printf(_(UT_SUPPORT));
}
void
print_usage (void)
{
- printf ("\
-Usage: %s -H <host_address> [-p port] [-w warn_time] [-c crit_time]\n\
- [-e expect] [-s send] [-t to_sec] [-v]\n", progname);
+ printf (_("Usage:"));
+ printf ("%s -H <host_address> [-p port] [-w warn_time] [-c crit_time]\n", progname);
+ printf (" [-e expect] [-s send] [-t to_sec] [-v]\n");
}
diff --git a/plugins/check_ups.c b/plugins/check_ups.c
index 786cedcc1bc2ef02a5fa12b707efd8e6bbc340d8..110ea0a2bc2bf58530975d534dae962fc970d317 100644 (file)
--- a/plugins/check_ups.c
+++ b/plugins/check_ups.c
/******************************************************************************
-
- check_ups
-
- Program: Network UPS Tools plugin for Nagios
- License: GPL
- Copyright (c) 2000 Tom Shields
- 2004 Alain Richard <alain.richard@equation.fr>
- 2004 Arnaud Quette <arnaud.quette@mgeups.com>
-
-
- 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$
-
+*
+* Nagios check_ups plugin
+*
+* License: GPL
+* Copyright (c) 2000 Tom Shields
+* 2004 Alain Richard <alain.richard@equation.fr>
+* 2004 Arnaud Quette <arnaud.quette@mgeups.com>
+* Copyright (c) 2002-2006 nagios-plugins team
+*
+* Last Modified: $Date$
+*
+* Description:
+*
+* This file contains Network UPS Tools plugin for Nagios
+*
+* 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$
+*
******************************************************************************/
const char *progname = "check_ups";
const char *revision = "$Revision$";
-const char *copyright = "2000-2004";
+const char *copyright = "2000-2006";
const char *email = "nagiosplug-devel@lists.sourceforge.net";
#include "common.h"
res=get_ups_variable ("ups.status", recv_buffer, sizeof (recv_buffer));
if (res == NOSUCHVAR) return OK;
if (res != STATE_OK) {
- printf (_("Invalid response received from host\n"));
+ printf ("%s\n", _("Invalid response received from host"));
return ERROR;
}
if (process_tcp_request
(server_address, server_port, send_buffer, temp_buffer,
sizeof (temp_buffer)) != STATE_OK) {
- printf (_("Invalid response received from host\n"));
+ printf ("%s\n", _("Invalid response received from host"));
return ERROR;
}
}
if (strcmp (ptr, "ERR DATA-STALE") == 0) {
- printf (_("CRITICAL - UPS data is stale\n"));
+ printf ("%s\n", _("CRITICAL - UPS data is stale"));
return ERROR;
}
ptr = temp_buffer + strlen (varname) + strlen (ups_name) + 6;
len = strlen(ptr);
if (len < 2 || ptr[0] != '"' || ptr[len-1] != '"') {
- printf (_("Error: unable to parse variable\n"));
+ printf ("%s\n", _("Error: unable to parse variable"));
return ERROR;
}
strncpy (buf, ptr+1, len - 2);
validate_arguments (void)
{
if (! ups_name) {
- printf (_("Error : no ups indicated\n"));
+ printf ("%s\n", _("Error : no ups indicated"));
return ERROR;
}
return OK;
printf ("Copyright (c) 2004 Arnaud Quette <arnaud.quette@mgeups.com>\n");
printf (COPYRIGHT, copyright, email);
- printf (_("This plugin tests the UPS service on the specified host.\n\
-Network UPS Tools from www.networkupstools.org must be running for this\n\
-plugin to work.\n\n"));
+ printf ("%s\n", _("This plugin tests the UPS service on the specified host.Network UPS Tools "));
+ printf ("%s\n", _("from www.networkupstools.org must be running for thisplugin to work."));
+
+ printf ("\n\n");
print_usage ();
printf (_(UT_HOST_PORT), 'p', myport);
- printf (_("\
- -u, --ups=STRING\n\
- Name of UPS\n"));
-
- printf (_("\
- -T, --temperature\n\
- Output of temperatures in Celsius\n"));
+ printf (" %s\n", "-u, --ups=STRING");
+ printf (" %s\n", _("Name of UPS"));
+ printf (" %s\n", "-T, --temperature");
+ printf (" %s\n", _("Output of temperatures in Celsius"));
printf (_(UT_WARN_CRIT));
printf (_(UT_VERBOSE));
- printf (_("\
-This plugin attempts to determine the status of a UPS (Uninterruptible Power\n\
-Supply) on a local or remote host. If the UPS is online or calibrating, the\n\
-plugin will return an OK state. If the battery is on it will return a WARNING\n\
-state. If the UPS is off or has a low battery the plugin will return a CRITICAL\n\
-state.\n\n"));
-
- printf (_("\
-You may also specify a variable to check [such as temperature, utility voltage,\n\
-battery load, etc.] as well as warning and critical thresholds for the value of\n\
-that variable. If the remote host has multiple UPS that are being monitored you\n\
-will have to use the [ups] option to specify which UPS to check.\n\n"));
-
- printf (_("Notes:\n\n\
-This plugin requires that the UPSD daemon distributed with Russel Kroll's\n\
-Smart UPS Tools be installed on the remote host. If you do not have the\n\
-package installed on your system, you can download it from\n\
-http://www.networkupstools.org\n\n"));
+ printf ("\n");
+ printf ("%s\n", _("Notes:"));
+
+ printf ("%s\n", _("This plugin attempts to determine the status of a UPS (Uninterruptible Power"));
+ printf ("%s\n", _("Supply) on a local or remote host. If the UPS is online or calibrating, the"));
+ printf ("%s\n", _("plugin will return an OK state. If the battery is on it will return a WARNING"));
+ printf ("%s\n", _("state.If the UPS is off or has a low battery the plugin will return a CRITICAL"));
+ printf ("%s\n\n", _("state."));
+
+ printf ("%s\n", _("You may also specify a variable to check [such as temperature, utility voltage,"));
+ printf ("%s\n", _("battery load, etc.] as well as warning and critical thresholds for the value of"));
+ printf ("%s\n", _("that variable. If the remote host has multiple UPS that are being monitored you"));
+ printf ("%s\n", _("will have to use the [ups] option to specify which UPS to check."));
+
+ printf ("%s\n", _("This plugin requires that the UPSD daemon distributed with Russel Kroll's"));
+ printf ("%s\n", _("Smart UPS Tools be installed on the remote host. If you do not have the"));
+ printf ("%s\n", _("package installed on your system, you can download it from http://www.networkupstools.org"));
printf (_(UT_SUPPORT));
}
void
print_usage (void)
{
- printf ("\
-Usage: %s -H host -u ups [-p port] [-v variable]\n\
- [-wv warn_value] [-cv crit_value] [-to to_sec] [-T]\n", progname);
+ printf (_("Usage:"));
+ printf ("%s -H host -u ups [-p port] [-v variable] [-w warn_value] [-c crit_value] [-to to_sec] [-T]\n", progname);
}
diff --git a/plugins/check_users.c b/plugins/check_users.c
index 25d04ed0b02de0d58a8b24bba49ba64e0fdaf6b4..34d4775220eddc47ab4ee4d08fc8369c29f035c1 100644 (file)
--- a/plugins/check_users.c
+++ b/plugins/check_users.c
-/*****************************************************************************
-
- 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$
-
+/******************************************************************************
+*
+* Nagios check_users plugin
+*
+* License: GPL
+* Copyright (c) 2002-2006 nagios-plugins team
+*
+* Last Modified: $Date$
+*
+* Description:
+*
+* This file contains the check_users plugin
+*
+* 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$
+*
*****************************************************************************/
const char *progname = "check_users";
const char *revision = "$Revision$";
-const char *copyright = "2000-2004";
+const char *copyright = "2000-2006";
const char *email = "nagiosplug-devel@lists.sourceforge.net";
#include "common.h"
result = STATE_OK;
if (result == STATE_UNKNOWN)
- printf (_("Unable to read output\n"));
+ printf ("%s\n", _("Unable to read output"));
else {
asprintf(&perf, "%s", perfdata ("users", users, "",
TRUE, wusers,
printf ("Copyright (c) 1999 Ethan Galstad\n");
printf (COPYRIGHT, copyright, email);
- printf (_("\
-This plugin checks the number of users currently logged in on the local\n\
-system and generates an error if the number exceeds the thresholds specified.\n"));
+ printf ("%s\n", _("This plugin checks the number of users currently logged in on the local"));
+ printf ("%s\n", _("system and generates an error if the number exceeds the thresholds specified."));
+
+ printf ("\n\n");
print_usage ();
printf (_(UT_HELP_VRSN));
- printf (_("\
- -w, --warning=INTEGER\n\
- Set WARNING status if more than INTEGER users are logged in\n\
- -c, --critical=INTEGER\n\
- Set CRITICAL status if more than INTEGER users are logged in\n"));
+ printf (" %s\n", "-w, --warning=INTEGER");
+ printf (" %s\n", _("Set WARNING status if more than INTEGER users are logged in"));
+ printf (" %s\n", "-c, --critical=INTEGER");
+ printf (" %s\n", _("Set CRITICAL status if more than INTEGER users are logged in"));
printf (_(UT_SUPPORT));
}
@@ -211,5 +224,6 @@ system and generates an error if the number exceeds the thresholds specified.\n"
void
print_usage (void)
{
- printf ("Usage: %s -w <users> -c <users>\n", progname);
+ printf (_("Usage:"));
+ printf ("%s -w <users> -c <users>\n", progname);
}
index d1b768bc594bda153372ef5adc03cc25e90f648a..c8f39edcdc8e98e8fed027b06abe67c9d0c3f9e5 100644 (file)
--- a/plugins/gethostbyname.c
+++ b/plugins/gethostbyname.c
-/*
- * This file is a ghastly hack because nobody can agree on
- * gethostbyname_r()'s prototype.
- *
- * Copyright (C) 2001,2002 Brian Stafford <brian@stafford.uklinux.net>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library 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
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- * $Id$
- */
+/******************************************************************************
+*
+* Nagios gethostbyname_r()'s prototype.
+*
+* License: GPL
+* Copyright (C) 2001,2002 Brian Stafford <brian@stafford.uklinux.net>
+*
+* Last Modified: $Date$
+*
+* Description:
+*
+* This file is a ghastly hack because nobody can agree on
+* gethostbyname_r()'s prototype.
+*
+* 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$
+*
+*****************************************************************************/
#ifdef HAVE_CONFIG_H
#include <config.h>
index e420837dd82057590d84735096abcb42a8e3a43b..d95ab26d436a3c05133f879c17e61338caf12393 100644 (file)
--- a/plugins/gethostbyname.h
+++ b/plugins/gethostbyname.h
-/*
- * This file is a ghastly hack because nobody can agree on
- * gethostbyname_r()'s prototype.
- *
- * Copyright (C) 2001,2002 Brian Stafford <brian@stafford.uklinux.net>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library 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
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- * $Id$
- */
+/******************************************************************************
+*
+* Nagios gethostbyname_r()'s prototype.
+*
+* License: GPL
+* Copyright (C) 2001,2002 Brian Stafford <brian@stafford.uklinux.net>
+*
+* Last Modified: $Date$
+*
+* Description:
+*
+* This file is a ghastly hack because nobody can agree on
+* gethostbyname_r()'s prototype.
+*
+* 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$
+*****************************************************************************/
/*************************************************************************
Usage:
diff --git a/plugins/negate.c b/plugins/negate.c
index d08c3a309e30b868cd6dc7a51c0655d48797c5ee..76bb6bbbb7d263693d7e2bfe8ec4d651ba5069cf 100644 (file)
--- a/plugins/negate.c
+++ b/plugins/negate.c
/******************************************************************************
-
- 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$
+*
+* Nagios negate plugin
+*
+* License: GPL
+* Copyright (c) 2002-2006 nagios-plugins team
+*
+* Last Modified: $Date$
+*
+* Description:
+*
+* This file contains the negate plugin
+*
+* 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$
@@-<article>
const char *progname = "negate";
const char *revision = "$Revision$";
-const char *copyright = "2002-2004";
+const char *copyright = "2002-2006";
const char *email = "nagiosplug-devel@lists.sourceforge.net";
#define DEFAULT_TIMEOUT 9
printf (COPYRIGHT, copyright, email);
- printf (_("\
-Negates the status of a plugin (returns OK for CRITICAL, and vice-versa).\n\n"));
+ printf ("%s\n", _("Negates the status of a plugin (returns OK for CRITICAL, and vice-versa)."));
+
+ printf ("\n\n");
print_usage ();
@@ -248,20 +262,20 @@ Negates the status of a plugin (returns OK for CRITICAL, and vice-versa).\n\n"))
printf (_(UT_TIMEOUT), DEFAULT_TIMEOUT);
- printf (_("\
- [keep timeout than the plugin timeout to retain CRITICAL status]\n"));
-
- printf (_("\
- negate \"/usr/local/nagios/libexec/check_ping -H host\"\n\
- Run check_ping and invert result. Must use full path to plugin\n\
- negate \"/usr/local/nagios/libexec/check_procs -a 'vi negate.c'\"\n\
- Use single quotes if you need to retain spaces\n"));
-
- printf (_("\
-This plugin is a wrapper to take the output of another plugin and invert it.\n\
-If the wrapped plugin returns STATE_OK, the wrapper will return STATE_CRITICAL.\n\
-If the wrapped plugin returns STATE_CRITICAL, the wrapper will return STATE_OK.\n\
-Otherwise, the output state of the wrapped plugin is unchanged.\n"));
+ printf (" %s\n", _("[keep timeout than the plugin timeout to retain CRITICAL status]"));
+ printf ("\n");
+ printf ("%s\n", _("Examples:"));
+ printf (" %s\n", "negate \"/usr/local/nagios/libexec/check_ping -H host\"");
+ printf (" %s\n", _("Run check_ping and invert result. Must use full path to plugin"));
+ printf (" %s\n", "negate \"/usr/local/nagios/libexec/check_procs -a 'vi negate.c'\"");
+ printf (" %s\n", _("Use single quotes if you need to retain spaces"));
+ printf (_(UT_VERBOSE));
+ printf ("\n");
+ printf ("%s\n", _("Notes:"));
+ printf ("%s\n", _("This plugin is a wrapper to take the output of another plugin and invert it."));
+ printf ("%s\n", _("If the wrapped plugin returns STATE_OK, the wrapper will return STATE_CRITICAL."));
+ printf ("%s\n", _("If the wrapped plugin returns STATE_CRITICAL, the wrapper will return STATE_OK."));
+ printf ("%s\n", _("Otherwise, the output state of the wrapped plugin is unchanged."));
printf (_(UT_SUPPORT));
}
void
print_usage (void)
{
- printf ("Usage: %s [-t timeout] <definition of wrapped plugin>\n",progname);
+ printf (_("Usage:"));
+ printf ("%s [-t timeout] <definition of wrapped plugin>\n",progname);
}
diff --git a/plugins/netutils.c b/plugins/netutils.c
index b4c3944b4ebbc122c39132b0e44a6bb3834361ff..a3a241d254a81494d8259a33a97ecce851d139a5 100644 (file)
--- a/plugins/netutils.c
+++ b/plugins/netutils.c
send_result = send (sd, send_buffer, strlen (send_buffer), 0);
if (send_result<0 || (size_t)send_result!=strlen(send_buffer)) {
- printf (_("Send failed\n"));
+ printf ("%s\n", _("Send failed"));
result = STATE_WARNING;
}
if (!FD_ISSET (sd, &readfds)) { /* it hasn't */
if (!recv_length) {
strcpy (recv_buffer, "");
- printf (_("No data was received from host!\n"));
+ printf ("%s\n", _("No data was received from host!"));
result = STATE_WARNING;
}
else { /* this one failed, but previous ones worked */
*sd = socket (r->ai_family, socktype, r->ai_protocol);
if (*sd < 0) {
- printf (_("Socket creation failed\n"));
+ printf ("%s\n", _("Socket creation failed"));
freeaddrinfo (r);
return STATE_UNKNOWN;
}
@@ -267,7 +267,7 @@ send_request (int sd, int proto, const char *send_buffer, char *recv_buffer, int
send_result = send (sd, send_buffer, strlen (send_buffer), 0);
if (send_result<0 || (size_t)send_result!=strlen(send_buffer)) {
- printf (_("Send failed\n"));
+ printf ("%s\n", _("Send failed"));
result = STATE_WARNING;
}
@@ -282,7 +282,7 @@ send_request (int sd, int proto, const char *send_buffer, char *recv_buffer, int
/* make sure some data has arrived */
if (!FD_ISSET (sd, &readfds)) {
strcpy (recv_buffer, "");
- printf (_("No data was received from host!\n"));
+ printf ("%s\n", _("No data was received from host!"));
result = STATE_WARNING;
}
@@ -291,7 +291,7 @@ send_request (int sd, int proto, const char *send_buffer, char *recv_buffer, int
if (recv_result == -1) {
strcpy (recv_buffer, "");
if (proto != IPPROTO_TCP)
- printf (_("Receive failed\n"));
+ printf ("%s\n", _("Receive failed"));
result = STATE_WARNING;
}
else
diff --git a/plugins/popen.c b/plugins/popen.c
index 5da12a02fb46a22d7af22bc7fabe9adddc41e7ce..80a7119b983cc711452a3524f77417e1434c8b58 100644 (file)
--- a/plugins/popen.c
+++ b/plugins/popen.c
-/******************************************************************************
- * popen.c
+/****************************************************************************
+ *
+ * Nagios plugins popen
+ *
+ * License: GPL
+ * Copyright (c) 2005 nagios-plugins team
+ *
+ * Last Modified: $Date$
+ *
+ * Description:
*
* A safe alternative to popen
*
* Provides spopen and spclose
-
-FILE * spopen(const char *);
-int spclose(FILE *);
-
+ *
+ * FILE * spopen(const char *);
+ * int spclose(FILE *);
+ *
*
* Code taken with liitle modification from "Advanced Programming for the Unix
* Environment" by W. Richard Stevens
* path passed to the exec'd program are esstially empty. (popen create a shell
* and passes the environment to it).
*
+ * 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$
*
******************************************************************************/
argv = malloc (sizeof(char*)*argc);
if (argv == NULL) {
- printf (_("Could not malloc argv array in popen()\n"));
+ printf ("%s\n", _("Could not malloc argv array in popen()"));
return NULL;
}
str += strspn (str, " \t\r\n"); /* trim any leading whitespace */
if (i >= argc - 2) {
- printf (_("CRITICAL - You need more args!!!\n"));
+ printf ("%s\n",_("CRITICAL - You need more args!!!"));
return (NULL);
}
printf (_("CRITICAL - Plugin timed out after %d seconds\n"),
timeout_interval);
} else {
- printf (_("CRITICAL - popen timeout received, but no child process\n"));
+ printf ("%s\n", _("CRITICAL - popen timeout received, but no child process"));
}
exit (STATE_CRITICAL);
}
diff --git a/plugins/runcmd.c b/plugins/runcmd.c
index bc4ee08dd0b950f4ca887e5b386fc89a3137e8c3..af12d22431010fec84314e3163b79bb4a21e329b 100644 (file)
--- a/plugins/runcmd.c
+++ b/plugins/runcmd.c
-/*
+/****************************************************************************
+ * Nagios run command utilities
+ *
+ * License: GPL
+ * Copyright (c) 2005 nagios-plugins team
+ *
* $Id$
*
+ * Description :
+ *
* A simple interface to executing programs from other programs, using an
* optimized and safe popen()-like implementation. It is considered safe
* in that no shell needs to be spawned and the environment passed to the
* function which isn't is np_runcmd_init() which it doesn't make sense to
* call twice anyway, so the api as a whole should be considered async-safe.
*
+ * 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.
*/
#define NAGIOSPLUG_API_C 1
argv = calloc(sizeof(char *), argc);
if (argv == NULL) {
- printf (_("Could not malloc argv array in popen()\n"));
+ printf ("%s\n", _("Could not malloc argv array in popen()"));
return -1;
}
diff --git a/plugins/sslutils.c b/plugins/sslutils.c
index 66c729956050f7acb964e704d2904f7a216f95e6..09d58b0f2f4c390aaf7358b485dbf8996e55bd7d 100644 (file)
--- a/plugins/sslutils.c
+++ b/plugins/sslutils.c
SSL_load_error_strings ();
OpenSSL_add_all_algorithms();
if ((c = SSL_CTX_new (m)) == NULL) {
- printf (_("CRITICAL - Cannot create SSL context.\n"));
+ printf ("%s\n", _("CRITICAL - Cannot create SSL context."));
return STATE_CRITICAL;
}
if ((s = SSL_new (c)) != NULL){
if (SSL_connect(s) == 1){
return OK;
} else {
- printf (_("CRITICAL - Cannot make SSL connection "));
+ printf ("%s\n", _("CRITICAL - Cannot make SSL connection "));
# ifdef USE_OPENSSL /* XXX look into ERR_error_string */
ERR_print_errors_fp (stdout);
# endif /* USE_OPENSSL */
}
} else {
- printf (_("CRITICAL - Cannot initiate SSL handshake.\n"));
+ printf ("%s\n", _("CRITICAL - Cannot initiate SSL handshake."));
}
return STATE_CRITICAL;
}
certificate=SSL_get_peer_certificate(s);
if(! certificate){
- printf (_("CRITICAL - Cannot retrieve server certificate.\n"));
+ printf ("%s\n",_("CRITICAL - Cannot retrieve server certificate."));
return STATE_CRITICAL;
}
/* Generate tm structure to process timestamp */
if (tm->type == V_ASN1_UTCTIME) {
if (tm->length < 10) {
- printf (_("CRITICAL - Wrong time format in certificate.\n"));
+ printf ("%s\n", _("CRITICAL - Wrong time format in certificate."));
return STATE_CRITICAL;
} else {
stamp.tm_year = (tm->data[0] - '0') * 10 + (tm->data[1] - '0');
}
} else {
if (tm->length < 12) {
- printf (_("CRITICAL - Wrong time format in certificate.\n"));
+ printf ("%s\n", _("CRITICAL - Wrong time format in certificate."));
return STATE_CRITICAL;
} else {
stamp.tm_year =
X509_free (certificate);
return STATE_OK;
# else /* ifndef USE_OPENSSL */
- printf (_("WARNING - Plugin does not support checking certificates.\n"));
+ printf ("%s\n", _("WARNING - Plugin does not support checking certificates."));
return STATE_WARNING;
# endif /* USE_OPENSSL */
}
diff --git a/plugins/urlize.c b/plugins/urlize.c
index 13ab14ee0b1c9d67286dc45e7841d6c852f9cd9c..d4d00dd6e99c9817732eeecffef410f20c726b70 100644 (file)
--- a/plugins/urlize.c
+++ b/plugins/urlize.c
const char *progname = "urlize";
const char *revision = "$Revision$";
-const char *copyright = "2000-2004";
+const char *copyright = "2000-2006";
const char *email = "nagiosplug-devel@lists.sourceforge.net";
#include "common.h"
printf ("Copyright (c) 2000 Karl DeBisschop <kdebisschop@users.sourceforge.net>\n");
printf (COPYRIGHT, copyright, email);
- printf (_("\n\
-This plugin wraps the text output of another command (plugin) in HTML\n\
-<A> tags, thus displaying the plugin output in as a clickable link in\n\
-the Nagios status screen. The return status is the same as the invoked\n\
-plugin.\n\n"));
+ printf ("%s\n", _("This plugin wraps the text output of another command (plugin)"));
+ printf ("%s\n", _("in HTML <A> tags, thus displaying the plugin output in as a clickable link in"));
+ printf ("%s\n", _("the Nagios status screen. The return status is the same as the invoked plugin."));
+
+ printf ("\n\n");
print_usage ();
- printf (_("\n\
-Pay close attention to quoting to ensure that the shell passes the expected\n\
-data to the plugin. For example, in:\n\
-\n\
- urlize http://example.com/ check_http -H example.com -r 'two words'\n\
-\n\
-the shell will remove the single quotes and urlize will see:\n\
-\n\
- urlize http://example.com/ check_http -H example.com -r two words\n\
-\n\
-You probably want:\n\
-\n\
- urlize http://example.com/ \"check_http -H example.com -r 'two words'\"\n"));
+ printf (_(UT_HELP_VRSN));
+
+ printf ("\n");
+ printf ("%s\n", _("Examples:"));
+ printf ("%s\n", _("Pay close attention to quoting to ensure that the shell passes the expected"));
+ printf ("%s\n\n", _("data to the plugin. For example, in:"));
+ printf (" %s\n\n", _("urlize http://example.com/ check_http -H example.com -r 'two words'"));
+ printf (" %s\n", _("the shell will remove the single quotes and urlize will see:"));
+ printf (" %s\n\n", _("urlize http://example.com/ check_http -H example.com -r two words"));
+ printf (" %s\n\n", _("You probably want:"));
+ printf (" %s\n", _("urlize http://example.com/ \"check_http -H example.com -r 'two words'\""));
printf (_(UT_SUPPORT));
}
void
print_usage (void)
{
- printf ("Usage:\n %s <url> <plugin> <arg1> ... <argN>\n", progname);
+ printf (_("Usage:"));
+ printf ("%s <url> <plugin> <arg1> ... <argN>\n", progname);
}
diff --git a/plugins/utils.c b/plugins/utils.c
index f2593a16623688f94a887e3cedeb3f0014e34f15..a455f225cc15a0ff4223dbdde888146ddeebd61d 100644 (file)
--- a/plugins/utils.c
+++ b/plugins/utils.c
@@ -360,7 +360,7 @@ set_thresholds(thresholds **my_thresholds, char *warn_string, char *critical_str
if (_set_thresholds(my_thresholds, warn_string, critical_string) == 0) {
return;
} else {
- usage("Range format incorrect");
+ usage(_("Range format incorrect"));
}
}