diff --git a/plugins/utils.c b/plugins/utils.c
index bb380301a639aa899c228725cbe3cf425b7aae42..b9a19d3fe0c2f8f39d0fd1f5c9bfbd30c1279448 100644 (file)
--- a/plugins/utils.c
+++ b/plugins/utils.c
void usage (const char *msg)
{
void usage (const char *msg)
{
- printf ("%s", msg);
+ printf ("%s\n", msg);
print_usage ();
exit (STATE_UNKNOWN);
}
print_usage ();
exit (STATE_UNKNOWN);
}
exit (STATE_UNKNOWN);
}
exit (STATE_UNKNOWN);
}
-
void
void
-support (void)
+usage4 (const char *msg)
{
{
- printf (_("\n\
-Send email to nagios-users@lists.sourceforge.net if you have questions\n\
-regarding use of this software. To submit patches or suggest improvements,\n\
-send email to nagiosplug-devel@lists.sourceforge.net\n"));
+ printf ("%s: %s\n", progname, msg);
+ print_usage();
+ exit (STATE_UNKNOWN);
}
}
-
char *
clean_revstring (const char *revstring)
{
char *
clean_revstring (const char *revstring)
{
strncpy (plugin_revision, "N/A", STRLEN);
printf ("%s (%s %s) %s\n",
command_name, PACKAGE, VERSION, plugin_revision);
strncpy (plugin_revision, "N/A", STRLEN);
printf ("%s (%s %s) %s\n",
command_name, PACKAGE, VERSION, plugin_revision);
- printf (_("\
-The nagios plugins come with ABSOLUTELY NO WARRANTY. You may redistribute\n\
-copies of the plugins under the terms of the GNU General Public License.\n\
-For more information about these matters, see the file named COPYING.\n"));
-
}
const char *
}
const char *
timeout_alarm_handler (int signo)
{
if (signo == SIGALRM) {
timeout_alarm_handler (int signo)
{
if (signo == SIGALRM) {
- printf ("CRITICAL - Plugin timed out after %d seconds\n",
+ printf (_("CRITICAL - Plugin timed out after %d seconds\n"),
timeout_interval);
exit (STATE_CRITICAL);
}
timeout_interval);
exit (STATE_CRITICAL);
}
}
}
-
-
-
/******************************************************************************
*
* Copies one string to another. Any previously existing data in
/******************************************************************************
*
* Copies one string to another. Any previously existing data in
-
-
/******************************************************************************
*
* Returns a pointer to the next line of a multiline string buffer
/******************************************************************************
*
* Returns a pointer to the next line of a multiline string buffer
}
}
-
-
-
/******************************************************************************
*
* Like strscpy, except only the portion of the source string up to
/******************************************************************************
*
* Like strscpy, except only the portion of the source string up to
if (dest == NULL || strlen (dest) < len)
dest = realloc (dest, len + 1);
if (dest == NULL)
if (dest == NULL || strlen (dest) < len)
dest = realloc (dest, len + 1);
if (dest == NULL)
- die (STATE_UNKNOWN, "failed realloc in strpcpy\n");
+ die (STATE_UNKNOWN, _("failed realloc in strpcpy\n"));
strncpy (dest, src, len);
dest[len] = '\0';
strncpy (dest, src, len);
dest[len] = '\0';
-
-
/******************************************************************************
*
* Like strscat, except only the portion of the source string up to
/******************************************************************************
*
* Like strscat, except only the portion of the source string up to
dest = realloc (dest, len + l2 + 1);
if (dest == NULL)
dest = realloc (dest, len + l2 + 1);
if (dest == NULL)
- die (STATE_UNKNOWN, "failed malloc in strscat\n");
+ die (STATE_UNKNOWN, _("failed malloc in strscat\n"));
strncpy (dest + len, src, l2);
dest[len + l2] = '\0';
strncpy (dest + len, src, l2);
dest[len + l2] = '\0';
}
}
-
-
/******************************************************************************
*
* Print perfdata in a standard format
/******************************************************************************
*
* Print perfdata in a standard format