--- nagiosplug-1.3-beta1/acconfig.h Sun May 26 19:01:09 2002 +++ nagiosplug-1.3-beta1.new/acconfig.h Mon Oct 14 12:21:57 2002 @@ -35,6 +35,7 @@ #undef SSH_COMMAND #undef SWAP_COMMAND #undef SWAP_FORMAT +#undef SWAP_LINE #undef USE_PS_VARS #undef VSZ_COMMAND #undef VSZ_FORMAT --- nagiosplug-1.3-beta1/configure.in Wed Jun 12 20:03:07 2002 +++ nagiosplug-1.3-beta1.new/configure.in Mon Oct 14 11:59:56 2002 @@ -757,14 +757,18 @@ if [swap -l 2>/dev/null | egrep -i "^lswap +path +pri +swaplo +blocks +free +maxswap" >/dev/null] then AC_DEFINE_UNQUOTED(SWAP_FORMAT,[" %*d %*s %*d,%*d %*d %*d %d %d"]) + AC_DEFINE_UNQUOTED(SWAP_LINE,[""]) echo " using IRIX format" elif [swap -l 2>/dev/null | egrep -i "^swapfile +dev +swaplo +blocks +free" >/dev/null] then AC_DEFINE_UNQUOTED(SWAP_FORMAT,["%*s %*[[0-9,-]] %*d %d %d"]) + AC_DEFINE_UNQUOTED(SWAP_LINE,[""]) echo " using Solaris format" fi + + EXTRAS="$EXTRAS check_swap" -elif [swapinfo -k 2>&1 | egrep -i "Device" >/dev/null] +elif [swapinfo -k 2>&1 | egrep -i "^Device" >/dev/null] then echo "found swapinfo command" AC_DEFINE(HAVE_SWAP) @@ -773,8 +777,23 @@ if [swapinfo -k 2>/dev/null | egrep -i "^Device +1K-blocks +Used +Avail" >/dev/null] then AC_DEFINE_UNQUOTED(SWAP_FORMAT,["%*s %d %*d %d"]) + AC_DEFINE_UNQUOTED(SWAP_LINE,[""]) +dnl AC_DEFINE_UNQUOTED(SWAP_LINE,["Total"]) +dnl Can't exactly test the above, but thought it would be nice. echo " using FreeBSD format" fi +elif [swapinfo 2>&1 | egrep -i "^memory" >/dev/null] +then + echo "found swapinfo command" + AC_DEFINE(HAVE_SWAP) + AC_PATH_PROG(PATH_TO_SWAP,swapinfo) + AC_DEFINE_UNQUOTED(SWAP_COMMAND,"$PATH_TO_SWAP") + if [swapinfo 2>/dev/null | egrep -i "^TYPE +AVAIL +USED +FREE +USED" >/dev/null] + then + AC_DEFINE_UNQUOTED(SWAP_FORMAT,["%*s %d %*d %d"]) + AC_DEFINE_UNQUOTED(SWAP_LINE,["memory"]) + echo " using HP-UX format" + fi EXTRAS="$EXTRAS check_swap" fi --- nagiosplug-1.3-beta1/plugins/check_swap.c Wed Feb 27 22:42:59 2002 +++ nagiosplug-1.3-beta1.new/plugins/check_swap.c Mon Oct 14 12:00:18 2002 @@ -64,6 +64,7 @@ fclose (fp); #else #ifdef HAVE_SWAP + child_process = spopen (SWAP_COMMAND); if (child_process == NULL) { printf ("Could not open pipe: %s\n", SWAP_COMMAND); @@ -92,17 +93,19 @@ status = ssprintf (status, "%s", "Swap used:"); while (fgets (input_buffer, MAX_INPUT_BUFFER - 1, child_process)) { - sscanf (input_buffer, SWAP_FORMAT, &total_swap, &free_swap); - used_swap = total_swap - free_swap; - percent_used = 100 * ((float) used_swap) / ((float) total_swap); - status = ssprintf - (status, - "%s %2d%% (%d bytes out of %d)", - status, percent_used, used_swap, total_swap); - if (percent_used >= crit_percent || free_swap <= crit_size) - result = STATE_CRITICAL; - else if (percent_used >= warn_percent || free_swap <= warn_size) - result = STATE_WARNING; + if (strstr (input_buffer, SWAP_LINE)) { + sscanf (input_buffer, SWAP_FORMAT, &total_swap, &free_swap); + used_swap = total_swap - free_swap; + percent_used = 100 * ((float) used_swap) / ((float) total_swap); + status = ssprintf + (status, + "%s %2d%% (%d bytes out of %d)", + status, percent_used, used_swap, total_swap); + if (percent_used >= crit_percent || free_swap <= crit_size) + result = STATE_CRITICAL; + else if (percent_used >= warn_percent || free_swap <= warn_size) + result = STATE_WARNING; + } } /* If we get anything on STDERR, at least set warning */ --- nagiosplug-1.3-beta1/plugins/config.h.in Thu Jun 13 07:02:16 2002 +++ nagiosplug-1.3-beta1.new/plugins/config.h.in Mon Oct 14 12:10:37 2002 @@ -1,54 +1,4 @@ -/* plugins/config.h.in. Generated automatically from configure.in by autoheader. */ - -/* Define to empty if the keyword does not work. */ -#undef const - -/* Define for DGUX with . */ -#undef DGUX - -/* Define if the `getloadavg' function needs to be run setuid or setgid. */ -#undef GETLOADAVG_PRIVILEGED - -/* Define if your system has its own `getloadavg' function. */ -#undef HAVE_GETLOADAVG - -/* Define if you have that is POSIX.1 compatible. */ -#undef HAVE_SYS_WAIT_H - -/* Define if your struct nlist has an n_un member. */ -#undef NLIST_NAME_UNION - -/* Define if you have . */ -#undef NLIST_STRUCT - -/* Define to `int' if doesn't define. */ -#undef pid_t - -/* Define as the return type of signal handlers (int or void). */ -#undef RETSIGTYPE - -/* Define to `unsigned' if doesn't define. */ -#undef size_t - -/* Define if you have the ANSI C header files. */ -#undef STDC_HEADERS - -/* Define on System V Release 4. */ -#undef SVR4 - -/* Define if you can safely include both and . */ -#undef TIME_WITH_SYS_TIME - -/* Define if your declares struct tm. */ -#undef TM_IN_SYS_TIME - -/* Define for Encore UMAX. */ -#undef UMAX - -/* Define for Encore UMAX 4.3 that has - instead of . */ -#undef UMAX4_3 - +/* plugins/config.h.in. Generated from configure.in by autoheader. */ #undef CGIURL #undef DF_COMMAND #undef HAVE_GETOPT_H @@ -86,6 +36,7 @@ #undef SSH_COMMAND #undef SWAP_COMMAND #undef SWAP_FORMAT +#undef SWAP_LINE #undef USE_PS_VARS #undef VSZ_COMMAND #undef VSZ_FORMAT @@ -93,137 +44,230 @@ #undef PACKAGE #undef VERSION -/* Define if you have the getloadavg function. */ -#undef HAVE_GETLOADAVG +/* Define to 1 if using `getloadavg.c'. */ +#undef C_GETLOADAVG -/* Define if you have the getopt_long_only function. */ -#undef HAVE_GETOPT_LONG_ONLY +/* Define to 1 for DGUX with . */ +#undef DGUX -/* Define if you have the select function. */ -#undef HAVE_SELECT +/* Define to 1 if the `getloadavg' function needs to be run setuid or setgid. + */ +#undef GETLOADAVG_PRIVILEGED -/* Define if you have the socket function. */ -#undef HAVE_SOCKET +/* Define to 1 if you have the header file. */ +#undef HAVE_CRYPTO_H -/* Define if you have the strdup function. */ -#undef HAVE_STRDUP +/* Define to 1 if you have the header file. */ +#undef HAVE_ERRNO_H -/* Define if you have the strstr function. */ -#undef HAVE_STRSTR +/* Define to 1 if you have the header file. */ +#undef HAVE_ERR_H -/* Define if you have the strtod function. */ -#undef HAVE_STRTOD +/* Define to 1 if you have the `getloadavg' function. */ +#undef HAVE_GETLOADAVG -/* Define if you have the strtol function. */ -#undef HAVE_STRTOL +/* Define to 1 if you have the `getopt_long_only' function. */ +#undef HAVE_GETOPT_LONG_ONLY -/* Define if you have the strtoul function. */ -#undef HAVE_STRTOUL +/* Define to 1 if you have the header file. */ +#undef HAVE_INTTYPES_H -/* Define if you have the header file. */ -#undef HAVE_CRYPTO_H +/* Define to 1 if you have the `crypt' library (-lcrypt). */ +#undef HAVE_LIBCRYPT -/* Define if you have the header file. */ -#undef HAVE_ERR_H +/* Define to 1 if you have the `crypto' library (-lcrypto). */ +#undef HAVE_LIBCRYPTO -/* Define if you have the header file. */ -#undef HAVE_ERRNO_H +/* Define to 1 if you have the `dgc' library (-ldgc). */ +#undef HAVE_LIBDGC + +/* Define to 1 if you have the `kstat' library (-lkstat). */ +#undef HAVE_LIBKSTAT + +/* Define to 1 if you have the `ldap' library (-lldap). */ +#undef HAVE_LIBLDAP + +/* Define to 1 if you have the `pq' library (-lpq). */ +#undef HAVE_LIBPQ -/* Define if you have the header file. */ +/* Define to 1 if you have the header file. */ #undef HAVE_LIBPQ_FE_H -/* Define if you have the header file. */ +/* Define to 1 if you have the `radiusclient' library (-lradiusclient). */ +#undef HAVE_LIBRADIUSCLIENT + +/* Define to 1 if you have the header file. */ #undef HAVE_MACH_MACH_H -/* Define if you have the header file. */ +/* Define to 1 if you have the header file. */ +#undef HAVE_MEMORY_H + +/* Define to 1 if you have the header file. */ #undef HAVE_MYSQL_ERRMSG_H -/* Define if you have the header file. */ +/* Define to 1 if you have the header file. */ #undef HAVE_MYSQL_MYSQL_H -/* Define if you have the header file. */ +/* Define to 1 if you have the header file. */ +#undef HAVE_NLIST_H + +/* Define to 1 if you have the header file. */ #undef HAVE_OPENSSL_CRYPTO_H -/* Define if you have the header file. */ +/* Define to 1 if you have the header file. */ #undef HAVE_OPENSSL_ERR_H -/* Define if you have the header file. */ +/* Define to 1 if you have the header file. */ #undef HAVE_OPENSSL_PEM_H -/* Define if you have the header file. */ +/* Define to 1 if you have the header file. */ #undef HAVE_OPENSSL_RSA_H -/* Define if you have the header file. */ +/* Define to 1 if you have the header file. */ #undef HAVE_OPENSSL_SSL_H -/* Define if you have the header file. */ +/* Define to 1 if you have the header file. */ #undef HAVE_OPENSSL_X509_H -/* Define if you have the header file. */ +/* Define to 1 if you have the header file. */ #undef HAVE_PEM_H -/* Define if you have the header file. */ +/* Define to 1 if you have the header file. */ #undef HAVE_PGSQL_LIBPQ_FE_H -/* Define if you have the header file. */ +/* Define to 1 if you have the header file. */ #undef HAVE_POSTGRESQL_LIBPQ_FE_H -/* Define if you have the header file. */ +/* Define to 1 if you have the `pstat_getdynamic' function. */ +#undef HAVE_PSTAT_GETDYNAMIC + +/* Define to 1 if you have the header file. */ #undef HAVE_REGEX_H -/* Define if you have the header file. */ +/* Define to 1 if you have the header file. */ #undef HAVE_RSA_H -/* Define if you have the header file. */ +/* Define to 1 if you have the `select' function. */ +#undef HAVE_SELECT + +/* Define to 1 if you have the `setlocale' function. */ +#undef HAVE_SETLOCALE + +/* Define to 1 if you have the header file. */ #undef HAVE_SIGNAL_H -/* Define if you have the header file. */ +/* Define to 1 if you have the `socket' function. */ +#undef HAVE_SOCKET + +/* Define to 1 if you have the header file. */ #undef HAVE_SSL_H -/* Define if you have the header file. */ -#undef HAVE_STRING_H +/* Define to 1 if you have the header file. */ +#undef HAVE_STDINT_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_STDLIB_H -/* Define if you have the header file. */ +/* Define to 1 if you have the `strdup' function. */ +#undef HAVE_STRDUP + +/* Define to 1 if you have the header file. */ #undef HAVE_STRINGS_H -/* Define if you have the header file. */ +/* Define to 1 if you have the header file. */ +#undef HAVE_STRING_H + +/* Define to 1 if you have the `strstr' function. */ +#undef HAVE_STRSTR + +/* Define to 1 if you have the `strtod' function. */ +#undef HAVE_STRTOD + +/* Define to 1 if you have the `strtol' function. */ +#undef HAVE_STRTOL + +/* Define to 1 if you have the `strtoul' function. */ +#undef HAVE_STRTOUL + +/* Define to 1 if `n_un.n_name' is member of `struct nlist'. */ +#undef HAVE_STRUCT_NLIST_N_UN_N_NAME + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYSLOG_H + +/* Define to 1 if you have the header file. */ #undef HAVE_SYS_LOADAVG_H -/* Define if you have the header file. */ +/* Define to 1 if you have the header file. */ #undef HAVE_SYS_SOCKET_H -/* Define if you have the header file. */ +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_STAT_H + +/* Define to 1 if you have the header file. */ #undef HAVE_SYS_TIME_H -/* Define if you have the header file. */ +/* Define to 1 if you have the header file. */ #undef HAVE_SYS_TYPES_H -/* Define if you have the header file. */ -#undef HAVE_SYSLOG_H +/* Define to 1 if you have that is POSIX.1 compatible. */ +#undef HAVE_SYS_WAIT_H -/* Define if you have the header file. */ +/* Define to 1 if you have the header file. */ #undef HAVE_UIO_H -/* Define if you have the header file. */ +/* Define to 1 if you have the header file. */ #undef HAVE_UNISTD_H -/* Define if you have the header file. */ +/* Define to 1 if you have the header file. */ #undef HAVE_X509_H -/* Define if you have the crypt library (-lcrypt). */ -#undef HAVE_LIBCRYPT +/* Define to 1 if your `struct nlist' has an `n_un' member. Obsolete, depend + on `HAVE_STRUCT_NLIST_N_UN_N_NAME */ +#undef NLIST_NAME_UNION -/* Define if you have the crypto library (-lcrypto). */ -#undef HAVE_LIBCRYPTO +/* Define to the address where bug reports for this package should be sent. */ +#undef PACKAGE_BUGREPORT -/* Define if you have the dgc library (-ldgc). */ -#undef HAVE_LIBDGC +/* Define to the full name of this package. */ +#undef PACKAGE_NAME -/* Define if you have the ldap library (-lldap). */ -#undef HAVE_LIBLDAP +/* Define to the full name and version of this package. */ +#undef PACKAGE_STRING -/* Define if you have the pq library (-lpq). */ -#undef HAVE_LIBPQ +/* Define to the one symbol short name of this package. */ +#undef PACKAGE_TARNAME -/* Define if you have the radiusclient library (-lradiusclient). */ -#undef HAVE_LIBRADIUSCLIENT +/* Define to the version of this package. */ +#undef PACKAGE_VERSION + +/* Define as the return type of signal handlers (`int' or `void'). */ +#undef RETSIGTYPE + +/* Define to 1 if you have the ANSI C header files. */ +#undef STDC_HEADERS + +/* Define to 1 on System V Release 4. */ +#undef SVR4 + +/* Define to 1 if you can safely include both and . */ +#undef TIME_WITH_SYS_TIME + +/* Define to 1 if your declares `struct tm'. */ +#undef TM_IN_SYS_TIME + +/* Define to 1 for Encore UMAX. */ +#undef UMAX + +/* Define to 1 for Encore UMAX 4.3 that has instead of + . */ +#undef UMAX4_3 + +/* Define to empty if `const' does not conform to ANSI C. */ +#undef const + +/* Define to `int' if does not define. */ +#undef pid_t + +/* Define to `unsigned' if does not define. */ +#undef size_t --- nagiosplug-1.3-beta1/plugins/snprintf.c Wed Feb 27 22:42:59 2002 +++ nagiosplug-1.3-beta1.new/plugins/snprintf.c Mon Oct 14 12:15:27 2002 @@ -34,7 +34,7 @@ /* Some changes made by bbraun@synack.net for use with xinetd */ -#if !defined(HAVE_SNPRINTF) +#if defined(HAVE_SNPRINTF) /* Extracted from sendmail 8.8.5 */ #ifndef lint