Imported Upstream version 1.4.10

This commit is contained in:
Jan Wagner 2013-11-26 23:54:42 +01:00
parent 6dd54dd8e2
commit cff68b4c0a
203 changed files with 15026 additions and 8063 deletions

1467
ABOUT-NLS

File diff suppressed because it is too large Load diff

31
BUGS
View file

@ -2,42 +2,23 @@ This file lists the major bugs from the Nagios Plugins page on Sourceforge
at http://sourceforge.net/tracker/?group_id=29880&atid=397597. These are not
necessarily verified as errors.
For the 1.4.8 release:
For the 1.4.9 release:
1687867 - check_http: buffer overflow vulnerability
1675306 - check_dhcp: does not add mandatory 'end' option
1675286 - check_ssh: -S flag not working
1652471 - check_http: missing Accept header
1648570 - check_dhcp error by asking 2 dhcp servers
1637767 - check_ping on FreeBSD 5.4 fails
1614168 - not compatible with OpenSSL 0.9.8d
1595449 - check_procs bus error on Solaris 8,9,10
1573700 - check_swap on HP-UX incorrect
1573638 - check_swap SEGVs on Sol 10
1541340 - check_procs won't execute on Solaris 9 x86
1724055 - check_dns: does not sort address data
1681516 - output too verbose for various checks
1670261 - check_snmp might require snmpget with LD_LIBRARY_PATH
1569488 - check_ifoperstatus.pl: -n option does't work (help required!)
1523748 - check_disk should error if warn range is subset of critical
1506121 - check_http problem with protocol change in redirect
1498923 - check_ldap build error on Solaris 9
1495828 - pst3 failure on solaris 10 x86
1494629 - check_icmp fails after a time on FreeBSD
1480574 - check_disk missing -lm on Solaris
1478287 - check_dns fails with CNAMEs
1475899 - check_tcp segfaults with multiple -s or -e args
1470013 - check_tcp complains about double values in parameter
1469472 - check_ping dns lookup problem
1469468 - signal handler in popen.c is broken
1466426 - check_ldaps doesn't default to port 636
1447642 - check_ping segfault on Sol 10
1433179 - check_jabber does not honor --mismatch
1381604 - Perlsec breaks any perl plugin with perl 5.8.x
1373801 - check_ping timeout on Mandrake 10.1
1370031 - check_disk_smb requires DNS agree with NetBIOS names
1344584 - check_snmp counter64 values not handled correctly
1291987 - urlize useragent does not work
1250982 - check_postgresql: configure test for -lcrypto on OpenBSD
1225470 - check_swap perf data incorrect
1218438 - check_radius linking to wrong header
1108499 - check_ping with -U on Debian fails
1094326 - check_ide_smart usage errors
1090549 - check_dhcp ignores DHCP replies
990948 - check_disk_smb doesn't allow spaces in share names

10340
ChangeLog

File diff suppressed because it is too large Load diff

16
INSTALL
View file

@ -102,16 +102,16 @@ for another architecture.
Installation Names
==================
By default, `make install' installs the package's commands under
`/usr/local/bin', include files under `/usr/local/include', etc. You
can specify an installation prefix other than `/usr/local' by giving
`configure' the option `--prefix=PREFIX'.
By default, `make install' will install the package's files in
`/usr/local/bin', `/usr/local/man', etc. You can specify an
installation prefix other than `/usr/local' by giving `configure' the
option `--prefix=PREFIX'.
You can specify separate installation prefixes for
architecture-specific files and architecture-independent files. If you
pass the option `--exec-prefix=PREFIX' to `configure', the package uses
PREFIX as the prefix for installing programs and libraries.
Documentation and other data files still use the regular prefix.
give `configure' the option `--exec-prefix=PREFIX', the package will
use PREFIX as the prefix for installing programs and libraries.
Documentation and other data files will still use the regular prefix.
In addition, if you use an unusual directory layout you can give
options like `--bindir=DIR' to specify different values for particular
@ -159,7 +159,7 @@ where SYSTEM can have one of these forms:
need to know the machine type.
If you are _building_ compiler tools for cross-compiling, you should
use the option `--target=TYPE' to select the type of system they will
use the `--target=TYPE' option to select the type of system they will
produce code for.
If you want to _use_ a cross compiler, that generates code for a

View file

@ -1,12 +1,13 @@
## Process this file with automake to produce Makefile.in
SUBDIRS = gl lib plugins plugins-scripts plugins-root po
SUBDIRS = gl lib plugins plugins-scripts plugins-root po @PERLMODS_DIR@
EXTRA_DIST = config.rpath \
ABOUT-NLS ACKNOWLEDGEMENTS AUTHORS BUGS CODING FAQ LEGAL NEWS \
REQUIREMENTS SUPPORT THANKS \
NPTest.pm contrib pkg nagios-plugins.spec \
config_test/Makefile config_test/run_tests config_test/child_test.c \
perlmods tools/build_perl_modules \
tools/tinderbox_build
ACLOCAL_AMFLAGS = -I gl/m4 -I m4
@ -23,8 +24,9 @@ install-root:
test:
cd lib && $(MAKE) test
cd plugins; $(MAKE) test
cd plugins-scripts; $(MAKE) test
if test "$(PERLMODS_DIR)" != ""; then cd perlmods && $(MAKE) test; fi
cd plugins && $(MAKE) test
cd plugins-scripts && $(MAKE) test
nagios-plugins.spec: nagios-plugins.spec.in
sed "s/%%{VERSION}/${VERSION}/;s/%%{RELEASE}/${RELEASE}/;s/^%%{requires}$$//" $? > $@

View file

@ -1,4 +1,4 @@
# Makefile.in generated by automake 1.9.6 from Makefile.am.
# Makefile.in generated by automake 1.9.5 from Makefile.am.
# @configure_input@
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
@ -42,7 +42,7 @@ DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \
build-aux/compile build-aux/config.guess \
build-aux/config.rpath build-aux/config.sub build-aux/depcomp \
build-aux/install-sh build-aux/ltmain.sh build-aux/missing \
config.rpath mkinstalldirs
build-aux/mkinstalldirs config.rpath mkinstalldirs
subdir = .
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/m4/np_mysqlclient.m4 \
@ -104,7 +104,7 @@ am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
configure.lineno configure.status.lineno
mkinstalldirs = $(install_sh) -d
mkinstalldirs = $(SHELL) $(top_srcdir)/build-aux/mkinstalldirs
CONFIG_HEADER = config.h
CONFIG_CLEAN_FILES = command.cfg test.pl pkg/solaris/pkginfo
SOURCES =
@ -263,6 +263,7 @@ PATH_TO_SWAPINFO = @PATH_TO_SWAPINFO@
PATH_TO_UPTIME = @PATH_TO_UPTIME@
PATH_TO_WHO = @PATH_TO_WHO@
PERL = @PERL@
PERLMODS_DIR = @PERLMODS_DIR@
PGINCLUDE = @PGINCLUDE@
PGLIBS = @PGLIBS@
PKG_ARCH = @PKG_ARCH@
@ -349,12 +350,13 @@ sharedstatedir = @sharedstatedir@
sysconfdir = @sysconfdir@
target_alias = @target_alias@
with_trusted_path = @with_trusted_path@
SUBDIRS = gl lib plugins plugins-scripts plugins-root po
SUBDIRS = gl lib plugins plugins-scripts plugins-root po @PERLMODS_DIR@
EXTRA_DIST = config.rpath \
ABOUT-NLS ACKNOWLEDGEMENTS AUTHORS BUGS CODING FAQ LEGAL NEWS \
REQUIREMENTS SUPPORT THANKS \
NPTest.pm contrib pkg nagios-plugins.spec \
config_test/Makefile config_test/run_tests config_test/child_test.c \
perlmods tools/build_perl_modules \
tools/tinderbox_build
ACLOCAL_AMFLAGS = -I gl/m4 -I m4
@ -817,8 +819,9 @@ install-root:
test:
cd lib && $(MAKE) test
cd plugins; $(MAKE) test
cd plugins-scripts; $(MAKE) test
if test "$(PERLMODS_DIR)" != ""; then cd perlmods && $(MAKE) test; fi
cd plugins && $(MAKE) test
cd plugins-scripts && $(MAKE) test
nagios-plugins.spec: nagios-plugins.spec.in
sed "s/%%{VERSION}/${VERSION}/;s/%%{RELEASE}/${RELEASE}/;s/^%%{requires}$$//" $? > $@

48
NEWS
View file

@ -1,5 +1,53 @@
This file documents the major additions and syntax changes between releases.
1.4.10 28th September 2007
Fix check_http buffer overflow vulnerability when following HTTP redirects
check_http now explicitly asks HTTP/1.1 servers to close the connection
after completion of the response
Check_ldaps' guessing which secure method to use (starttls vs. ssl on connect)
is now deprecated. See --help for further information.
Check_disk now calls stat() on all filesystems to check. (Old: only the ones selected using -p)
A meaningful error message (eg "Stale NFS Handle") is printed if stat fails.
New check_disk option -L: Only check local filesystems, but call stat() on remote ones, too.
Thus accessibility of remote filesystems can be checked without any threshold comparison.
Check_disk's --help now prints some examples for the new features introduced in 1.4.8
New check_disk -i/-I option to ignore pathes/partitions based on regular expressions
New check_disk -A option to select all filesystems explicitly
WARNING: check_disk's -E option must now be passed before -p or -r/-R arguments
Passing -E after -p or -r results in UNKNOWN state, now
This is needed due to the new ignore feature
Fix check_disk bug when mixing case sensitive and case insensitive regex arguments
New check_dhcp -u/--unicast option for emulating a DHCP relay in order
to check DHCP servers on remote networks
New check_dhcp -m/--mac option which allows for specifying the MAC
address to use in the DHCP request
The check_dhcp -r and -s options now accept host names, too
Fix possible check_icmp bus errors on some (non-x86/AMD64) platforms
Fix check_smtp's handling of multiple-packet server responses
WARNING: Fix for negate which may break existing commands:
- stop evaluating command line options through shell twice
- enforce a full path for the command to run
The "negate" utility can now remap custom states
Check_radius now supports radiusclient-ng
The (undocumented) positional parameter parsing which check_radius used
instead of getopt(3) if 8 arguments were given is no longer available
Check_by_ssh now supports multiline output
IPv6 support can now be disabled using ./configure --without-ipv6
Fix check_ntp now honor ntp flags
1.4.9 4th June 2006
Inclusion of contrib/check_cluster2 as check_cluster with some improvements
New/improved -E/--skip-stderr and -S/--skip-stdout options for check_by_ssh
check_snmp now supports Counter64
Fix compilation of check_ldap, check_radius and check_pgsql
check_load can optionally divide by number of cpus
Fix check_time returning wrong OK when time is before the epoch on some arch
Make check_http output more consistent
Fix possible check_http segfaults when following HTTP redirects
check_snmp don't warn anymore if something is printed on stderr
Fix check_tcp segfault when multiple expect strings are given
New option for check_tcp: -A/--all to test if all given expect strings match
1.4.8 11th April 2007
Respects --without-world-permissions for setuid plugins
check_disk extra options for regex matching of filesystems and grouping of filesystems

View file

@ -21,7 +21,7 @@ use Data::Dumper;
use Test;
use vars qw($VERSION);
$VERSION = do { my @r = (q$Revision: 1.14 $ =~ /\d+/g); sprintf "%d."."%02d" x $#r, @r }; # must be all one line, for MakeMaker
$VERSION = do { my @r = (q$Revision: 1556 $ =~ /\d+/g); sprintf "%d."."%02d" x $#r, @r }; # must be all one line, for MakeMaker
=head1 NAME

View file

@ -46,6 +46,8 @@ check_radius:
- Requires the radiusclient library available from
ftp://ftp.cityline.net/pub/radiusclient/
RPM (rpmfind): radiusclient 0.3.2, radiusclient-devel-0.3.2
- Alternatively radiusclient-ng can be used:
http://developer.berlios.de/projects/radiusclient-ng/
check_snmp:
- Requires the NET-SNMP package available from
@ -67,6 +69,9 @@ check_ups:
- Requires Network UPS Tools (>= 1.4) to run on the server to monitor
http://www.networkupstools.org/
check_ide_smart:
- Uses the Linux specific SMART interface [http://smartlinux.sourceforge.net/smart/index.php].
OS Specific Issues
------------------

11
THANKS
View file

@ -27,9 +27,11 @@ Simon Bellwood
Allan Bennett
Guy Van Den Bergh
Tom Bertelston
Daniel Bimschas
Jeffery Blank
Tom De Blende
Eric Bollengier
Aurelien Bompard
Richard Brodie
Matthew Brown
Dick van den Burg
@ -58,10 +60,12 @@ Rainer Duffner
Ian Duggan
Matthias Eble
Edwin Eefting
Andrew Elwell
Mike Emigh
Hans Engelen
Matthew Ericson
Andreas Ericsson
Heiti Ernits
Ragnar Hojland Espinosa
O'Shaughnessy Evans
Merijn Evertse
@ -74,6 +78,7 @@ Paulo Fessel
Paulo Afonso Graner Fessel
James Fidell
Johan Fischer
Matthias Flacke
Felix Frank
Rick Frey
Matt Garrett
@ -86,8 +91,10 @@ Steve Greenland
Olaf Greis
Chris Grim
Steven Grimm
Sebastien Guay
Jon Hallett
Steve Hanselman
Ask Bjoern Hansen
Michael Haro
Gunnar Hellekson
Johannes Herlitz
@ -104,6 +111,7 @@ Roy Sigurd Karlsbakk
Jason Kau
Bo Kersey
Serhan Kiymaz
Denis Knauf
John Koyle
Steven Kreuzer
Christoph Kron
@ -132,6 +140,7 @@ Mike McHenry
Stefan Meier
Jan-Piet Mens
Sven Meyer
Emil Michles
Christian Mies
Russell Miller
Janos Mohacsi
@ -174,6 +183,7 @@ Dietmar Ruzicka
Ralph Rye
Alen Salamun
Sven Schaffranneck
Christoph Schell
Thomas Schimpke
Benjamin Schmid
Henning Schmiedehausen
@ -199,6 +209,7 @@ Ibere Tizio
Julien Touche
Kyle Tucker
Jerome Tytgat
MAtteo HCE Valsasna
Jon Vandegrift
Laurent Vaslin
Carole Verdon

View file

@ -8,7 +8,7 @@ dnl e.g. 6 arguments (linux)
dnl e.g. 5 arguments (solaris)
dnl e.g. 3 arguments (osf/1)
dnl
dnl @version $Id: acinclude.m4,v 1.5 2004/02/18 14:56:34 kdebisschop Exp $
dnl @version $Id: acinclude.m4 805 2004-02-18 14:56:39Z kdebisschop $
dnl @author Brian Stafford <brian@stafford.uklinux.net>
dnl
dnl based on version by Caolan McNamara <caolan@skynet.ie>

4
aclocal.m4 vendored
View file

@ -1,4 +1,4 @@
# generated automatically by aclocal 1.9.6 -*- Autoconf -*-
# generated automatically by aclocal 1.9.5 -*- Autoconf -*-
# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
# 2005 Free Software Foundation, Inc.
@ -6397,7 +6397,7 @@ AC_DEFUN([AM_AUTOMAKE_VERSION], [am__api_version="1.9"])
# Call AM_AUTOMAKE_VERSION so it can be traced.
# This function is AC_REQUIREd by AC_INIT_AUTOMAKE.
AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
[AM_AUTOMAKE_VERSION([1.9.6])])
[AM_AUTOMAKE_VERSION([1.9.5])])
# AM_AUX_DIR_EXPAND -*- Autoconf -*-

View file

@ -1,7 +1,7 @@
#! /bin/sh
# Wrapper for compilers which do not understand `-c -o'.
scriptversion=2005-05-14.22
scriptversion=2005-02-03.08
# Copyright (C) 1999, 2000, 2003, 2004, 2005 Free Software Foundation, Inc.
# Written by Tom Tromey <tromey@cygnus.com>.
@ -18,7 +18,7 @@ scriptversion=2005-05-14.22
#
# 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
# As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a

View file

@ -1,7 +1,7 @@
#! /bin/sh
# depcomp - compile a program generating dependencies as side-effects
scriptversion=2005-07-09.11
scriptversion=2005-02-09.22
# Copyright (C) 1999, 2000, 2003, 2004, 2005 Free Software Foundation, Inc.
@ -17,8 +17,8 @@ scriptversion=2005-07-09.11
# 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., 51 Franklin Street, Fifth Floor, Boston, MA
# 02110-1301, USA.
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
# 02111-1307, USA.
# As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a
@ -467,8 +467,7 @@ cpp)
done
"$@" -E |
sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \
-e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' |
sed -n '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' |
sed '$ s: \\$::' > "$tmpdepfile"
rm -f "$depfile"
echo "$object : \\" > "$depfile"

View file

@ -1,7 +1,7 @@
#!/bin/sh
# install - install a program, script, or datafile
scriptversion=2005-05-14.22
scriptversion=2005-02-02.21
# This originates from X11R5 (mit/util/scripts/install.sh), which was
# later released in X11R6 (xc/config/util/install.sh) with the

View file

@ -1,7 +1,7 @@
#! /bin/sh
# Common stub for a few missing GNU programs while installing.
scriptversion=2005-06-08.21
scriptversion=2005-02-08.22
# Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005
# Free Software Foundation, Inc.
@ -19,8 +19,8 @@ scriptversion=2005-06-08.21
# 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., 51 Franklin Street, Fifth Floor, Boston, MA
# 02110-1301, USA.
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
# 02111-1307, USA.
# As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a
@ -297,9 +297,6 @@ WARNING: \`$1' is $msg. You should only need it if
# ... or it is derived from the source name (dir/f.texi becomes f.info)
test -z "$file" && file=`echo "$infile" | sed 's,.*/,,;s,.[^.]*$,,'`.info
fi
# If the file does not exist, the user really needs makeinfo;
# let's fail without touching anything.
test -f $file || exit 1
touch $file
;;

150
build-aux/mkinstalldirs Executable file
View file

@ -0,0 +1,150 @@
#! /bin/sh
# mkinstalldirs --- make directory hierarchy
scriptversion=2005-02-02.21
# Original author: Noah Friedman <friedman@prep.ai.mit.edu>
# Created: 1993-05-16
# Public domain.
#
# This file is maintained in Automake, please report
# bugs to <bug-automake@gnu.org> or send patches to
# <automake-patches@gnu.org>.
errstatus=0
dirmode=""
usage="\
Usage: mkinstalldirs [-h] [--help] [--version] [-m MODE] DIR ...
Create each directory DIR (with mode MODE, if specified), including all
leading file name components.
Report bugs to <bug-automake@gnu.org>."
# process command line arguments
while test $# -gt 0 ; do
case $1 in
-h | --help | --h*) # -h for help
echo "$usage"
exit $?
;;
-m) # -m PERM arg
shift
test $# -eq 0 && { echo "$usage" 1>&2; exit 1; }
dirmode=$1
shift
;;
--version)
echo "$0 $scriptversion"
exit $?
;;
--) # stop option processing
shift
break
;;
-*) # unknown option
echo "$usage" 1>&2
exit 1
;;
*) # first non-opt arg
break
;;
esac
done
for file
do
if test -d "$file"; then
shift
else
break
fi
done
case $# in
0) exit 0 ;;
esac
# Solaris 8's mkdir -p isn't thread-safe. If you mkdir -p a/b and
# mkdir -p a/c at the same time, both will detect that a is missing,
# one will create a, then the other will try to create a and die with
# a "File exists" error. This is a problem when calling mkinstalldirs
# from a parallel make. We use --version in the probe to restrict
# ourselves to GNU mkdir, which is thread-safe.
case $dirmode in
'')
if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then
echo "mkdir -p -- $*"
exec mkdir -p -- "$@"
else
# On NextStep and OpenStep, the `mkdir' command does not
# recognize any option. It will interpret all options as
# directories to create, and then abort because `.' already
# exists.
test -d ./-p && rmdir ./-p
test -d ./--version && rmdir ./--version
fi
;;
*)
if mkdir -m "$dirmode" -p --version . >/dev/null 2>&1 &&
test ! -d ./--version; then
echo "mkdir -m $dirmode -p -- $*"
exec mkdir -m "$dirmode" -p -- "$@"
else
# Clean up after NextStep and OpenStep mkdir.
for d in ./-m ./-p ./--version "./$dirmode";
do
test -d $d && rmdir $d
done
fi
;;
esac
for file
do
set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'`
shift
pathcomp=
for d
do
pathcomp="$pathcomp$d"
case $pathcomp in
-*) pathcomp=./$pathcomp ;;
esac
if test ! -d "$pathcomp"; then
echo "mkdir $pathcomp"
mkdir "$pathcomp" || lasterr=$?
if test ! -d "$pathcomp"; then
errstatus=$lasterr
else
if test ! -z "$dirmode"; then
echo "chmod $dirmode $pathcomp"
lasterr=""
chmod "$dirmode" "$pathcomp" || lasterr=$?
if test ! -z "$lasterr"; then
errstatus=$lasterr
fi
fi
fi
fi
pathcomp="$pathcomp/"
done
done
exit $errstatus
# Local Variables:
# mode: shell-script
# sh-indentation: 2
# eval: (add-hook 'write-file-hooks 'time-stamp)
# time-stamp-start: "scriptversion="
# time-stamp-format: "%:y-%02m-%02d.%02H"
# time-stamp-end: "$"
# End:

View file

@ -1,7 +1,7 @@
###############################################################################
# COMMAND CONFIGURATION
#
# $Id: command.cfg.in,v 1.13 2004/12/02 04:48:37 mattkent Exp $
# $Id: command.cfg.in 973 2004-12-02 04:48:37Z mattkent $
#
# SYNTAX:
# command[<command_name>]=<command_line>

View file

@ -318,6 +318,10 @@
/* Define to 1 if you have the `radiusclient' library (-lradiusclient). */
#undef HAVE_LIBRADIUSCLIENT
/* Define to 1 if you have the `radiusclient-ng' library (-lradiusclient-ng).
*/
#undef HAVE_LIBRADIUSCLIENT_NG
/* Define to 1 if you have the `listmntent' function. */
#undef HAVE_LISTMNTENT
@ -527,6 +531,9 @@
/* Define to 1 if the system has the type `swaptbl_t'. */
#undef HAVE_SWAPTBL_T
/* Define if sysconf returns number of cpus */
#undef HAVE_SYSCONF__SC_NPROCESSORS_CONF
/* Define to 1 if you have the <syslog.h> header file. */
#undef HAVE_SYSLOG_H
@ -560,6 +567,9 @@
/* Define to 1 if you have the <sys/socket.h> header file. */
#undef HAVE_SYS_SOCKET_H
/* Define to 1 if you have the <sys/sockio.h> header file. */
#undef HAVE_SYS_SOCKIO_H
/* Define to 1 if you have the <sys/statfs.h> header file. */
#undef HAVE_SYS_STATFS_H

716
configure vendored
View file

@ -1,7 +1,7 @@
#! /bin/sh
# From configure.in .
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.59 for nagios-plugins 1.4.8.
# Generated by GNU Autoconf 2.59 for nagios-plugins 1.4.10.
#
# Copyright (C) 2003 Free Software Foundation, Inc.
# This configure script is free software; the Free Software Foundation
@ -422,8 +422,8 @@ SHELL=${CONFIG_SHELL-/bin/sh}
# Identity of this package.
PACKAGE_NAME='nagios-plugins'
PACKAGE_TARNAME='nagios-plugins'
PACKAGE_VERSION='1.4.8'
PACKAGE_STRING='nagios-plugins 1.4.8'
PACKAGE_VERSION='1.4.10'
PACKAGE_STRING='nagios-plugins 1.4.10'
PACKAGE_BUGREPORT=''
ac_unique_file="NPTest.pm"
@ -468,7 +468,7 @@ ac_includes_default="\
gt_needs=
gl_header_list=
gl_func_list=
ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CYGPATH_W PACKAGE VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO install_sh STRIP ac_ct_STRIP INSTALL_STRIP_PROGRAM mkdir_p AWK SET_MAKE am__leading_dot AMTAR am__tar am__untar build build_cpu build_vendor build_os host host_cpu host_vendor host_os RELEASE INSTALL CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT DEPDIR am__include am__quote AMDEP_TRUE AMDEP_FALSE AMDEPBACKSLASH CCDEPMODE am__fastdepCC_TRUE am__fastdepCC_FALSE RANLIB ac_ct_RANLIB CPP EGREP LN_S ECHO AR ac_ct_AR CXX CXXFLAGS ac_ct_CXX CXXDEPMODE am__fastdepCXX_TRUE am__fastdepCXX_FALSE CXXCPP F77 FFLAGS ac_ct_F77 LIBTOOL LIBOBJS POW_LIB PLUGIN_TEST SCRIPT_TEST WARRANTY SUPPORT with_trusted_path PKG_ARCH REV_DATESTAMP REV_TIMESTAMP PYTHON SH PERL LIBGNUTLS_CONFIG HOSTNAME BASENAME SOCKETLIBS MATHLIBS EXTRA_TEST PGLIBS PGINCLUDE RADIUSLIBS LDAPLIBS LDAPINCLUDE np_mysql_config MYSQLINCLUDE MYSQLLIBS MYSQLCFLAGS KRBINCLUDE SSLINCLUDE check_tcp_ssl SSLLIBS PATH_TO_PS PATH_TO_PING PATH_TO_PING6 PATH_TO_NSLOOKUP PATH_TO_UPTIME PATH_TO_RPCINFO PATH_TO_LMSTAT PATH_TO_SMBCLIENT PATH_TO_WHO PATH_TO_SNMPGET PATH_TO_SNMPGETNEXT PATH_TO_QUAKESTAT PATH_TO_QSTAT PATH_TO_FPING PATH_TO_SSH PATH_TO_MAILQ PATH_TO_QMAIL_QSTAT PATH_TO_SWAP PATH_TO_SWAPINFO PATH_TO_LSPS PATH_TO_DIG PATH_TO_APTGET EXTRAS EXTRAS_ROOT EXTRA_NETOBJS DEPLIBS USE_NLS MSGFMT GMSGFMT MSGFMT_015 GMSGFMT_015 XGETTEXT XGETTEXT_015 MSGMERGE localedir INTL_MACOSX_LIBS LIBICONV LTLIBICONV INTLLIBS LIBINTL LTLIBINTL POSUB GL_COND_LIBTOOL_TRUE GL_COND_LIBTOOL_FALSE ALLOCA ALLOCA_H ARPA_INET_H SYS_SOCKET_H NEED_SETGID KMEM_GROUP GETLOADAVG_LIBS GETOPT_H NETINET_IN_H STDBOOL_H HAVE__BOOL HAVE_LONG_LONG_INT HAVE_UNSIGNED_LONG_LONG_INT HAVE_INTTYPES_H HAVE_SYS_TYPES_H ABSOLUTE_STDINT_H HAVE_STDINT_H HAVE_SYS_INTTYPES_H HAVE_SYS_BITYPES_H BITSIZEOF_PTRDIFF_T BITSIZEOF_SIG_ATOMIC_T BITSIZEOF_SIZE_T BITSIZEOF_WCHAR_T BITSIZEOF_WINT_T HAVE_SIGNED_SIG_ATOMIC_T HAVE_SIGNED_WCHAR_T HAVE_SIGNED_WINT_T PTRDIFF_T_SUFFIX SIG_ATOMIC_T_SUFFIX SIZE_T_SUFFIX WCHAR_T_SUFFIX WINT_T_SUFFIX STDINT_H MKDIR_P UNISTD_H ABSOLUTE_UNISTD_H EOVERFLOW ABSOLUTE_WCHAR_H WCHAR_H HAVE_WINT_T ABSOLUTE_WCTYPE_H HAVE_WCTYPE_H WCTYPE_H LIBGNU_LIBDEPS LIBGNU_LTLIBDEPS LTLIBOBJS gl_LIBOBJS gl_LTLIBOBJS'
ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CYGPATH_W PACKAGE VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO install_sh STRIP ac_ct_STRIP INSTALL_STRIP_PROGRAM mkdir_p AWK SET_MAKE am__leading_dot AMTAR am__tar am__untar build build_cpu build_vendor build_os host host_cpu host_vendor host_os RELEASE INSTALL CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT DEPDIR am__include am__quote AMDEP_TRUE AMDEP_FALSE AMDEPBACKSLASH CCDEPMODE am__fastdepCC_TRUE am__fastdepCC_FALSE RANLIB ac_ct_RANLIB CPP EGREP LN_S ECHO AR ac_ct_AR CXX CXXFLAGS ac_ct_CXX CXXDEPMODE am__fastdepCXX_TRUE am__fastdepCXX_FALSE CXXCPP F77 FFLAGS ac_ct_F77 LIBTOOL LIBOBJS POW_LIB PLUGIN_TEST SCRIPT_TEST WARRANTY SUPPORT with_trusted_path PKG_ARCH REV_DATESTAMP REV_TIMESTAMP PYTHON SH PERL LIBGNUTLS_CONFIG HOSTNAME BASENAME SOCKETLIBS MATHLIBS EXTRA_TEST PGLIBS PGINCLUDE RADIUSLIBS LDAPLIBS LDAPINCLUDE np_mysql_config MYSQLINCLUDE MYSQLLIBS MYSQLCFLAGS KRBINCLUDE SSLINCLUDE check_tcp_ssl SSLLIBS PATH_TO_PS PATH_TO_PING PATH_TO_PING6 PATH_TO_NSLOOKUP PATH_TO_UPTIME PATH_TO_RPCINFO PATH_TO_LMSTAT PATH_TO_SMBCLIENT PATH_TO_WHO PATH_TO_SNMPGET PATH_TO_SNMPGETNEXT PATH_TO_QUAKESTAT PATH_TO_QSTAT PATH_TO_FPING PATH_TO_SSH PATH_TO_MAILQ PATH_TO_QMAIL_QSTAT PATH_TO_SWAP PATH_TO_SWAPINFO PATH_TO_LSPS PATH_TO_DIG PATH_TO_APTGET EXTRAS EXTRAS_ROOT EXTRA_NETOBJS DEPLIBS USE_NLS MSGFMT GMSGFMT MSGFMT_015 GMSGFMT_015 XGETTEXT XGETTEXT_015 MSGMERGE localedir INTL_MACOSX_LIBS LIBICONV LTLIBICONV INTLLIBS LIBINTL LTLIBINTL POSUB PERLMODS_DIR GL_COND_LIBTOOL_TRUE GL_COND_LIBTOOL_FALSE ALLOCA ALLOCA_H ARPA_INET_H SYS_SOCKET_H NEED_SETGID KMEM_GROUP GETLOADAVG_LIBS GETOPT_H NETINET_IN_H STDBOOL_H HAVE__BOOL HAVE_LONG_LONG_INT HAVE_UNSIGNED_LONG_LONG_INT HAVE_INTTYPES_H HAVE_SYS_TYPES_H ABSOLUTE_STDINT_H HAVE_STDINT_H HAVE_SYS_INTTYPES_H HAVE_SYS_BITYPES_H BITSIZEOF_PTRDIFF_T BITSIZEOF_SIG_ATOMIC_T BITSIZEOF_SIZE_T BITSIZEOF_WCHAR_T BITSIZEOF_WINT_T HAVE_SIGNED_SIG_ATOMIC_T HAVE_SIGNED_WCHAR_T HAVE_SIGNED_WINT_T PTRDIFF_T_SUFFIX SIG_ATOMIC_T_SUFFIX SIZE_T_SUFFIX WCHAR_T_SUFFIX WINT_T_SUFFIX STDINT_H MKDIR_P UNISTD_H ABSOLUTE_UNISTD_H EOVERFLOW ABSOLUTE_WCHAR_H WCHAR_H HAVE_WINT_T ABSOLUTE_WCTYPE_H HAVE_WCTYPE_H WCTYPE_H LIBGNU_LIBDEPS LIBGNU_LTLIBDEPS LTLIBOBJS gl_LIBOBJS gl_LTLIBOBJS'
ac_subst_files=''
# Initialize some variables set by options.
@ -957,7 +957,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
\`configure' configures nagios-plugins 1.4.8 to adapt to many kinds of systems.
\`configure' configures nagios-plugins 1.4.10 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@ -1023,7 +1023,7 @@ fi
if test -n "$ac_init_help"; then
case $ac_init_help in
short | recursive ) echo "Configuration of nagios-plugins 1.4.8:";;
short | recursive ) echo "Configuration of nagios-plugins 1.4.10:";;
esac
cat <<\_ACEOF
@ -1047,6 +1047,8 @@ Optional Features:
--enable-redhat-pthread-workaround
force Redhat patch to be applied (default: test
system)
--enable-perl-modules Enables installation of Nagios::Plugin and its
dependencies (default: no)
Optional Packages:
--with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
@ -1068,6 +1070,7 @@ Optional Packages:
--with-mysql=DIR Locates mysql libraries. Expects
DIR/bin/mysql_config. Default to search for
mysql_config in PATH
--with-ipv6 support IPv6 [default=check]
--with-ps-command=PATH Verbatim command to execute for ps
--with-ps-format=FORMAT Format string for scanning ps output
--with-ps-cols=NUM Number of columns in ps command
@ -1209,7 +1212,7 @@ fi
test -n "$ac_init_help" && exit 0
if $ac_init_version; then
cat <<\_ACEOF
nagios-plugins configure 1.4.8
nagios-plugins configure 1.4.10
generated by GNU Autoconf 2.59
Copyright (C) 2003 Free Software Foundation, Inc.
@ -1223,7 +1226,7 @@ cat >&5 <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
It was created by nagios-plugins $as_me 1.4.8, which was
It was created by nagios-plugins $as_me 1.4.10, which was
generated by GNU Autoconf 2.59. Invocation command line was
$ $0 $@
@ -1891,7 +1894,7 @@ fi
# Define the identity of the package.
PACKAGE='nagios-plugins'
VERSION='1.4.8'
VERSION='1.4.10'
cat >>confdefs.h <<_ACEOF
@ -4698,7 +4701,7 @@ ia64-*-hpux*)
;;
*-*-irix6*)
# Find out which ABI we are using.
echo '#line 4701 "configure"' > conftest.$ac_ext
echo '#line 4704 "configure"' > conftest.$ac_ext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
(eval $ac_compile) 2>&5
ac_status=$?
@ -5818,7 +5821,7 @@ fi
# Provide some information about the compiler.
echo "$as_me:5821:" \
echo "$as_me:5824:" \
"checking for Fortran 77 compiler version" >&5
ac_compiler=`set X $ac_compile; echo $2`
{ (eval echo "$as_me:$LINENO: \"$ac_compiler --version </dev/null >&5\"") >&5
@ -6879,11 +6882,11 @@ else
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
(eval echo "\"\$as_me:6882: $lt_compile\"" >&5)
(eval echo "\"\$as_me:6885: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
echo "$as_me:6886: \$? = $ac_status" >&5
echo "$as_me:6889: \$? = $ac_status" >&5
if (exit $ac_status) && test -s "$ac_outfile"; then
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings other than the usual output.
@ -7147,11 +7150,11 @@ else
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
(eval echo "\"\$as_me:7150: $lt_compile\"" >&5)
(eval echo "\"\$as_me:7153: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
echo "$as_me:7154: \$? = $ac_status" >&5
echo "$as_me:7157: \$? = $ac_status" >&5
if (exit $ac_status) && test -s "$ac_outfile"; then
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings other than the usual output.
@ -7251,11 +7254,11 @@ else
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
(eval echo "\"\$as_me:7254: $lt_compile\"" >&5)
(eval echo "\"\$as_me:7257: $lt_compile\"" >&5)
(eval "$lt_compile" 2>out/conftest.err)
ac_status=$?
cat out/conftest.err >&5
echo "$as_me:7258: \$? = $ac_status" >&5
echo "$as_me:7261: \$? = $ac_status" >&5
if (exit $ac_status) && test -s out/conftest2.$ac_objext
then
# The compiler can only warn and ignore the option if not recognized
@ -9576,7 +9579,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<EOF
#line 9579 "configure"
#line 9582 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@ -9676,7 +9679,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<EOF
#line 9679 "configure"
#line 9682 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@ -12014,11 +12017,11 @@ else
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
(eval echo "\"\$as_me:12017: $lt_compile\"" >&5)
(eval echo "\"\$as_me:12020: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
echo "$as_me:12021: \$? = $ac_status" >&5
echo "$as_me:12024: \$? = $ac_status" >&5
if (exit $ac_status) && test -s "$ac_outfile"; then
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings other than the usual output.
@ -12118,11 +12121,11 @@ else
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
(eval echo "\"\$as_me:12121: $lt_compile\"" >&5)
(eval echo "\"\$as_me:12124: $lt_compile\"" >&5)
(eval "$lt_compile" 2>out/conftest.err)
ac_status=$?
cat out/conftest.err >&5
echo "$as_me:12125: \$? = $ac_status" >&5
echo "$as_me:12128: \$? = $ac_status" >&5
if (exit $ac_status) && test -s out/conftest2.$ac_objext
then
# The compiler can only warn and ignore the option if not recognized
@ -13679,11 +13682,11 @@ else
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
(eval echo "\"\$as_me:13682: $lt_compile\"" >&5)
(eval echo "\"\$as_me:13685: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
echo "$as_me:13686: \$? = $ac_status" >&5
echo "$as_me:13689: \$? = $ac_status" >&5
if (exit $ac_status) && test -s "$ac_outfile"; then
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings other than the usual output.
@ -13783,11 +13786,11 @@ else
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
(eval echo "\"\$as_me:13786: $lt_compile\"" >&5)
(eval echo "\"\$as_me:13789: $lt_compile\"" >&5)
(eval "$lt_compile" 2>out/conftest.err)
ac_status=$?
cat out/conftest.err >&5
echo "$as_me:13790: \$? = $ac_status" >&5
echo "$as_me:13793: \$? = $ac_status" >&5
if (exit $ac_status) && test -s out/conftest2.$ac_objext
then
# The compiler can only warn and ignore the option if not recognized
@ -15973,11 +15976,11 @@ else
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
(eval echo "\"\$as_me:15976: $lt_compile\"" >&5)
(eval echo "\"\$as_me:15979: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
echo "$as_me:15980: \$? = $ac_status" >&5
echo "$as_me:15983: \$? = $ac_status" >&5
if (exit $ac_status) && test -s "$ac_outfile"; then
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings other than the usual output.
@ -16241,11 +16244,11 @@ else
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
(eval echo "\"\$as_me:16244: $lt_compile\"" >&5)
(eval echo "\"\$as_me:16247: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
echo "$as_me:16248: \$? = $ac_status" >&5
echo "$as_me:16251: \$? = $ac_status" >&5
if (exit $ac_status) && test -s "$ac_outfile"; then
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings other than the usual output.
@ -16345,11 +16348,11 @@ else
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
(eval echo "\"\$as_me:16348: $lt_compile\"" >&5)
(eval echo "\"\$as_me:16351: $lt_compile\"" >&5)
(eval "$lt_compile" 2>out/conftest.err)
ac_status=$?
cat out/conftest.err >&5
echo "$as_me:16352: \$? = $ac_status" >&5
echo "$as_me:16355: \$? = $ac_status" >&5
if (exit $ac_status) && test -s out/conftest2.$ac_objext
then
# The compiler can only warn and ignore the option if not recognized
@ -20270,7 +20273,7 @@ fi
echo "$as_me:$LINENO: result: $ac_cv_lib_tap_plan_tests" >&5
echo "${ECHO_T}$ac_cv_lib_tap_plan_tests" >&6
if test $ac_cv_lib_tap_plan_tests = yes; then
EXTRA_TEST="test_utils test_disk"
EXTRA_TEST="test_utils test_disk test_tcp test_cmd"
fi
@ -20996,10 +20999,89 @@ if test "$ac_cv_lib_radiusclient_rc_read_config" = "yes"; then
RADIUSLIBS="-lradiusclient"
else
{ echo "$as_me:$LINENO: WARNING: Skipping radius plugin" >&5
echo "$as_me:$LINENO: checking for rc_read_config in -lradiusclient-ng" >&5
echo $ECHO_N "checking for rc_read_config in -lradiusclient-ng... $ECHO_C" >&6
if test "${ac_cv_lib_radiusclient_ng_rc_read_config+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
ac_check_lib_save_LIBS=$LIBS
LIBS="-lradiusclient-ng $LIBS"
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
/* Override any gcc2 internal prototype to avoid an error. */
#ifdef __cplusplus
extern "C"
#endif
/* We use char because int might match the return type of a gcc2
builtin and then its argument prototype would still apply. */
char rc_read_config ();
int
main ()
{
rc_read_config ();
;
return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
(eval $ac_link) 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; } &&
{ ac_try='test -s conftest$ac_exeext'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
ac_cv_lib_radiusclient_ng_rc_read_config=yes
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
ac_cv_lib_radiusclient_ng_rc_read_config=no
fi
rm -f conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
echo "$as_me:$LINENO: result: $ac_cv_lib_radiusclient_ng_rc_read_config" >&5
echo "${ECHO_T}$ac_cv_lib_radiusclient_ng_rc_read_config" >&6
if test $ac_cv_lib_radiusclient_ng_rc_read_config = yes; then
cat >>confdefs.h <<_ACEOF
#define HAVE_LIBRADIUSCLIENT_NG 1
_ACEOF
LIBS="-lradiusclient-ng $LIBS"
fi
if test "$ac_cv_lib_radiusclient_ng_rc_read_config" = "yes"; then
EXTRAS="$EXTRAS check_radius"
RADIUSLIBS="-lradiusclient-ng"
else
{ echo "$as_me:$LINENO: WARNING: Skipping radius plugin" >&5
echo "$as_me: WARNING: Skipping radius plugin" >&2;}
{ echo "$as_me:$LINENO: WARNING: install radius libs to compile this plugin (see REQUIREMENTS)." >&5
{ echo "$as_me:$LINENO: WARNING: install radius libs to compile this plugin (see REQUIREMENTS)." >&5
echo "$as_me: WARNING: install radius libs to compile this plugin (see REQUIREMENTS)." >&2;}
fi
fi
LIBS="$_SAVEDLIBS"
@ -21290,6 +21372,304 @@ echo "$as_me: WARNING: install LDAP libs to compile this plugin (see REQUIREMENT
fi
LIBS="$_SAVEDLIBS"
if test "${ac_cv_header_linux_hdreg_h+set}" = set; then
echo "$as_me:$LINENO: checking for linux/hdreg.h" >&5
echo $ECHO_N "checking for linux/hdreg.h... $ECHO_C" >&6
if test "${ac_cv_header_linux_hdreg_h+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
fi
echo "$as_me:$LINENO: result: $ac_cv_header_linux_hdreg_h" >&5
echo "${ECHO_T}$ac_cv_header_linux_hdreg_h" >&6
else
# Is the header compilable?
echo "$as_me:$LINENO: checking linux/hdreg.h usability" >&5
echo $ECHO_N "checking linux/hdreg.h usability... $ECHO_C" >&6
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
$ac_includes_default
#include <linux/hdreg.h>
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
(eval $ac_compile) 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; } &&
{ ac_try='test -s conftest.$ac_objext'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
ac_header_compiler=yes
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
ac_header_compiler=no
fi
rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
echo "${ECHO_T}$ac_header_compiler" >&6
# Is the header present?
echo "$as_me:$LINENO: checking linux/hdreg.h presence" >&5
echo $ECHO_N "checking linux/hdreg.h presence... $ECHO_C" >&6
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
#include <linux/hdreg.h>
_ACEOF
if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
(eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } >/dev/null; then
if test -s conftest.err; then
ac_cpp_err=$ac_c_preproc_warn_flag
ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
else
ac_cpp_err=
fi
else
ac_cpp_err=yes
fi
if test -z "$ac_cpp_err"; then
ac_header_preproc=yes
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
ac_header_preproc=no
fi
rm -f conftest.err conftest.$ac_ext
echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
echo "${ECHO_T}$ac_header_preproc" >&6
# So? What about this header?
case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
yes:no: )
{ echo "$as_me:$LINENO: WARNING: linux/hdreg.h: accepted by the compiler, rejected by the preprocessor!" >&5
echo "$as_me: WARNING: linux/hdreg.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
{ echo "$as_me:$LINENO: WARNING: linux/hdreg.h: proceeding with the compiler's result" >&5
echo "$as_me: WARNING: linux/hdreg.h: proceeding with the compiler's result" >&2;}
ac_header_preproc=yes
;;
no:yes:* )
{ echo "$as_me:$LINENO: WARNING: linux/hdreg.h: present but cannot be compiled" >&5
echo "$as_me: WARNING: linux/hdreg.h: present but cannot be compiled" >&2;}
{ echo "$as_me:$LINENO: WARNING: linux/hdreg.h: check for missing prerequisite headers?" >&5
echo "$as_me: WARNING: linux/hdreg.h: check for missing prerequisite headers?" >&2;}
{ echo "$as_me:$LINENO: WARNING: linux/hdreg.h: see the Autoconf documentation" >&5
echo "$as_me: WARNING: linux/hdreg.h: see the Autoconf documentation" >&2;}
{ echo "$as_me:$LINENO: WARNING: linux/hdreg.h: section \"Present But Cannot Be Compiled\"" >&5
echo "$as_me: WARNING: linux/hdreg.h: section \"Present But Cannot Be Compiled\"" >&2;}
{ echo "$as_me:$LINENO: WARNING: linux/hdreg.h: proceeding with the preprocessor's result" >&5
echo "$as_me: WARNING: linux/hdreg.h: proceeding with the preprocessor's result" >&2;}
{ echo "$as_me:$LINENO: WARNING: linux/hdreg.h: in the future, the compiler will take precedence" >&5
echo "$as_me: WARNING: linux/hdreg.h: in the future, the compiler will take precedence" >&2;}
(
cat <<\_ASBOX
## ----------------------------------------- ##
## Report this to the nagios-plugins lists. ##
## ----------------------------------------- ##
_ASBOX
) |
sed "s/^/$as_me: WARNING: /" >&2
;;
esac
echo "$as_me:$LINENO: checking for linux/hdreg.h" >&5
echo $ECHO_N "checking for linux/hdreg.h... $ECHO_C" >&6
if test "${ac_cv_header_linux_hdreg_h+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
ac_cv_header_linux_hdreg_h=$ac_header_preproc
fi
echo "$as_me:$LINENO: result: $ac_cv_header_linux_hdreg_h" >&5
echo "${ECHO_T}$ac_cv_header_linux_hdreg_h" >&6
fi
if test $ac_cv_header_linux_hdreg_h = yes; then
FOUNDINCLUDE=yes
else
FOUNDINCLUDE=no
fi
if test "$FOUNDINCLUDE" = "yes" ; then
if test "${ac_cv_header_linux_types_h+set}" = set; then
echo "$as_me:$LINENO: checking for linux/types.h" >&5
echo $ECHO_N "checking for linux/types.h... $ECHO_C" >&6
if test "${ac_cv_header_linux_types_h+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
fi
echo "$as_me:$LINENO: result: $ac_cv_header_linux_types_h" >&5
echo "${ECHO_T}$ac_cv_header_linux_types_h" >&6
else
# Is the header compilable?
echo "$as_me:$LINENO: checking linux/types.h usability" >&5
echo $ECHO_N "checking linux/types.h usability... $ECHO_C" >&6
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
$ac_includes_default
#include <linux/types.h>
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
(eval $ac_compile) 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; } &&
{ ac_try='test -s conftest.$ac_objext'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
ac_header_compiler=yes
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
ac_header_compiler=no
fi
rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
echo "${ECHO_T}$ac_header_compiler" >&6
# Is the header present?
echo "$as_me:$LINENO: checking linux/types.h presence" >&5
echo $ECHO_N "checking linux/types.h presence... $ECHO_C" >&6
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
#include <linux/types.h>
_ACEOF
if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
(eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } >/dev/null; then
if test -s conftest.err; then
ac_cpp_err=$ac_c_preproc_warn_flag
ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
else
ac_cpp_err=
fi
else
ac_cpp_err=yes
fi
if test -z "$ac_cpp_err"; then
ac_header_preproc=yes
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
ac_header_preproc=no
fi
rm -f conftest.err conftest.$ac_ext
echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
echo "${ECHO_T}$ac_header_preproc" >&6
# So? What about this header?
case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
yes:no: )
{ echo "$as_me:$LINENO: WARNING: linux/types.h: accepted by the compiler, rejected by the preprocessor!" >&5
echo "$as_me: WARNING: linux/types.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
{ echo "$as_me:$LINENO: WARNING: linux/types.h: proceeding with the compiler's result" >&5
echo "$as_me: WARNING: linux/types.h: proceeding with the compiler's result" >&2;}
ac_header_preproc=yes
;;
no:yes:* )
{ echo "$as_me:$LINENO: WARNING: linux/types.h: present but cannot be compiled" >&5
echo "$as_me: WARNING: linux/types.h: present but cannot be compiled" >&2;}
{ echo "$as_me:$LINENO: WARNING: linux/types.h: check for missing prerequisite headers?" >&5
echo "$as_me: WARNING: linux/types.h: check for missing prerequisite headers?" >&2;}
{ echo "$as_me:$LINENO: WARNING: linux/types.h: see the Autoconf documentation" >&5
echo "$as_me: WARNING: linux/types.h: see the Autoconf documentation" >&2;}
{ echo "$as_me:$LINENO: WARNING: linux/types.h: section \"Present But Cannot Be Compiled\"" >&5
echo "$as_me: WARNING: linux/types.h: section \"Present But Cannot Be Compiled\"" >&2;}
{ echo "$as_me:$LINENO: WARNING: linux/types.h: proceeding with the preprocessor's result" >&5
echo "$as_me: WARNING: linux/types.h: proceeding with the preprocessor's result" >&2;}
{ echo "$as_me:$LINENO: WARNING: linux/types.h: in the future, the compiler will take precedence" >&5
echo "$as_me: WARNING: linux/types.h: in the future, the compiler will take precedence" >&2;}
(
cat <<\_ASBOX
## ----------------------------------------- ##
## Report this to the nagios-plugins lists. ##
## ----------------------------------------- ##
_ASBOX
) |
sed "s/^/$as_me: WARNING: /" >&2
;;
esac
echo "$as_me:$LINENO: checking for linux/types.h" >&5
echo $ECHO_N "checking for linux/types.h... $ECHO_C" >&6
if test "${ac_cv_header_linux_types_h+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
ac_cv_header_linux_types_h=$ac_header_preproc
fi
echo "$as_me:$LINENO: result: $ac_cv_header_linux_types_h" >&5
echo "${ECHO_T}$ac_cv_header_linux_types_h" >&6
fi
if test $ac_cv_header_linux_types_h = yes; then
FOUNDINCLUDE=yes
else
FOUNDINCLUDE=no
fi
fi
if test "$FOUNDINCLUDE" = "yes" ; then
EXTRAS="$EXTRAS check_ide_smart"
else
{ echo "$as_me:$LINENO: WARNING: Skipping check_ide_smart plugin." >&5
echo "$as_me: WARNING: Skipping check_ide_smart plugin." >&2;}
{ echo "$as_me:$LINENO: WARNING: check_ide_smart is linux specific. It requires linux/hdreg.h and linux/types.h." >&5
echo "$as_me: WARNING: check_ide_smart is linux specific. It requires linux/hdreg.h and linux/types.h." >&2;}
fi
# Check whether --with-mysql or --without-mysql was given.
@ -21447,7 +21827,7 @@ echo "$as_me: WARNING: Skipping mysql plugin" >&2;}
{ echo "$as_me:$LINENO: WARNING: install mysql client libs to compile this plugin (see REQUIREMENTS)." >&5
echo "$as_me: WARNING: install mysql client libs to compile this plugin (see REQUIREMENTS)." >&2;}
else
EXTRAS="$EXTRA check_mysql check_mysql_query"
EXTRAS="$EXTRAS check_mysql check_mysql_query"
MYSQLINCLUDE="$np_mysql_include"
MYSQLLIBS="$np_mysql_libs"
MYSQLCFLAGS="$np_mysql_cflags"
@ -21456,13 +21836,23 @@ else
fi
echo "$as_me:$LINENO: checking for IPv6 support" >&5
echo $ECHO_N "checking for IPv6 support... $ECHO_C" >&6
# Check whether --with-ipv6 or --without-ipv6 was given.
if test "${with_ipv6+set}" = set; then
withval="$with_ipv6"
else
with_ipv6=check
fi;
if test "$with_ipv6" != "no"; then
echo "$as_me:$LINENO: checking for IPv6 support" >&5
echo $ECHO_N "checking for IPv6 support... $ECHO_C" >&6
if test "${np_cv_sys_ipv6+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
cat >conftest.$ac_ext <<_ACEOF
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
@ -21507,25 +21897,33 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
with_ipv6=yes
np_cv_sys_ipv6=yes
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
with_ipv6=no
np_cv_sys_ipv6=no
fi
rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
fi
echo "$as_me:$LINENO: result: $with_ipv6" >&5
echo "${ECHO_T}$with_ipv6" >&6
if test x"$with_ipv6" != xno ; then
echo "$as_me:$LINENO: result: $np_cv_sys_ipv6" >&5
echo "${ECHO_T}$np_cv_sys_ipv6" >&6
if test "$np_cv_sys_ipv6" = "no" -a "$with_ipv6" != "check"; then
{ { echo "$as_me:$LINENO: error: --with-ipv6 was given, but test for IPv6 support failed
See \`config.log' for more details." >&5
echo "$as_me: error: --with-ipv6 was given, but test for IPv6 support failed
See \`config.log' for more details." >&2;}
{ (exit 1); exit 1; }; }
fi
if test "$np_cv_sys_ipv6" = "yes"; then
cat >>confdefs.h <<\_ACEOF
#define USE_IPV6 1
_ACEOF
fi
with_ipv6="$np_cv_sys_ipv6"
fi
@ -24722,6 +25120,61 @@ _ACEOF
fi
echo "$as_me:$LINENO: checking for number of cpus" >&5
echo $ECHO_N "checking for number of cpus... $ECHO_C" >&6
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
#include <unistd.h>
int
main ()
{
sysconf(_SC_NPROCESSORS_CONF) > 0;
;
return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
(eval $ac_compile) 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; } &&
{ ac_try='test -s conftest.$ac_objext'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
cat >>confdefs.h <<\_ACEOF
#define HAVE_SYSCONF__SC_NPROCESSORS_CONF 1
_ACEOF
echo "$as_me:$LINENO: result: sysconf(_SC_NPROCESSORS_CONF)" >&5
echo "${ECHO_T}sysconf(_SC_NPROCESSORS_CONF)" >&6
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
echo "$as_me:$LINENO: result: cannot calculate" >&5
echo "${ECHO_T}cannot calculate" >&6
fi
rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
# Extract the first word of "uptime", so it can be a program name with args.
set dummy uptime; ac_word=$2
echo "$as_me:$LINENO: checking for $ac_word" >&5
@ -26504,6 +26957,156 @@ elif test -f ../plugins/check_nt.c ; then
fi
for ac_header in sys/sockio.h
do
as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
if eval "test \"\${$as_ac_Header+set}\" = set"; then
echo "$as_me:$LINENO: checking for $ac_header" >&5
echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
if eval "test \"\${$as_ac_Header+set}\" = set"; then
echo $ECHO_N "(cached) $ECHO_C" >&6
fi
echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
else
# Is the header compilable?
echo "$as_me:$LINENO: checking $ac_header usability" >&5
echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
$ac_includes_default
#include <$ac_header>
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
(eval $ac_compile) 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; } &&
{ ac_try='test -s conftest.$ac_objext'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
ac_header_compiler=yes
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
ac_header_compiler=no
fi
rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
echo "${ECHO_T}$ac_header_compiler" >&6
# Is the header present?
echo "$as_me:$LINENO: checking $ac_header presence" >&5
echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
#include <$ac_header>
_ACEOF
if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
(eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } >/dev/null; then
if test -s conftest.err; then
ac_cpp_err=$ac_c_preproc_warn_flag
ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
else
ac_cpp_err=
fi
else
ac_cpp_err=yes
fi
if test -z "$ac_cpp_err"; then
ac_header_preproc=yes
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
ac_header_preproc=no
fi
rm -f conftest.err conftest.$ac_ext
echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
echo "${ECHO_T}$ac_header_preproc" >&6
# So? What about this header?
case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
yes:no: )
{ echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
{ echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
ac_header_preproc=yes
;;
no:yes:* )
{ echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
{ echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
{ echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
{ echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5
echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;}
{ echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
{ echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
(
cat <<\_ASBOX
## ----------------------------------------- ##
## Report this to the nagios-plugins lists. ##
## ----------------------------------------- ##
_ASBOX
) |
sed "s/^/$as_me: WARNING: /" >&2
;;
esac
echo "$as_me:$LINENO: checking for $ac_header" >&5
echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
if eval "test \"\${$as_ac_Header+set}\" = set"; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
eval "$as_ac_Header=\$ac_header_preproc"
fi
echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
fi
if test `eval echo '${'$as_ac_Header'}'` = yes; then
cat >>confdefs.h <<_ACEOF
#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
_ACEOF
fi
done
case $host in
*bsd*)
@ -28577,6 +29180,18 @@ _ACEOF
fi
# Check whether --enable-perl-modules or --disable-perl-modules was given.
if test "${enable_perl_modules+set}" = set; then
enableval="$enable_perl_modules"
enable_perl_modules=$enableval
else
enable_perl_modules=no
fi;
if test "$enable_perl_modules" = "yes" ; then
PERLMODS_DIR=perlmods
fi
# The Ultrix 4.2 mips builtin alloca declared by alloca.h only works
# for constant arguments. Useless!
echo "$as_me:$LINENO: checking for working alloca.h" >&5
@ -44274,7 +44889,7 @@ echo "$as_me: error: No ar found for Solaris - is /usr/ccs/bin in PATH?" >&2;}
{ (exit 1); exit 1; }; }
fi
ac_config_files="$ac_config_files Makefile lib/Makefile plugins/Makefile lib/tests/Makefile plugins-root/Makefile plugins-scripts/Makefile plugins-scripts/subst plugins-scripts/utils.pm plugins-scripts/utils.sh command.cfg test.pl pkg/solaris/pkginfo po/Makefile.in"
ac_config_files="$ac_config_files Makefile lib/Makefile plugins/Makefile lib/tests/Makefile plugins-root/Makefile plugins-scripts/Makefile plugins-scripts/subst plugins-scripts/utils.pm plugins-scripts/utils.sh perlmods/Makefile command.cfg test.pl pkg/solaris/pkginfo po/Makefile.in"
cat >confcache <<\_ACEOF
# This file is a shell script that caches the results of configure
# tests run on this system so they can be shared between configure
@ -44681,7 +45296,7 @@ _ASBOX
} >&5
cat >&5 <<_CSEOF
This file was extended by nagios-plugins $as_me 1.4.8, which was
This file was extended by nagios-plugins $as_me 1.4.10, which was
generated by GNU Autoconf 2.59. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
@ -44744,7 +45359,7 @@ _ACEOF
cat >>$CONFIG_STATUS <<_ACEOF
ac_cs_version="\\
nagios-plugins config.status 1.4.8
nagios-plugins config.status 1.4.10
configured by $0, generated by GNU Autoconf 2.59,
with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\"
@ -44871,6 +45486,7 @@ do
"plugins-scripts/subst" ) CONFIG_FILES="$CONFIG_FILES plugins-scripts/subst" ;;
"plugins-scripts/utils.pm" ) CONFIG_FILES="$CONFIG_FILES plugins-scripts/utils.pm" ;;
"plugins-scripts/utils.sh" ) CONFIG_FILES="$CONFIG_FILES plugins-scripts/utils.sh" ;;
"perlmods/Makefile" ) CONFIG_FILES="$CONFIG_FILES perlmods/Makefile" ;;
"command.cfg" ) CONFIG_FILES="$CONFIG_FILES command.cfg" ;;
"test.pl" ) CONFIG_FILES="$CONFIG_FILES test.pl" ;;
"pkg/solaris/pkginfo" ) CONFIG_FILES="$CONFIG_FILES pkg/solaris/pkginfo" ;;
@ -45104,6 +45720,7 @@ s,@INTLLIBS@,$INTLLIBS,;t t
s,@LIBINTL@,$LIBINTL,;t t
s,@LTLIBINTL@,$LTLIBINTL,;t t
s,@POSUB@,$POSUB,;t t
s,@PERLMODS_DIR@,$PERLMODS_DIR,;t t
s,@GL_COND_LIBTOOL_TRUE@,$GL_COND_LIBTOOL_TRUE,;t t
s,@GL_COND_LIBTOOL_FALSE@,$GL_COND_LIBTOOL_FALSE,;t t
s,@ALLOCA@,$ALLOCA,;t t
@ -45995,6 +46612,7 @@ echo " --with-mysql: $with_mysql"
echo " --with-openssl: $with_openssl"
echo " --with-gnutls: $with_gnutls"
echo " --with-perl: $with_perl"
echo " --enable-perl-modules: $enable_perl_modules"
echo " --with-cgiurl: $with_cgiurl"
echo " --with-trusted-path: $with_trusted_path"

View file

@ -1,7 +1,7 @@
dnl Process this file with autoconf to produce a configure script.
AC_REVISION ($Revision: 1.213 $)
AC_REVISION ($Revision: 1801 $)
AC_PREREQ(2.59)
AC_INIT(nagios-plugins,1.4.8)
AC_INIT(nagios-plugins,1.4.10)
AC_CONFIG_SRCDIR(NPTest.pm)
AC_CONFIG_FILES(gl/Makefile)
AC_CONFIG_AUX_DIR(build-aux)
@ -155,7 +155,7 @@ AC_SUBST(MATHLIBS)
dnl Check for libtap, to run perl-like tests
AC_CHECK_LIB(tap, plan_tests,
EXTRA_TEST="test_utils test_disk"
EXTRA_TEST="test_utils test_disk test_tcp test_cmd"
AC_SUBST(EXTRA_TEST)
)
@ -218,8 +218,15 @@ if test "$ac_cv_lib_radiusclient_rc_read_config" = "yes"; then
RADIUSLIBS="-lradiusclient"
AC_SUBST(RADIUSLIBS)
else
AC_MSG_WARN([Skipping radius plugin])
AC_MSG_WARN([install radius libs to compile this plugin (see REQUIREMENTS).])
AC_CHECK_LIB(radiusclient-ng,rc_read_config)
if test "$ac_cv_lib_radiusclient_ng_rc_read_config" = "yes"; then
EXTRAS="$EXTRAS check_radius"
RADIUSLIBS="-lradiusclient-ng"
AC_SUBST(RADIUSLIBS)
else
AC_MSG_WARN([Skipping radius plugin])
AC_MSG_WARN([install radius libs to compile this plugin (see REQUIREMENTS).])
fi
fi
LIBS="$_SAVEDLIBS"
@ -240,13 +247,26 @@ else
fi
LIBS="$_SAVEDLIBS"
dnl Check for headers used by check_ide_smart
AC_CHECK_HEADER(linux/hdreg.h, FOUNDINCLUDE=yes, FOUNDINCLUDE=no)
if test "$FOUNDINCLUDE" = "yes" ; then
AC_CHECK_HEADER(linux/types.h, FOUNDINCLUDE=yes, FOUNDINCLUDE=no)
fi
if test "$FOUNDINCLUDE" = "yes" ; then
EXTRAS="$EXTRAS check_ide_smart"
else
AC_MSG_WARN([Skipping check_ide_smart plugin.])
AC_MSG_WARN([check_ide_smart is linux specific. It requires linux/hdreg.h and linux/types.h.])
fi
dnl Check for mysql libraries
np_mysqlclient
if test $with_mysql = "no" ; then
AC_MSG_WARN([Skipping mysql plugin])
AC_MSG_WARN([install mysql client libs to compile this plugin (see REQUIREMENTS).])
else
EXTRAS="$EXTRA check_mysql check_mysql_query"
EXTRAS="$EXTRAS check_mysql check_mysql_query"
MYSQLINCLUDE="$np_mysql_include"
MYSQLLIBS="$np_mysql_libs"
MYSQLCFLAGS="$np_mysql_cflags"
@ -255,9 +275,15 @@ else
AC_SUBST(MYSQLCFLAGS)
fi
AC_ARG_WITH([ipv6],
[AS_HELP_STRING([--with-ipv6], [support IPv6 @<:@default=check@:>@])],
[], [with_ipv6=check])
dnl Check for AF_INET6 support - unistd.h required for Darwin
AC_CACHE_CHECK([for IPv6 support], with_ipv6, [
AC_TRY_COMPILE([#ifdef HAVE_UNISTD_H
if test "$with_ipv6" != "no"; then
AC_CACHE_CHECK([for IPv6 support], np_cv_sys_ipv6, [
AC_TRY_COMPILE(
[#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#include <netinet/in.h>
@ -268,12 +294,16 @@ AC_CACHE_CHECK([for IPv6 support], with_ipv6, [
sin6.sin6_family = AF_INET6;
sin6.sin6_port = 587;
p = &sin6.sin6_addr;],
[with_ipv6=yes],
[with_ipv6=no])
])
if test x"$with_ipv6" != xno ; then
AC_DEFINE(USE_IPV6,1,[Enable IPv6 support])
[np_cv_sys_ipv6=yes],
[np_cv_sys_ipv6=no])
])
if test "$np_cv_sys_ipv6" = "no" -a "$with_ipv6" != "check"; then
AC_MSG_FAILURE([--with-ipv6 was given, but test for IPv6 support failed])
fi
if test "$np_cv_sys_ipv6" = "yes"; then
AC_DEFINE(USE_IPV6,1,[Enable IPv6 support])
fi
with_ipv6="$np_cv_sys_ipv6"
fi
@ -1054,6 +1084,14 @@ if test -n "$ac_cv_nslookup_command"; then
AC_DEFINE_UNQUOTED(NSLOOKUP_COMMAND,"$ac_cv_nslookup_command", [path and args for nslookup])
fi
AC_MSG_CHECKING([for number of cpus])
AC_TRY_COMPILE([#include <unistd.h>],
[sysconf(_SC_NPROCESSORS_CONF) > 0;],
AC_DEFINE(HAVE_SYSCONF__SC_NPROCESSORS_CONF,1,[Define if sysconf returns number of cpus])
AC_MSG_RESULT([sysconf(_SC_NPROCESSORS_CONF)]),
AC_MSG_RESULT([cannot calculate])
)
AC_PATH_PROG(PATH_TO_UPTIME,uptime)
AC_ARG_WITH(uptime_command,
ACX_HELP_STRING([--with-uptime-command=PATH],
@ -1429,6 +1467,9 @@ elif test -f ../plugins/check_nt.c ; then
fi
dnl used in check_dhcp
AC_CHECK_HEADERS(sys/sockio.h)
case $host in
*bsd*)
AC_DEFINE(__bsd__,1,[bsd specific code in check_dhcp.c])
@ -1450,7 +1491,7 @@ AC_SUBST(EXTRA_NETOBJS)
AC_SUBST(DEPLIBS)
AM_GNU_GETTEXT([external], [need-ngettext])
AM_GNU_GETTEXT_VERSION(0.13.1)
AM_GNU_GETTEXT_VERSION(0.15)
dnl Check for Redhat spopen problem
dnl Wierd problem where ECHILD is returned from a wait call in error
@ -1479,6 +1520,16 @@ elif test "$ac_cv_enable_redhat_pthread_workaround" = "yes" ; then
AC_DEFINE(REDHAT_SPOPEN_ERROR, 1, [Forced workaround on redhat in spopen])
fi
dnl Perl modules
AC_ARG_ENABLE(perl-modules,
AC_HELP_STRING([--enable-perl-modules],
[Enables installation of Nagios::Plugin and its dependencies (default: no)]),
[enable_perl_modules=$enableval],
[enable_perl_modules=no])
if test "$enable_perl_modules" = "yes" ; then
AC_SUBST(PERLMODS_DIR,perlmods)
fi
dnl External libraries - see ACKNOWLEDGEMENTS
gl_INIT
@ -1497,6 +1548,7 @@ AC_OUTPUT(
plugins-scripts/subst
plugins-scripts/utils.pm
plugins-scripts/utils.sh
perlmods/Makefile
command.cfg
test.pl
pkg/solaris/pkginfo
@ -1534,6 +1586,7 @@ ACX_FEATURE([with],[mysql])
ACX_FEATURE([with],[openssl])
ACX_FEATURE([with],[gnutls])
ACX_FEATURE([with],[perl])
ACX_FEATURE([enable],[perl-modules])
ACX_FEATURE([with],[cgiurl])
ACX_FEATURE([with],[trusted-path])

View file

@ -13,7 +13,7 @@ PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin
PROGNAME=`basename $0`
PROGPATH=`echo $0 | sed -e 's,[\\/][^\\/][^\\/]*$,,'`
REVISION=`echo '$Revision: 1.1 $' | sed -e 's/[^0-9.]//g'`
REVISION=`echo '$Revision: 302 $' | sed -e 's/[^0-9.]//g'`
. $PROGPATH/utils.sh

View file

@ -13,7 +13,7 @@ use strict;
use Getopt::Long;
use vars qw($opt_V $opt_h $opt_H $opt_T $opt_t $opt_R $opt_r
$opt_L $opt_l $PROGNAME);
use lib utils.pm;
use lib "/usr/local/nagios/libexec";
use utils qw(%ERRORS &print_revision &support &usage);
sub print_help ();
@ -38,7 +38,7 @@ GetOptions
"H=s" => \$opt_H, "hostname=s" => \$opt_H);
if ($opt_V) {
print_revision($PROGNAME,'$Revision: 1.2 $');
print_revision($PROGNAME,'$Revision: 1771 $');
exit $ERRORS{'OK'};
}
@ -252,7 +252,7 @@ sub print_usage () {
}
sub print_help () {
print_revision($PROGNAME,'$Revision: 1.2 $');
print_revision($PROGNAME,'$Revision: 1771 $');
print "Copyright (c) 2001 Gerald Combs/Jeffrey Blank/Karl DeBisschop
This plugin reports the status of an APC UPS equipped with an SNMP management

View file

@ -9,7 +9,7 @@
# using "aecho"
#
# initial version: 23 October 2002 by Stefan Beck, IT Software Solutions
# current status: $Revision: 1.1 $
# current status: $Revision: 1771 $
#
# Copyright Notice: GPL
#
@ -22,7 +22,7 @@ BEGIN {
}
use strict;
use lib utils.pm;
use lib "/usr/local/nagios/libexec";
use utils qw($TIMEOUT %ERRORS &print_revision &support);
use vars qw($PROGNAME);
@ -122,7 +122,7 @@ while (<CMD>) {
}
sub print_help() {
print_revision( $PROGNAME, '$Revision: 1.1 $ ' );
print_revision( $PROGNAME, '$Revision: 1771 $ ' );
print "Copyright (c) 2002 Stefan Beck\n";
print "\n";
print "Check if an atalkhost responds to an atalk echo using\n";
@ -159,7 +159,7 @@ sub print_usage () {
}
sub version () {
print_revision( $PROGNAME, '$Revision: 1.1 $ ' );
print_revision( $PROGNAME, '$Revision: 1771 $ ' );
exit $ERRORS{'OK'};
}

View file

@ -55,7 +55,7 @@ if ($status == 0)
if ($opt_V) {
print_revision($PROGNAME,'$Revision: 1.1 $ ');
print_revision($PROGNAME,'$Revision: 1112 $ ');
exit $ERRORS{'OK'};
}
@ -115,6 +115,6 @@ sub print_help {
print " -t (--timeout) Timeout in seconds.\n";
print " -V (--version) Plugin version\n";
print " -h (--help) usage help \n\n";
print_revision($PROGNAME, '$Revision: 1.1 $');
print_revision($PROGNAME, '$Revision: 1112 $');
}

View file

@ -29,9 +29,11 @@ lines=`cat $tempfile | grep -i $port`
status=`echo $lines | awk '{ print $3 }'`
if [ "$status" == "Printing" ]; then
bytes=`echo $lines | awk '{ print $4 }'`;
comments=`echo $lines | tr -d " " | awk '{ print $5 " " $6 }'`;
comments=`echo $lines | tr -d "
" | awk '{ print $5 " " $6 }'`;
else
comments=`echo $lines | tr -d " " | awk '{ print $4 " " $5 }'`;
comments=`echo $lines | tr -d "
" | awk '{ print $4 " " $5 }'`;
fi
comma=`echo $comments | grep , | wc -l`

View file

@ -0,0 +1,5 @@
check_cluster2 is now part of the core Nagios-Plugins distribution and has
been renamed check_cluster. It will be installed automatically.
The threshold format has changed and is not backward-compatible; be sure to
understand it correctly. Use --help to print the full help.

View file

@ -1,6 +1,6 @@
#!/usr/bin/perl -w
#
# $Id: check_email_loop.pl,v 1.5 2005/11/29 23:21:06 harpermann Exp $
# $Id: check_email_loop.pl 1290 2005-11-29 23:21:06Z harpermann $
#
# (c)2000 Benjamin Schmid, blueshift@gmx.net (emergency use only ;-)
# Copyleft by GNU GPL

View file

@ -111,7 +111,7 @@ sub print_usage () {
}
sub print_help () {
print_revision($PROGNAME,'$Revision: 1.1 $\n ');
print_revision($PROGNAME,'$Revision: 1113 $\n ');
print "Copyright (c) 2003 Rainer Duffner\n ";
print_usage();
print "\n";
@ -122,7 +122,7 @@ sub print_help () {
}
sub version () {
print_revision($PROGNAME,'$Revision: 1.1 $ ');
print_revision($PROGNAME,'$Revision: 1113 $ ');
exit $ERRORS{'OK'};
}

View file

@ -113,7 +113,7 @@ sub print_usage () {
}
sub print_help () {
print_revision($PROGNAME,'$Revision: 1.1 $\n ');
print_revision($PROGNAME,'$Revision: 1113 $\n ');
print "Copyright (c) 2003 Rainer Duffner\n ";
print_usage();
print "\n";
@ -124,7 +124,7 @@ sub print_help () {
}
sub version () {
print_revision($PROGNAME,'$Revision: 1.1 $ ');
print_revision($PROGNAME,'$Revision: 1113 $ ');
exit $ERRORS{'OK'};
}

View file

@ -1,6 +1,6 @@
#! /usr/bin/perl -w
#
# $Id: check_frontpage,v 1.1 2005/01/27 04:45:00 stanleyhopcroft Exp $
# $Id: check_frontpage 1112 2005-01-27 04:46:08Z stanleyhopcroft $
#
# Check that FrontPage extensions appear to be working on a specified host.
# Currently only checks that the hit counter is not returning an error.
@ -42,7 +42,7 @@ GetOptions
"H=s" => \$opt_H, "hostname=s" => \$opt_H);
if ($opt_V) {
print_revision($PROGNAME,'$Revision: 1.1 $'); #'
print_revision($PROGNAME,'$Revision: 1112 $'); #'
exit $ERRORS{'OK'};
}
@ -139,7 +139,7 @@ sub print_usage () {
}
sub print_help () {
print_revision($PROGNAME,'$Revision: 1.1 $');
print_revision($PROGNAME,'$Revision: 1112 $');
print "Copyright (c) 2003 Kev Green\n";
print "\n";
print "FrontPage remains a copyright/trademark of Microsoft Corporation.\n";

View file

@ -37,7 +37,7 @@
*****************************************************************************/
const char *progname = "check_http";
#define REVISION "$Revision: 1.1 $"
#define REVISION "$Revision: 1117 $"
#define CVSREVISION "1.24"
#define COPYRIGHT "2003"
#define AUTHORS "Fabian Pehla"

View file

@ -16,7 +16,7 @@ PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin
PROGNAME=`basename $0`
PROGPATH=`echo $0 | sed -e 's,[\\/][^\\/][^\\/]*$,,'`
REVISION=`echo '$Revision: 1.1 $' | sed -e 's/[^0-9.]//g'`
REVISION=`echo '$Revision: 939 $' | sed -e 's/[^0-9.]//g'`
. $PROGPATH/utils.sh

View file

@ -1,8 +1,8 @@
#!/usr/bin/perl -w
# $Id: check_ica_master_browser.pl,v 1.1 2005/01/25 09:09:33 stanleyhopcroft Exp $
# $Id: check_ica_master_browser.pl 1099 2005-01-25 09:09:33Z stanleyhopcroft $
# $Log: check_ica_master_browser.pl,v $
# $Log$
# Revision 1.1 2005/01/25 09:09:33 stanleyhopcroft
# New plugin - checks that ICA master browser is what it should be (important for firewalled dialup)
#
@ -170,7 +170,7 @@ sub print_usage () {
}
sub print_help () {
print_revision($PROGNAME,'$Revision: 1.1 $ ');
print_revision($PROGNAME,'$Revision: 1099 $ ');
print "Copyright (c) 2002 Ed Rolison/Tom De Blende/S Hopcroft
Perl Check Citrix Master Browser plugin for Nagios.
@ -218,7 +218,7 @@ The ICA Client requests the address of the ICA master browser from the Citrix se
}
sub version () {
print_revision($PROGNAME,'$Revision: 1.1 $ ');
print_revision($PROGNAME,'$Revision: 1099 $ ');
exit $ERRORS{'OK'};
}

View file

@ -1,8 +1,8 @@
#!/usr/bin/perl -w
# $Id: check_ica_metaframe_pub_apps.pl,v 1.1 2005/01/25 09:07:39 stanleyhopcroft Exp $
# $Id: check_ica_metaframe_pub_apps.pl 1098 2005-01-25 09:07:39Z stanleyhopcroft $
# $Log: check_ica_metaframe_pub_apps.pl,v $
# $Log$
# Revision 1.1 2005/01/25 09:07:39 stanleyhopcroft
# Replacement (structured name mainly) for check_citrix: check of ICA browse service
#
@ -303,7 +303,7 @@ sub print_usage () {
}
sub print_help () {
print_revision($PROGNAME,'$Revision: 1.1 $ ');
print_revision($PROGNAME,'$Revision: 1098 $ ');
print "Copyright (c) 2002 Ed Rolison/Tom De Blende/S Hopcroft
Perl Check Citrix plugin for Nagios.
@ -350,7 +350,7 @@ The plugin works by
}
sub version () {
print_revision($PROGNAME,'$Revision: 1.1 $ ');
print_revision($PROGNAME,'$Revision: 1098 $ ');
exit $ERRORS{'OK'};
}

View file

@ -1,8 +1,8 @@
#!/usr/bin/perl -w
# $Id: check_ica_program_neigbourhood.pl,v 1.1 2005/01/25 09:05:53 stanleyhopcroft Exp $
# $Id: check_ica_program_neigbourhood.pl 1097 2005-01-25 09:05:53Z stanleyhopcroft $
# $Log: check_ica_program_neigbourhood.pl,v $
# $Log$
# Revision 1.1 2005/01/25 09:05:53 stanleyhopcroft
# New plugin to check Citrix Metaframe XP "Program Neighbourhood"
#
@ -290,7 +290,7 @@ sub print_help() {
# 1 2 3 4 5 6 7 8
#12345678901234567890123456789012345678901234567890123456789012345678901234567890
print_revision($PROGNAME,'$Revision: 1.1 $ ');
print_revision($PROGNAME,'$Revision: 1097 $ ');
my $help = <<EOHELP ;
Copyright (c) 2004 Karl DeBisschop/S Hopcroft
@ -345,7 +345,7 @@ sub usage {
}
sub version () {
print_revision($PROGNAME,'$Revision: 1.1 $ ');
print_revision($PROGNAME,'$Revision: 1097 $ ');
exit $ERRORS{'OK'};
}

View file

@ -41,7 +41,7 @@ GetOptions
if ($opt_V) {
print_revision($PROGNAME,'$Revision: 1.1 $ ');
print_revision($PROGNAME,'$Revision: 72 $ ');
exit $ERRORS{'OK'};
}
@ -114,7 +114,7 @@ sub print_usage () {
}
sub print_help () {
print_revision($PROGNAME,'$Revision: 1.1 $');
print_revision($PROGNAME,'$Revision: 72 $');
print "Copyright (c) 2002 Andrew Ryder\n";
print "\n";
print_usage();

View file

@ -170,7 +170,7 @@ Perl Check java processes plugin for Nagios
}
sub revision() {
print_revision($PROGNAME,'$Revision: 1.1 $ ');
print_revision($PROGNAME,'$Revision: 211 $ ');
}
sub version () {

View file

@ -4,7 +4,7 @@ PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin
PROGNAME=`basename $0`
PROGPATH=`echo $0 | sed -e 's,[\\/][^\\/][^\\/]*$,,'`
REVISION=`echo '$Revision: 1.1.1.1 $' | sed -e 's/[^0-9.]//g'`
REVISION=`echo '$Revision: 2 $' | sed -e 's/[^0-9.]//g'`
STATUS=""
. $PROGPATH/utils.sh

View file

@ -23,7 +23,7 @@
# WARNING md0 status=[UUU_U], recovery=46.4%, finish=123.0min
use strict;
use lib utils.pm;
use lib "/usr/local/nagios/libexec";
use utils qw(%ERRORS);
# die with an error if we're not on Linux

View file

@ -1,6 +1,6 @@
#!/usr/bin/perl -w
#
# $Id: check_log2.pl,v 1.2 2005/12/16 18:41:45 harpermann Exp $
# $Id: check_log2.pl 1300 2005-12-16 18:41:45Z harpermann $
#
# Log file regular expression detector for Nagios.
# Written by Aaron Bostick (abostick@mydoconline.com)
@ -77,7 +77,7 @@ sub print_help ();
$neg_re_pattern = '';
$pattern_count = 0;
$pattern_line = '';
$plugin_revision = '$Revision: 1.2 $ ';
$plugin_revision = '$Revision: 1300 $ ';
# Grab options from command line
GetOptions

View file

@ -1,8 +1,8 @@
#!/usr/bin/perl -w
# $Id: check_lotus.pl,v 1.1 2005/01/25 09:04:26 stanleyhopcroft Exp $
# $Id: check_lotus.pl 1096 2005-01-25 09:04:26Z stanleyhopcroft $
# $Log: check_lotus.pl,v $
# $Log$
# Revision 1.1 2005/01/25 09:04:26 stanleyhopcroft
# New plugin to check responsiveness of Louts Notes (v5 at least) servers
#
@ -219,7 +219,7 @@ sub print_usage () {
}
sub print_help () {
print_revision($PROGNAME,'$Revision: 1.1 $ ');
print_revision($PROGNAME,'$Revision: 1096 $ ');
print "Copyright (c) 2004 Ed Rolison/S Hopcroft
Perl Check Lotus Notes plugin for Nagios.
@ -250,7 +250,7 @@ Returns OK if the named server responds with its name.
}
sub version () {
print_revision($PROGNAME,'$Revision: 1.1 $ ');
print_revision($PROGNAME,'$Revision: 1096 $ ');
exit $ERRORS{'OK'};
}

View file

@ -1,5 +1,5 @@
#!/usr/bin/perl -w
# $Id: check_mem.pl,v 1.1.1.1 2002/02/28 06:42:54 egalstad Exp $
# $Id: check_mem.pl 2 2002-02-28 06:42:51Z egalstad $
# check_mem.pl Copyright (C) 2000 Dan Larsson <dl@tyfon.net>
#

View file

@ -1,8 +1,8 @@
#!/usr/bin/perl -w
# $Id: check_ms_spooler.pl,v 1.1 2002/07/16 00:04:42 stanleyhopcroft Exp $
# $Id: check_ms_spooler.pl 64 2002-07-16 00:04:42Z stanleyhopcroft $
# $Log: check_ms_spooler.pl,v $
# $Log$
# Revision 1.1 2002/07/16 00:04:42 stanleyhopcroft
# Primitive and in need of refinement test of MS spooler (with smbclient)
#
@ -268,7 +268,7 @@ sub print_usage () {
}
sub print_help () {
print_revision($PROGNAME,'$Revision: 1.1 $ ');
print_revision($PROGNAME,'$Revision: 64 $ ');
print "Copyright (c) 2001 Karl DeBisschop/S Hopcroft
Perl Check MS Spooler plugin for NetSaint. Display a subset of the queues on an SMB (Samba or MS) print spooler.
@ -292,7 +292,7 @@ Perl Check MS Spooler plugin for NetSaint. Display a subset of the queues on an
}
sub version () {
print_revision($PROGNAME,'$Revision: 1.1 $ ');
print_revision($PROGNAME,'$Revision: 64 $ ');
exit $ERRORS{'OK'};
}

View file

@ -4,8 +4,8 @@
# Written by: Erwan Arzur (erwan@netvalue.com)
# License: GPL
#
# Last Modified: $Date: 2002/02/28 06:42:54 $
# Revisiin: $Revision: 1.1.1.1 $
# Last Modified: $Date: 2002-02-28 06:42:51 +0000 (Thu, 28 Feb 2002) $
# Revisiin: $Revision: 2 $
#
# "check_ora_table_space.pl" plugin to check the state of Oracle
# table spaces. Scarce documentation.

View file

@ -1,5 +1,5 @@
#!/usr/bin/perl
# $Id: check_oracle_instance.pl,v 1.1 2002/04/03 02:58:47 sghosh Exp $
# $Id: check_oracle_instance.pl 10 2002-04-03 02:58:47Z sghosh $
# Copyright (c) 2002 Sven Dolderer
# some pieces of Code adopted from Adam vonNieda's oracletool.pl
@ -23,7 +23,7 @@ require DBD::Oracle || die "It appears that the DBD::Oracle module is not instal
use vars qw($VERSION $PROGNAME $logfile $debug $state $dbh $database $username $password $message $sql $cursor $opt_asession $opt_nsession $opt_tablespace $opt_nextents $opt_fextents $opt_aextents $privsok $warn $critical);
'$Revision: 1.1 $' =~ /^.*(\d+.\d+) \$$/; # Use The Revision from RCS/CVS
'$Revision: 10 $' =~ /^.*(\d+.\d+) \$$/; # Use The Revision from RCS/CVS
$VERSION = $1;
$0 =~ m!^.*/([^/]+)$!;
$PROGNAME = $1;

View file

@ -30,7 +30,7 @@ if (!$ENV{ORACLE_HOME}) {
my $state = $ERRORS{'UNKNOWN'};
my $answer = undef;
my ($MAJOR_VERSION, $MINOR_VERSION) = q$Revision: 1.2 $ =~ /(\d+)\.(\d+)/;
my ($MAJOR_VERSION, $MINOR_VERSION) = q$Revision: 1134 $ =~ /(\d+)\.(\d+)/;
my $VERSION = sprintf("%d.%02d", $MAJOR_VERSION - 1, $MINOR_VERSION);
my $opt_debug; # -d|--debug

View file

@ -27,7 +27,7 @@ GetOptions
"c=s" => \$opt_c, "critical=s" => \$opt_c);
if ($opt_V) {
print_revision($PROGNAME,'$Revision: 1.1 $');
print_revision($PROGNAME,'$Revision: 1112 $');
exit $ERRORS{'OK'};
}
if ($opt_h) {
@ -67,7 +67,7 @@ exit $ERRORS{'OK'};
sub print_help {
print_revision($PROGNAME,'$Revision: 1.1 $');
print_revision($PROGNAME,'$Revision: 1112 $');
print "Copyright (c) 2002 Jason Dixon\n\nThis plugin checks the number of state table entries on a PF-enabled OpenBSD system.\n\n";
print "Usage:\t-H, --hostname=<HOST> [-w, --warning=<WARNING>] [-c, --critical=<CRITICAL>]\n\n\tDefault warning is 50000 and critical is 60000.\n\n";
support();

View file

@ -11,7 +11,7 @@
* * License: GPL
* * Copyright (c) 2000
* *
* * $Id: check_rbl.c,v 1.3 2004/12/02 00:30:32 opensides Exp $
* * $Id: check_rbl.c 970 2004-12-02 00:30:32Z opensides $
*
*****************************************************************************/
@ -22,7 +22,7 @@
#include "string.h"
const char progname = "check_rbl";
const char *revision = "$Revision: 1.3 $";
const char *revision = "$Revision: 970 $";
//const char *copyright = "2000-2003";
//const char *email = "nagiosplug-devel@lists.sourceforge.net";
@ -263,7 +263,7 @@ int call_getopt(int argc, char **argv)
}
break;
case 'V': /* version */
print_revision(progname,"$Revision: 1.3 $");
print_revision(progname,"$Revision: 970 $");
exit(STATE_OK);
case 'h': /* help */
print_help();
@ -291,7 +291,7 @@ int validate_arguments(void)
void print_help(void)
{
print_revision(progname,"$Revision: 1.3 $");
print_revision(progname,"$Revision: 970 $");
printf
("Copyright (c) 2000 Karl DeBisschop\n\n"
"This plugin uses dig to test whether the specified host is on any RBL lists.\n\n");

View file

@ -26,7 +26,7 @@
#
PROGNAME=`basename $0`
PROGPATH=`echo $0 | /bin/sed -e 's,[\\/][^\\/][^\\/]*$,,'`
REVISION=`echo '$Revision: 1.1 $' | sed -e 's/[^0-9.]//g'`
REVISION=`echo '$Revision: 71 $' | sed -e 's/[^0-9.]//g'`
. $PROGPATH/utils.sh

View file

@ -52,7 +52,7 @@ sub process_options {
}
sub local_print_revision {
print_revision( $PROGNAME, '$Revision: 1.1 $ ' )
print_revision( $PROGNAME, '$Revision: 82 $ ' )
}
sub print_usage {

View file

@ -116,7 +116,7 @@ GetOptions
$PROGNAME = "check_snmp_printer";
if ($opt_V) {
print_revision($PROGNAME,'$Revision: 1.1 $');
print_revision($PROGNAME,'$Revision: 795 $');
exit $ERRORS{'OK'};
}
@ -572,7 +572,7 @@ sub print_usage () {
}
sub print_help () {
print_revision($PROGNAME,'$Revision: 1.1 $');
print_revision($PROGNAME,'$Revision: 795 $');
print "Copyright (c) 2002 Subhendu Ghosh/Ethan Galstad.
This plugin reports the status of an network printer with an SNMP management

View file

@ -91,7 +91,7 @@ sub process_options {
}
sub local_print_revision {
print_revision( $PROGNAME, '$Revision: 1.2 $ ' )
print_revision( $PROGNAME, '$Revision: 84 $ ' )
}
sub print_usage {

View file

@ -35,7 +35,7 @@
#use strict;
use Getopt::Long;
use Net::SNMP qw (oid_lex_sort oid_base_match SNMP_VERSION_1);
use lib utils.pm;
use lib "/usr/local/nagios/libexec";
use utils qw(%ERRORS &print_revision &support &usage);
my $PROGNAME="check_snmp_procs";
@ -109,7 +109,7 @@ if (GetOptions(
}
if ($opt_version) {
print_revision($PROGNAME, "\$Revision: 1.1 $REVISION \$");
print_revision($PROGNAME, "\$Revision: 1771 $REVISION \$");
exit $ERRORS{'OK'};
}
@ -529,7 +529,7 @@ sub print_usage {
#
sub print_help {
print_revision($PROGNAME, "\$Revision: 1.1 $REVISION \$");
print_revision($PROGNAME, "\$Revision: 1771 $REVISION \$");
print "Copyright (c) 2003 David Alden
Check if processes are running on a host via snmp

View file

@ -138,7 +138,7 @@ sub print_usage () {
}
sub print_help () {
print_revision($PROGNAME,'$Revision: 1.1 $\n ');
print_revision($PROGNAME,'$Revision: 1113 $\n ');
print "Copyright (c) 2003 Rainer Duffner\n ";
print_usage();
print "\n";
@ -151,7 +151,7 @@ sub print_help () {
}
sub version () {
print_revision($PROGNAME,'$Revision: 1.1 $ ');
print_revision($PROGNAME,'$Revision: 1113 $ ');
exit $ERRORS{'OK'};
}

View file

@ -138,7 +138,7 @@ sub print_usage () {
}
sub print_help () {
print_revision($PROGNAME,'$Revision: 1.1 $\n ');
print_revision($PROGNAME,'$Revision: 1113 $\n ');
print "Copyright (c) 2003 Rainer Duffner\n ";
print_usage();
print "\n";
@ -149,7 +149,7 @@ sub print_help () {
}
sub version () {
print_revision($PROGNAME,'$Revision: 1.1 $ ');
print_revision($PROGNAME,'$Revision: 1113 $ ');
exit $ERRORS{'OK'};
}

View file

@ -1,8 +1,8 @@
#!/usr/bin/perl
# $Id: check_traceroute.pl,v 1.1 2005/01/27 10:34:16 stanleyhopcroft Exp $
# $Id: check_traceroute.pl 1115 2005-01-27 10:34:16Z stanleyhopcroft $
# $Log: check_traceroute.pl,v $
# $Log$
# Revision 1.1 2005/01/27 10:34:16 stanleyhopcroft
# Jon Meek's check_traceroute for Mon hacked by YT for Nagios. Prob pretty weak
#
@ -32,7 +32,7 @@ getopts('i:H:N:R:T:dhrvV');
do { print_help ; exit $ERRORS{OK}; }
if $opt_h ;
do { print_revision($PROGNAME, '$Revision: 1.1 $'); exit $ERRORS{OK}; }
do { print_revision($PROGNAME, '$Revision: 1115 $'); exit $ERRORS{OK}; }
if $opt_V ;
do { print_help; exit $ERRORS{OK}; }
@ -176,7 +176,7 @@ sub print_usage () {
}
sub print_help () {
print_revision($PROGNAME, '$Revision: 1.1 $') ;
print_revision($PROGNAME, '$Revision: 1115 $') ;
print "Copyright (c) 2004 J Meek/Karl DeBisschop
This plugin checks whether traceroute to the destination succeeds and if so that the route string option (-R) matches the list of routers

View file

@ -9,7 +9,7 @@
* Based on CHECK_LOAD.C
* Copyright (c) 1999 Felipe Gustavo de Almeida <galmeida@linux.ime.usp.br>
*
* Last Modified: $Date: 2002/03/01 02:42:56 $
* Last Modified: $Date: 2002-03-01 02:42:56 +0000 (Fri, 01 Mar 2002) $
*
* Command line: CHECK_UPTIME <host_address>
*
@ -44,7 +44,7 @@ int main(int argc, char **argv)
if(argc != 2){
printf("Incorrect number of arguments supplied\n");
printf("\n");
print_revision(argv[0],"$Revision: 1.2 $");
print_revision(argv[0],"$Revision: 6 $");
printf("Copyright (c) 2000 Teresa Ramanan (tlr@redowl.org)\n");
printf("\n");
printf("Usage: %s <host_address>\n",argv[0]);

View file

@ -71,7 +71,7 @@ sub print_help ();
$vcs_negate = '';
$vcs_result = '';
$vcs_expected_result = 'ONLINE';
$plugin_revision = '$Revision: 1.1 $ ';
$plugin_revision = '$Revision: 33 $ ';
# Grab options from command line
GetOptions

View file

@ -1,8 +1,8 @@
#!/usr/bin/perl -w
# $Id: check_wins.pl,v 1.3 2004/11/25 04:46:16 stanleyhopcroft Exp $
# $Id: check_wins.pl 940 2004-11-25 04:46:16Z stanleyhopcroft $
# $Log: check_wins.pl,v $
# $Log$
# Revision 1.3 2004/11/25 04:46:16 stanleyhopcroft
# Non functional tidy ups to check_wins
#
@ -190,7 +190,7 @@ sub print_usage () {
}
sub print_help () {
print_revision($PROGNAME,'$Revision: 1.3 $ ');
print_revision($PROGNAME,'$Revision: 940 $ ');
print "Copyright (c) 2001 Karl DeBisschop/S Hopcroft
Perl Check WINS plugin for NetSaint.
@ -237,7 +237,7 @@ The plugin works by
}
sub version () {
print_revision($PROGNAME,'$Revision: 1.3 $ ');
print_revision($PROGNAME,'$Revision: 940 $ ');
exit $ERRORS{'OK'};
}

View file

@ -1,8 +1,8 @@
package packet_utils;
# $Id: packet_utils.pm,v 1.1 2005/01/25 09:12:47 stanleyhopcroft Exp $
# $Id: packet_utils.pm 1100 2005-01-25 09:12:47Z stanleyhopcroft $
# $Log: packet_utils.pm,v $
# $Log$
# Revision 1.1 2005/01/25 09:12:47 stanleyhopcroft
# packet creation and dumping hacks used by check_ica* and check_lotus
#

View file

@ -8,7 +8,7 @@
#==========================================================================
#
# Version: = '$Id: utils.py,v 1.1.1.1 2002/02/28 06:42:54 egalstad Exp $'
# Version: = '$Id: utils.py 2 2002-02-28 06:42:51Z egalstad $'
#
# (C) Rob W.W. Hooft, Nonius BV, 1998
#

View file

@ -1,4 +1,4 @@
# Makefile.in generated by automake 1.9.6 from Makefile.am.
# Makefile.in generated by automake 1.9.5 from Makefile.am.
# @configure_input@
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
@ -27,6 +27,8 @@
SOURCES = $(libgnu_a_SOURCES) $(EXTRA_libgnu_a_SOURCES)
srcdir = @srcdir@
top_srcdir = @top_srcdir@
VPATH = @srcdir@
@ -109,7 +111,7 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/np_mysqlclient.m4 \
$(top_srcdir)/configure.in
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(install_sh) -d
mkinstalldirs = $(SHELL) $(top_srcdir)/build-aux/mkinstalldirs
CONFIG_HEADER = $(top_builddir)/config.h
CONFIG_CLEAN_FILES =
LIBRARIES = $(noinst_LIBRARIES)
@ -271,6 +273,7 @@ PATH_TO_SWAPINFO = @PATH_TO_SWAPINFO@
PATH_TO_UPTIME = @PATH_TO_UPTIME@
PATH_TO_WHO = @PATH_TO_WHO@
PERL = @PERL@
PERLMODS_DIR = @PERLMODS_DIR@
PGINCLUDE = @PGINCLUDE@
PGLIBS = @PGLIBS@
PKG_ARCH = @PKG_ARCH@

View file

@ -5,8 +5,8 @@ SUBDIRS = tests
noinst_LIBRARIES = libnagiosplug.a
libnagiosplug_a_SOURCES = utils_base.c utils_disk.c
EXTRA_DIST = utils_base.h utils_disk.h
libnagiosplug_a_SOURCES = utils_base.c utils_disk.c utils_tcp.c utils_cmd.c
EXTRA_DIST = utils_base.h utils_disk.h utils_tcp.h utils_cmd.h
INCLUDES = -I$(srcdir) -I$(top_srcdir)/gl -I$(top_srcdir)/intl -I$(top_srcdir)/plugins

View file

@ -1,4 +1,4 @@
# Makefile.in generated by automake 1.9.6 from Makefile.am.
# Makefile.in generated by automake 1.9.5 from Makefile.am.
# @configure_input@
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
@ -14,6 +14,8 @@
@SET_MAKE@
SOURCES = $(libnagiosplug_a_SOURCES)
srcdir = @srcdir@
top_srcdir = @top_srcdir@
VPATH = @srcdir@
@ -95,14 +97,15 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/np_mysqlclient.m4 \
$(top_srcdir)/configure.in
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(install_sh) -d
mkinstalldirs = $(SHELL) $(top_srcdir)/build-aux/mkinstalldirs
CONFIG_HEADER = $(top_builddir)/config.h
CONFIG_CLEAN_FILES =
LIBRARIES = $(noinst_LIBRARIES)
ARFLAGS = cru
libnagiosplug_a_AR = $(AR) $(ARFLAGS)
libnagiosplug_a_LIBADD =
am_libnagiosplug_a_OBJECTS = utils_base.$(OBJEXT) utils_disk.$(OBJEXT)
am_libnagiosplug_a_OBJECTS = utils_base.$(OBJEXT) utils_disk.$(OBJEXT) \
utils_tcp.$(OBJEXT) utils_cmd.$(OBJEXT)
libnagiosplug_a_OBJECTS = $(am_libnagiosplug_a_OBJECTS)
DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)
depcomp = $(SHELL) $(top_srcdir)/build-aux/depcomp
@ -261,6 +264,7 @@ PATH_TO_SWAPINFO = @PATH_TO_SWAPINFO@
PATH_TO_UPTIME = @PATH_TO_UPTIME@
PATH_TO_WHO = @PATH_TO_WHO@
PERL = @PERL@
PERLMODS_DIR = @PERLMODS_DIR@
PGINCLUDE = @PGINCLUDE@
PGLIBS = @PGLIBS@
PKG_ARCH = @PKG_ARCH@
@ -349,8 +353,8 @@ target_alias = @target_alias@
with_trusted_path = @with_trusted_path@
SUBDIRS = tests
noinst_LIBRARIES = libnagiosplug.a
libnagiosplug_a_SOURCES = utils_base.c utils_disk.c
EXTRA_DIST = utils_base.h utils_disk.h
libnagiosplug_a_SOURCES = utils_base.c utils_disk.c utils_tcp.c utils_cmd.c
EXTRA_DIST = utils_base.h utils_disk.h utils_tcp.h utils_cmd.h
INCLUDES = -I$(srcdir) -I$(top_srcdir)/gl -I$(top_srcdir)/intl -I$(top_srcdir)/plugins
all: all-recursive
@ -400,7 +404,9 @@ distclean-compile:
-rm -f *.tab.c
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/utils_base.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/utils_cmd.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/utils_disk.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/utils_tcp.Po@am__quote@
.c.o:
@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \

View file

@ -7,9 +7,9 @@ check_PROGRAMS = @EXTRA_TEST@
INCLUDES = -I$(top_srcdir)/lib -I$(top_srcdir)/gl -I$(top_srcdir)/intl -I$(top_srcdir)/plugins
EXTRA_PROGRAMS = test_utils test_disk
EXTRA_PROGRAMS = test_utils test_disk test_tcp test_cmd
EXTRA_DIST = test_utils.t test_disk.t
EXTRA_DIST = test_utils.t test_disk.t test_tcp.t test_cmd.t
LIBS = @LIBINTL@
@ -23,6 +23,16 @@ test_disk_CFLAGS = -g -I..
test_disk_LDFLAGS = -L/usr/local/lib -ltap
test_disk_LDADD = ../utils_disk.o $(top_srcdir)/gl/libgnu.a
test_tcp_SOURCES = test_tcp.c
test_tcp_CFLAGS = -g -I..
test_tcp_LDFLAGS = -L/usr/local/lib -ltap
test_tcp_LDADD = ../utils_tcp.o
test_cmd_SOURCES = test_cmd.c
test_cmd_CFLAGS = -g -I..
test_cmd_LDFLAGS = -L/usr/local/lib -ltap
test_cmd_LDADD = ../utils_cmd.o ../utils_base.o
test: ${noinst_PROGRAMS}
perl -MTest::Harness -e '$$Test::Harness::switches=""; runtests(map {$$_ .= ".t"} @ARGV)' $(EXTRA_PROGRAMS)

View file

@ -1,4 +1,4 @@
# Makefile.in generated by automake 1.9.6 from Makefile.am.
# Makefile.in generated by automake 1.9.5 from Makefile.am.
# @configure_input@
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
@ -14,6 +14,8 @@
@SET_MAKE@
SOURCES = $(test_cmd_SOURCES) $(test_disk_SOURCES) $(test_tcp_SOURCES) $(test_utils_SOURCES)
srcdir = @srcdir@
top_srcdir = @top_srcdir@
VPATH = @srcdir@
@ -37,7 +39,8 @@ build_triplet = @build@
host_triplet = @host@
noinst_PROGRAMS = @EXTRA_TEST@
check_PROGRAMS = @EXTRA_TEST@
EXTRA_PROGRAMS = test_utils$(EXEEXT) test_disk$(EXEEXT)
EXTRA_PROGRAMS = test_utils$(EXEEXT) test_disk$(EXEEXT) \
test_tcp$(EXEEXT) test_cmd$(EXEEXT)
subdir = lib/tests
DIST_COMMON = README $(srcdir)/Makefile.am $(srcdir)/Makefile.in
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
@ -98,13 +101,19 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/np_mysqlclient.m4 \
$(top_srcdir)/configure.in
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(install_sh) -d
mkinstalldirs = $(SHELL) $(top_srcdir)/build-aux/mkinstalldirs
CONFIG_HEADER = $(top_builddir)/config.h
CONFIG_CLEAN_FILES =
PROGRAMS = $(noinst_PROGRAMS)
am_test_cmd_OBJECTS = test_cmd-test_cmd.$(OBJEXT)
test_cmd_OBJECTS = $(am_test_cmd_OBJECTS)
test_cmd_DEPENDENCIES = ../utils_cmd.o ../utils_base.o
am_test_disk_OBJECTS = test_disk-test_disk.$(OBJEXT)
test_disk_OBJECTS = $(am_test_disk_OBJECTS)
test_disk_DEPENDENCIES = ../utils_disk.o $(top_srcdir)/gl/libgnu.a
am_test_tcp_OBJECTS = test_tcp-test_tcp.$(OBJEXT)
test_tcp_OBJECTS = $(am_test_tcp_OBJECTS)
test_tcp_DEPENDENCIES = ../utils_tcp.o
am_test_utils_OBJECTS = test_utils-test_utils.$(OBJEXT)
test_utils_OBJECTS = $(am_test_utils_OBJECTS)
test_utils_DEPENDENCIES = ../utils_base.o
@ -119,8 +128,10 @@ LTCOMPILE = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) \
CCLD = $(CC)
LINK = $(LIBTOOL) --tag=CC --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
$(AM_LDFLAGS) $(LDFLAGS) -o $@
SOURCES = $(test_disk_SOURCES) $(test_utils_SOURCES)
DIST_SOURCES = $(test_disk_SOURCES) $(test_utils_SOURCES)
SOURCES = $(test_cmd_SOURCES) $(test_disk_SOURCES) $(test_tcp_SOURCES) \
$(test_utils_SOURCES)
DIST_SOURCES = $(test_cmd_SOURCES) $(test_disk_SOURCES) \
$(test_tcp_SOURCES) $(test_utils_SOURCES)
ETAGS = etags
CTAGS = ctags
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
@ -258,6 +269,7 @@ PATH_TO_SWAPINFO = @PATH_TO_SWAPINFO@
PATH_TO_UPTIME = @PATH_TO_UPTIME@
PATH_TO_WHO = @PATH_TO_WHO@
PERL = @PERL@
PERLMODS_DIR = @PERLMODS_DIR@
PGINCLUDE = @PGINCLUDE@
PGLIBS = @PGLIBS@
PKG_ARCH = @PKG_ARCH@
@ -348,7 +360,7 @@ with_trusted_path = @with_trusted_path@
# These two lines support "make check", but we use "make test"
TESTS = @EXTRA_TEST@
INCLUDES = -I$(top_srcdir)/lib -I$(top_srcdir)/gl -I$(top_srcdir)/intl -I$(top_srcdir)/plugins
EXTRA_DIST = test_utils.t test_disk.t
EXTRA_DIST = test_utils.t test_disk.t test_tcp.t test_cmd.t
test_utils_SOURCES = test_utils.c
test_utils_CFLAGS = -g -I..
test_utils_LDFLAGS = -L/usr/local/lib -ltap
@ -357,6 +369,14 @@ test_disk_SOURCES = test_disk.c
test_disk_CFLAGS = -g -I..
test_disk_LDFLAGS = -L/usr/local/lib -ltap
test_disk_LDADD = ../utils_disk.o $(top_srcdir)/gl/libgnu.a
test_tcp_SOURCES = test_tcp.c
test_tcp_CFLAGS = -g -I..
test_tcp_LDFLAGS = -L/usr/local/lib -ltap
test_tcp_LDADD = ../utils_tcp.o
test_cmd_SOURCES = test_cmd.c
test_cmd_CFLAGS = -g -I..
test_cmd_LDFLAGS = -L/usr/local/lib -ltap
test_cmd_LDADD = ../utils_cmd.o ../utils_base.o
all: all-am
.SUFFIXES:
@ -404,9 +424,15 @@ clean-noinstPROGRAMS:
echo " rm -f $$p $$f"; \
rm -f $$p $$f ; \
done
test_cmd$(EXEEXT): $(test_cmd_OBJECTS) $(test_cmd_DEPENDENCIES)
@rm -f test_cmd$(EXEEXT)
$(LINK) $(test_cmd_LDFLAGS) $(test_cmd_OBJECTS) $(test_cmd_LDADD) $(LIBS)
test_disk$(EXEEXT): $(test_disk_OBJECTS) $(test_disk_DEPENDENCIES)
@rm -f test_disk$(EXEEXT)
$(LINK) $(test_disk_LDFLAGS) $(test_disk_OBJECTS) $(test_disk_LDADD) $(LIBS)
test_tcp$(EXEEXT): $(test_tcp_OBJECTS) $(test_tcp_DEPENDENCIES)
@rm -f test_tcp$(EXEEXT)
$(LINK) $(test_tcp_LDFLAGS) $(test_tcp_OBJECTS) $(test_tcp_LDADD) $(LIBS)
test_utils$(EXEEXT): $(test_utils_OBJECTS) $(test_utils_DEPENDENCIES)
@rm -f test_utils$(EXEEXT)
$(LINK) $(test_utils_LDFLAGS) $(test_utils_OBJECTS) $(test_utils_LDADD) $(LIBS)
@ -417,7 +443,9 @@ mostlyclean-compile:
distclean-compile:
-rm -f *.tab.c
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_cmd-test_cmd.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_disk-test_disk.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_tcp-test_tcp.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_utils-test_utils.Po@am__quote@
.c.o:
@ -441,6 +469,20 @@ distclean-compile:
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $<
test_cmd-test_cmd.o: test_cmd.c
@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_cmd_CFLAGS) $(CFLAGS) -MT test_cmd-test_cmd.o -MD -MP -MF "$(DEPDIR)/test_cmd-test_cmd.Tpo" -c -o test_cmd-test_cmd.o `test -f 'test_cmd.c' || echo '$(srcdir)/'`test_cmd.c; \
@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/test_cmd-test_cmd.Tpo" "$(DEPDIR)/test_cmd-test_cmd.Po"; else rm -f "$(DEPDIR)/test_cmd-test_cmd.Tpo"; exit 1; fi
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='test_cmd.c' object='test_cmd-test_cmd.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_cmd_CFLAGS) $(CFLAGS) -c -o test_cmd-test_cmd.o `test -f 'test_cmd.c' || echo '$(srcdir)/'`test_cmd.c
test_cmd-test_cmd.obj: test_cmd.c
@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_cmd_CFLAGS) $(CFLAGS) -MT test_cmd-test_cmd.obj -MD -MP -MF "$(DEPDIR)/test_cmd-test_cmd.Tpo" -c -o test_cmd-test_cmd.obj `if test -f 'test_cmd.c'; then $(CYGPATH_W) 'test_cmd.c'; else $(CYGPATH_W) '$(srcdir)/test_cmd.c'; fi`; \
@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/test_cmd-test_cmd.Tpo" "$(DEPDIR)/test_cmd-test_cmd.Po"; else rm -f "$(DEPDIR)/test_cmd-test_cmd.Tpo"; exit 1; fi
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='test_cmd.c' object='test_cmd-test_cmd.obj' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_cmd_CFLAGS) $(CFLAGS) -c -o test_cmd-test_cmd.obj `if test -f 'test_cmd.c'; then $(CYGPATH_W) 'test_cmd.c'; else $(CYGPATH_W) '$(srcdir)/test_cmd.c'; fi`
test_disk-test_disk.o: test_disk.c
@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_disk_CFLAGS) $(CFLAGS) -MT test_disk-test_disk.o -MD -MP -MF "$(DEPDIR)/test_disk-test_disk.Tpo" -c -o test_disk-test_disk.o `test -f 'test_disk.c' || echo '$(srcdir)/'`test_disk.c; \
@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/test_disk-test_disk.Tpo" "$(DEPDIR)/test_disk-test_disk.Po"; else rm -f "$(DEPDIR)/test_disk-test_disk.Tpo"; exit 1; fi
@ -455,6 +497,20 @@ test_disk-test_disk.obj: test_disk.c
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_disk_CFLAGS) $(CFLAGS) -c -o test_disk-test_disk.obj `if test -f 'test_disk.c'; then $(CYGPATH_W) 'test_disk.c'; else $(CYGPATH_W) '$(srcdir)/test_disk.c'; fi`
test_tcp-test_tcp.o: test_tcp.c
@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_tcp_CFLAGS) $(CFLAGS) -MT test_tcp-test_tcp.o -MD -MP -MF "$(DEPDIR)/test_tcp-test_tcp.Tpo" -c -o test_tcp-test_tcp.o `test -f 'test_tcp.c' || echo '$(srcdir)/'`test_tcp.c; \
@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/test_tcp-test_tcp.Tpo" "$(DEPDIR)/test_tcp-test_tcp.Po"; else rm -f "$(DEPDIR)/test_tcp-test_tcp.Tpo"; exit 1; fi
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='test_tcp.c' object='test_tcp-test_tcp.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_tcp_CFLAGS) $(CFLAGS) -c -o test_tcp-test_tcp.o `test -f 'test_tcp.c' || echo '$(srcdir)/'`test_tcp.c
test_tcp-test_tcp.obj: test_tcp.c
@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_tcp_CFLAGS) $(CFLAGS) -MT test_tcp-test_tcp.obj -MD -MP -MF "$(DEPDIR)/test_tcp-test_tcp.Tpo" -c -o test_tcp-test_tcp.obj `if test -f 'test_tcp.c'; then $(CYGPATH_W) 'test_tcp.c'; else $(CYGPATH_W) '$(srcdir)/test_tcp.c'; fi`; \
@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/test_tcp-test_tcp.Tpo" "$(DEPDIR)/test_tcp-test_tcp.Po"; else rm -f "$(DEPDIR)/test_tcp-test_tcp.Tpo"; exit 1; fi
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='test_tcp.c' object='test_tcp-test_tcp.obj' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_tcp_CFLAGS) $(CFLAGS) -c -o test_tcp-test_tcp.obj `if test -f 'test_tcp.c'; then $(CYGPATH_W) 'test_tcp.c'; else $(CYGPATH_W) '$(srcdir)/test_tcp.c'; fi`
test_utils-test_utils.o: test_utils.c
@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_utils_CFLAGS) $(CFLAGS) -MT test_utils-test_utils.o -MD -MP -MF "$(DEPDIR)/test_utils-test_utils.Tpo" -c -o test_utils-test_utils.o `test -f 'test_utils.c' || echo '$(srcdir)/'`test_utils.c; \
@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/test_utils-test_utils.Tpo" "$(DEPDIR)/test_utils-test_utils.Po"; else rm -f "$(DEPDIR)/test_utils-test_utils.Tpo"; exit 1; fi

210
lib/tests/test_cmd.c Normal file
View file

@ -0,0 +1,210 @@
/******************************************************************************
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: test_cmd.c 1732 2007-06-03 15:58:22Z psychotrahe $
******************************************************************************/
#include "common.h"
#include "utils_cmd.h"
#include "utils_base.h"
#include "tap.h"
#define COMMAND_LINE 1024
#define UNSET 65530
char *
get_command (char *const *line)
{
char *cmd;
int i = 0;
asprintf (&cmd, " %s", line[i++]);
while (line[i] != NULL) {
asprintf (&cmd, "%s %s", cmd, line[i]);
i++;
}
return cmd;
}
int
main (int argc, char **argv)
{
char **command_line = malloc (sizeof (char *) * COMMAND_LINE);
char *command = NULL;
char *perl;
output chld_out, chld_err;
int c;
int result = UNSET;
plan_tests(47);
diag ("Running plain echo command, set one");
/* ensure everything is empty before we begin */
memset (&chld_out, 0, sizeof (output));
memset (&chld_err, 0, sizeof (output));
ok (chld_out.lines == 0, "(initialised) Checking stdout is reset");
ok (chld_err.lines == 0, "(initialised) Checking stderr is reset");
ok (result == UNSET, "(initialised) Checking exit code is reset");
command_line[0] = strdup ("/bin/echo");
command_line[1] = strdup ("this");
command_line[2] = strdup ("is");
command_line[3] = strdup ("test");
command_line[4] = strdup ("one");
command = get_command (command_line);
result = cmd_run_array (command_line, &chld_out, &chld_err, 0);
ok (chld_out.lines == 1,
"(array) Check for expected number of stdout lines");
ok (chld_err.lines == 0,
"(array) Check for expected number of stderr lines");
ok (strcmp (chld_out.line[0], "this is test one") == 0,
"(array) Check for expected stdout output");
ok (result == 0, "(array) Checking exit code");
/* ensure everything is empty again */
memset (&chld_out, 0, sizeof (output));
memset (&chld_err, 0, sizeof (output));
result = UNSET;
ok (chld_out.lines == 0, "(initialised) Checking stdout is reset");
ok (chld_err.lines == 0, "(initialised) Checking stderr is reset");
ok (result == UNSET, "(initialised) Checking exit code is reset");
result = cmd_run (command, &chld_out, &chld_err, 0);
ok (chld_out.lines == 1,
"(string) Check for expected number of stdout lines");
ok (chld_err.lines == 0,
"(string) Check for expected number of stderr lines");
ok (strcmp (chld_out.line[0], "this is test one") == 0,
"(string) Check for expected stdout output");
ok (result == 0, "(string) Checking exit code");
diag ("Running plain echo command, set two");
/* ensure everything is empty again */
memset (&chld_out, 0, sizeof (output));
memset (&chld_err, 0, sizeof (output));
result = UNSET;
ok (chld_out.lines == 0, "(initialised) Checking stdout is reset");
ok (chld_err.lines == 0, "(initialised) Checking stderr is reset");
ok (result == UNSET, "(initialised) Checking exit code is reset");
command_line[0] = strdup ("/bin/echo");
command_line[1] = strdup ("this is test two");
command_line[2] = NULL;
command_line[3] = NULL;
command_line[4] = NULL;
result = cmd_run_array (command_line, &chld_out, &chld_err, 0);
ok (chld_out.lines == 1,
"(array) Check for expected number of stdout lines");
ok (chld_err.lines == 0,
"(array) Check for expected number of stderr lines");
ok (strcmp (chld_out.line[0], "this is test two") == 0,
"(array) Check for expected stdout output");
ok (result == 0, "(array) Checking exit code");
/* ensure everything is empty again */
memset (&chld_out, 0, sizeof (output));
memset (&chld_err, 0, sizeof (output));
result = UNSET;
ok (chld_out.lines == 0, "(initialised) Checking stdout is reset");
ok (chld_err.lines == 0, "(initialised) Checking stderr is reset");
ok (result == UNSET, "(initialised) Checking exit code is reset");
result = cmd_run (command, &chld_out, &chld_err, 0);
ok (chld_out.lines == 1,
"(string) Check for expected number of stdout lines");
ok (chld_err.lines == 0,
"(string) Check for expected number of stderr lines");
ok (strcmp (chld_out.line[0], "this is test one") == 0,
"(string) Check for expected stdout output");
ok (result == 0, "(string) Checking exit code");
/* ensure everything is empty again */
memset (&chld_out, 0, sizeof (output));
memset (&chld_err, 0, sizeof (output));
result = UNSET;
ok (chld_out.lines == 0, "(initialised) Checking stdout is reset");
ok (chld_err.lines == 0, "(initialised) Checking stderr is reset");
ok (result == UNSET, "(initialised) Checking exit code is reset");
/* Pass linefeeds via parameters through - those should be evaluated by echo to give multi line output */
command_line[0] = strdup("/bin/echo");
command_line[1] = strdup("this is a test via echo\nline two\nit's line 3");
command_line[2] = strdup("and (note space between '3' and 'and') $$ will not get evaluated");
result = cmd_run_array (command_line, &chld_out, &chld_err, 0);
ok (chld_out.lines == 3,
"(array) Check for expected number of stdout lines");
ok (chld_err.lines == 0,
"(array) Check for expected number of stderr lines");
ok (strcmp (chld_out.line[0], "this is a test via echo") == 0,
"(array) Check line 1 for expected stdout output");
ok (strcmp (chld_out.line[1], "line two") == 0,
"(array) Check line 2 for expected stdout output");
ok (strcmp (chld_out.line[2], "it's line 3 and (note space between '3' and 'and') $$ will not get evaluated") == 0,
"(array) Check line 3 for expected stdout output");
ok (result == 0, "(array) Checking exit code");
/* ensure everything is empty again */
memset (&chld_out, 0, sizeof (output));
memset (&chld_err, 0, sizeof (output));
result = UNSET;
ok (chld_out.lines == 0, "(initialised) Checking stdout is reset");
ok (chld_err.lines == 0, "(initialised) Checking stderr is reset");
ok (result == UNSET, "(initialised) Checking exit code is reset");
command = (char *)malloc(COMMAND_LINE);
strcpy(command, "/bin/echo3456 non-existant command");
result = cmd_run (command, &chld_out, &chld_err, 0);
ok (chld_out.lines == 0,
"Non existant command, so no output");
ok (chld_err.lines == 0,
"No stderr either");
ok (result == 3, "Get return code 3 (?) for non-existant command");
/* ensure everything is empty again */
memset (&chld_out, 0, sizeof (output));
memset (&chld_err, 0, sizeof (output));
result = UNSET;
command = (char *)malloc(COMMAND_LINE);
strcpy(command, "/bin/grep pattern non-existant-file");
result = cmd_run (command, &chld_out, &chld_err, 0);
ok (chld_out.lines == 0,
"Grep returns no stdout when file is missing...");
ok (chld_err.lines == 1,
"...but does give an error line");
ok (strstr(chld_err.line[0],"non-existant-file") != NULL, "And missing filename is in error message");
ok (result == 2, "Get return code 2 from grep");
return exit_status ();
}

6
lib/tests/test_cmd.t Normal file
View file

@ -0,0 +1,6 @@
#!/usr/bin/perl
use Test::More;
if (! -e "./test_cmd") {
plan skip_all => "./test_cmd not compiled - please install tap library to test";
}
exec "./test_cmd";

View file

@ -14,7 +14,7 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
$Id: test_disk.c,v 1.3 2007/03/30 09:00:05 psychotrahe Exp $
$Id: test_disk.c 1786 2007-09-22 17:40:35Z psychotrahe $
******************************************************************************/
@ -36,14 +36,15 @@ main (int argc, char **argv)
struct name_list *dummy_mountlist = NULL;
struct name_list *temp_name;
struct parameter_list *paths = NULL;
struct parameter_list *p;
struct parameter_list *p, *prev, *last;
struct mount_entry *dummy_mount_list;
struct mount_entry *me;
struct mount_entry **mtail = &dummy_mount_list;
int cflags = REG_NOSUB | REG_EXTENDED;
int found = 0, count = 0;
plan_tests(29);
plan_tests(33);
ok( np_find_name(exclude_filesystem, "/var/log") == FALSE, "/var/log not in list");
np_add_name(&exclude_filesystem, "/var/log");
@ -160,6 +161,46 @@ main (int argc, char **argv)
}
}
/* test deleting first element in paths */
paths = np_del_parameter(paths, NULL);
for (p = paths; p; p = p->name_next) {
if (! strcmp(p->name, "/home/groups"))
found = 1;
}
ok(found == 0, "first element successfully deleted");
found = 0;
p=paths;
while (p) {
if (! strcmp(p->name, "/tmp"))
p = np_del_parameter(p, prev);
else {
prev = p;
p = p->name_next;
}
}
for (p = paths; p; p = p->name_next) {
if (! strcmp(p->name, "/tmp"))
found = 1;
if (p->name_next)
prev = p;
else
last = p;
}
ok(found == 0, "/tmp element successfully deleted");
p = np_del_parameter(last, prev);
for (p = paths; p; p = p->name_next) {
if (! strcmp(p->name, "/home"))
found = 1;
last = p;
count++;
}
ok(found == 0, "last (/home) element successfully deleted");
ok(count == 2, "two elements remaining");
return exit_status();
}

58
lib/tests/test_tcp.c Normal file
View file

@ -0,0 +1,58 @@
/******************************************************************************
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: test_tcp.c 1732 2007-06-03 15:58:22Z psychotrahe $
******************************************************************************/
#include "common.h"
#include "utils_tcp.h"
#include "tap.h"
int
main (int argc, char **argv)
{
char** server_expect;
int server_expect_count = 3;
plan_tests(8);
server_expect = malloc(sizeof(char*) * server_expect_count);
server_expect[0] = strdup("AA");
server_expect[1] = strdup("bb");
server_expect[2] = strdup("CC");
ok(np_expect_match("AA bb CC XX", server_expect, server_expect_count, FALSE, TRUE, FALSE) == TRUE,
"Test matching any string at the beginning (first expect string)");
ok(np_expect_match("bb AA CC XX", server_expect, server_expect_count, FALSE, TRUE, FALSE) == TRUE,
"Test matching any string at the beginning (second expect string)");
ok(np_expect_match("XX bb AA CC XX", server_expect, server_expect_count, FALSE, TRUE, FALSE) == FALSE,
"Test with strings not matching at the beginning");
ok(np_expect_match("XX CC XX", server_expect, server_expect_count, FALSE, TRUE, FALSE) == FALSE,
"Test matching any string");
ok(np_expect_match("XX", server_expect, server_expect_count, FALSE, FALSE, FALSE) == FALSE,
"Test not matching any string");
ok(np_expect_match("XX AA bb CC XX", server_expect, server_expect_count, TRUE, FALSE, FALSE) == TRUE,
"Test matching all strings");
ok(np_expect_match("XX bb CC XX", server_expect, server_expect_count, TRUE, FALSE, FALSE) == FALSE,
"Test not matching all strings");
ok(np_expect_match("XX XX", server_expect, server_expect_count, TRUE, FALSE, FALSE) == FALSE,
"Test not matching any string (testing all)");
return exit_status();
}

6
lib/tests/test_tcp.t Executable file
View file

@ -0,0 +1,6 @@
#!/usr/bin/perl
use Test::More;
if (! -e "./test_tcp") {
plan skip_all => "./test_tcp not compiled - please install tap library to test";
}
exec "./test_tcp";

View file

@ -14,7 +14,7 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
$Id: test_utils.c,v 1.2 2006/07/13 23:58:00 tonvoon Exp $
$Id: test_utils.c 1452 2006-07-13 23:58:00Z tonvoon $
******************************************************************************/

View file

@ -8,8 +8,8 @@
* Copyright (c) 2006 Nagios Plugin Development Team
* License: GPL
*
* $Revision: 1.4 $
* $Date: 2007/01/27 17:49:08 $
* $Revision: 1768 $
* $Date: 2007-07-29 13:42:05 +0100 (Sun, 29 Jul 2007) $
****************************************************************************/
#include <stdarg.h>
@ -228,3 +228,18 @@ char *np_escaped_string (const char *string) {
data[j] = '\0';
return data;
}
int np_check_if_root(void) { return (geteuid() == 0); }
int np_warn_if_not_root(void) {
int status = np_check_if_root();
if(!status) {
printf(_("Warning: "));
printf(_("This plugin must be either run as root or setuid root.\n"));
printf(_("To run as root, you can use a tool like sudo.\n"));
printf(_("To set the setuid permissions, use the command:\n"));
/* XXX could we use something like progname? */
printf("\tchmod u+s yourpluginfile\n");
}
return status;
}

View file

@ -31,6 +31,7 @@ typedef struct thresholds_struct {
range *parse_range_string (char *);
int _set_thresholds(thresholds **, char *, char *);
void set_thresholds(thresholds **, char *, char *);
void print_thresholds(const char *, thresholds *);
int check_range(double, range *);
int get_status(double, thresholds *);
@ -42,4 +43,11 @@ void die (int, const char *, ...) __attribute__((noreturn,format(printf, 2, 3)))
#define NP_RANGE_UNPARSEABLE 1
#define NP_WARN_WITHIN_CRIT 2
/* a simple check to see if we're running as root.
* returns zero on failure, nonzero on success */
int np_check_if_root(void);
/* and a helpful wrapper around that. it returns the same status
* code from the above function, in case it's helpful for testing */
int np_warn_if_not_root(void);
#endif /* _UTILS_BASE_ */

378
lib/utils_cmd.c Normal file
View file

@ -0,0 +1,378 @@
/****************************************************************************
* Nagios run command utilities
*
* License: GPL
* Copyright (c) 2005 nagios-plugins team
*
* $Id: utils_cmd.c 1434 2006-06-18 19:36:48Z opensides $
*
* 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
* execve()'d program is essentially empty.
*
*
* The code in this file is a derivative of popen.c which in turn was taken
* from "Advanced Programming for the Unix Environment" by W. Richard Stevens.
*
* Care has been taken to make sure the functions are async-safe. The one
* function which isn't is cmd_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
/** includes **/
#include "common.h"
#include "utils_cmd.h"
#include "utils_base.h"
#ifdef HAVE_SYS_WAIT_H
# include <sys/wait.h>
#endif
/** macros **/
#ifndef WEXITSTATUS
# define WEXITSTATUS(stat_val) ((unsigned)(stat_val) >> 8)
#endif
#ifndef WIFEXITED
# define WIFEXITED(stat_val) (((stat_val) & 255) == 0)
#endif
/* 4.3BSD Reno <signal.h> doesn't define SIG_ERR */
#if defined(SIG_IGN) && !defined(SIG_ERR)
# define SIG_ERR ((Sigfunc *)-1)
#endif
/* This variable must be global, since there's no way the caller
* can forcibly slay a dead or ungainly running program otherwise.
* Multithreading apps and plugins can initialize it (via CMD_INIT)
* in an async safe manner PRIOR to calling cmd_run() or cmd_run_array()
* for the first time.
*
* The check for initialized values is atomic and can
* occur in any number of threads simultaneously. */
static pid_t *_cmd_pids = NULL;
/* Try sysconf(_SC_OPEN_MAX) first, as it can be higher than OPEN_MAX.
* If that fails and the macro isn't defined, we fall back to an educated
* guess. There's no guarantee that our guess is adequate and the program
* will die with SIGSEGV if it isn't and the upper boundary is breached. */
#ifdef _SC_OPEN_MAX
static long maxfd = 0;
#elif defined(OPEN_MAX)
# define maxfd OPEN_MAX
#else /* sysconf macro unavailable, so guess (may be wildly inaccurate) */
# define maxfd 256
#endif
/** prototypes **/
static int _cmd_open (char *const *, int *, int *)
__attribute__ ((__nonnull__ (1, 2, 3)));
static int _cmd_fetch_output (int, output *, int)
__attribute__ ((__nonnull__ (2)));
static int _cmd_close (int);
/* prototype imported from utils.h */
extern void die (int, const char *, ...)
__attribute__ ((__noreturn__, __format__ (__printf__, 2, 3)));
/* this function is NOT async-safe. It is exported so multithreaded
* plugins (or other apps) can call it prior to running any commands
* through this api and thus achieve async-safeness throughout the api */
void
cmd_init (void)
{
#ifndef maxfd
if (!maxfd && (maxfd = sysconf (_SC_OPEN_MAX)) < 0) {
/* possibly log or emit a warning here, since there's no
* guarantee that our guess at maxfd will be adequate */
maxfd = 256;
}
#endif
if (!_cmd_pids)
_cmd_pids = calloc (maxfd, sizeof (pid_t));
}
/* Start running a command, array style */
static int
_cmd_open (char *const *argv, int *pfd, int *pfderr)
{
char *env[2];
pid_t pid;
#ifdef RLIMIT_CORE
struct rlimit limit;
#endif
int i = 0;
/* if no command was passed, return with no error */
if (argv == NULL)
return -1;
if (!_cmd_pids)
CMD_INIT;
env[0] = strdup ("LC_ALL=C");
env[1] = '\0';
if (pipe (pfd) < 0 || pipe (pfderr) < 0 || (pid = fork ()) < 0)
return -1; /* errno set by the failing function */
/* child runs exceve() and _exit. */
if (pid == 0) {
#ifdef RLIMIT_CORE
/* the program we execve shouldn't leave core files */
getrlimit (RLIMIT_CORE, &limit);
limit.rlim_cur = 0;
setrlimit (RLIMIT_CORE, &limit);
#endif
close (pfd[0]);
if (pfd[1] != STDOUT_FILENO) {
dup2 (pfd[1], STDOUT_FILENO);
close (pfd[1]);
}
close (pfderr[0]);
if (pfderr[1] != STDERR_FILENO) {
dup2 (pfderr[1], STDERR_FILENO);
close (pfderr[1]);
}
/* close all descriptors in _cmd_pids[]
* This is executed in a separate address space (pure child),
* so we don't have to worry about async safety */
for (i = 0; i < maxfd; i++)
if (_cmd_pids[i] > 0)
close (i);
execve (argv[0], argv, env);
_exit (STATE_UNKNOWN);
}
/* parent picks up execution here */
/* close childs descriptors in our address space */
close (pfd[1]);
close (pfderr[1]);
/* tag our file's entry in the pid-list and return it */
_cmd_pids[pfd[0]] = pid;
return pfd[0];
}
static int
_cmd_close (int fd)
{
int status;
pid_t pid;
/* make sure the provided fd was opened */
if (fd < 0 || fd > maxfd || !_cmd_pids || (pid = _cmd_pids[fd]) == 0)
return -1;
_cmd_pids[fd] = 0;
if (close (fd) == -1)
return -1;
/* EINTR is ok (sort of), everything else is bad */
while (waitpid (pid, &status, 0) < 0)
if (errno != EINTR)
return -1;
/* return child's termination status */
return (WIFEXITED (status)) ? WEXITSTATUS (status) : -1;
}
static int
_cmd_fetch_output (int fd, output * op, int flags)
{
size_t len = 0, i = 0, lineno = 0;
size_t rsf = 6, ary_size = 0; /* rsf = right shift factor, dec'ed uncond once */
char *buf = NULL;
int ret;
char tmpbuf[4096];
op->buf = NULL;
op->buflen = 0;
while ((ret = read (fd, tmpbuf, sizeof (tmpbuf))) > 0) {
len = (size_t) ret;
op->buf = realloc (op->buf, op->buflen + len + 1);
memcpy (op->buf + op->buflen, tmpbuf, len);
op->buflen += len;
i++;
}
if (ret < 0) {
printf ("read() returned %d: %s\n", ret, strerror (errno));
return ret;
}
/* some plugins may want to keep output unbroken, and some commands
* will yield no output, so return here for those */
if (flags & CMD_NO_ARRAYS || !op->buf || !op->buflen)
return op->buflen;
/* and some may want both */
if (flags & CMD_NO_ASSOC) {
buf = malloc (op->buflen);
memcpy (buf, op->buf, op->buflen);
}
else
buf = op->buf;
op->line = NULL;
op->lens = NULL;
i = 0;
while (i < op->buflen) {
/* make sure we have enough memory */
if (lineno >= ary_size) {
/* ary_size must never be zero */
do {
ary_size = op->buflen >> --rsf;
} while (!ary_size);
op->line = realloc (op->line, ary_size * sizeof (char *));
op->lens = realloc (op->lens, ary_size * sizeof (size_t));
}
/* set the pointer to the string */
op->line[lineno] = &buf[i];
/* hop to next newline or end of buffer */
while (buf[i] != '\n' && i < op->buflen)
i++;
buf[i] = '\0';
/* calculate the string length using pointer difference */
op->lens[lineno] = (size_t) & buf[i] - (size_t) op->line[lineno];
lineno++;
i++;
}
return lineno;
}
int
cmd_run (const char *cmdstring, output * out, output * err, int flags)
{
int fd, pfd_out[2], pfd_err[2];
int i = 0, argc;
size_t cmdlen;
char **argv = NULL;
char *cmd = NULL;
char *str = NULL;
if (cmdstring == NULL)
return -1;
/* initialize the structs */
if (out)
memset (out, 0, sizeof (output));
if (err)
memset (err, 0, sizeof (output));
/* make copy of command string so strtok() doesn't silently modify it */
/* (the calling program may want to access it later) */
cmdlen = strlen (cmdstring);
if ((cmd = malloc (cmdlen + 1)) == NULL)
return -1;
memcpy (cmd, cmdstring, cmdlen);
cmd[cmdlen] = '\0';
/* This is not a shell, so we don't handle "???" */
if (strstr (cmdstring, "\"")) return -1;
/* allow single quotes, but only if non-whitesapce doesn't occur on both sides */
if (strstr (cmdstring, " ' ") || strstr (cmdstring, "'''"))
return -1;
/* each arg must be whitespace-separated, so args can be a maximum
* of (len / 2) + 1. We add 1 extra to the mix for NULL termination */
argc = (cmdlen >> 1) + 2;
argv = calloc (sizeof (char *), argc);
if (argv == NULL) {
printf ("%s\n", _("Could not malloc argv array in popen()"));
return -1;
}
/* get command arguments (stupidly, but fairly quickly) */
while (cmd) {
str = cmd;
str += strspn (str, " \t\r\n"); /* trim any leading whitespace */
if (strstr (str, "'") == str) { /* handle SIMPLE quoted strings */
str++;
if (!strstr (str, "'"))
return -1; /* balanced? */
cmd = 1 + strstr (str, "'");
str[strcspn (str, "'")] = 0;
}
else {
if (strpbrk (str, " \t\r\n")) {
cmd = 1 + strpbrk (str, " \t\r\n");
str[strcspn (str, " \t\r\n")] = 0;
}
else {
cmd = NULL;
}
}
if (cmd && strlen (cmd) == strspn (cmd, " \t\r\n"))
cmd = NULL;
argv[i++] = str;
}
return cmd_run_array (argv, out, err, flags);
}
int
cmd_run_array (char *const *argv, output * out, output * err, int flags)
{
int fd, pfd_out[2], pfd_err[2];
/* initialize the structs */
if (out)
memset (out, 0, sizeof (output));
if (err)
memset (err, 0, sizeof (output));
if ((fd = _cmd_open (argv, pfd_out, pfd_err)) == -1)
die (STATE_UNKNOWN, _("Could not open pipe: %s\n"), argv[0]);
if (out)
out->lines = _cmd_fetch_output (pfd_out[0], out, flags);
if (err)
err->lines = _cmd_fetch_output (pfd_err[0], err, flags);
return _cmd_close (fd);
}

34
lib/utils_cmd.h Normal file
View file

@ -0,0 +1,34 @@
#ifndef _UTILS_CMD_
#define _UTILS_CMD_
/*
* Header file for nagios plugins utils_cmd.c
*
*
*/
/** types **/
struct output
{
char *buf; /* output buffer */
size_t buflen; /* output buffer content length */
char **line; /* array of lines (points to buf) */
size_t *lens; /* string lengths */
size_t lines; /* lines of output */
};
typedef struct output output;
/** prototypes **/
int cmd_run (const char *, output *, output *, int);
int cmd_run_array (char *const *, output *, output *, int);
/* only multi-threaded plugins need to bother with this */
void cmd_init (void);
#define CMD_INIT cmd_init()
/* possible flags for cmd_run()'s fourth argument */
#define CMD_NO_ARRAYS 0x01 /* don't populate arrays at all */
#define CMD_NO_ASSOC 0x02 /* output.line won't point to buf */
#endif /* _UTILS_CMD_ */

View file

@ -4,7 +4,7 @@
* License: GPL
* Copyright (c) 1999-2006 nagios-plugins team
*
* Last Modified: $Date: 2007/04/01 11:17:16 $
* Last Modified: $Date: 2007-09-22 18:48:33 +0100 (Sat, 22 Sep 2007) $
*
* Description:
*
@ -26,7 +26,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*
* $Id: utils_disk.c,v 1.6 2007/04/01 11:17:16 psychotrahe Exp $
* $Id: utils_disk.c 1787 2007-09-22 17:48:33Z psychotrahe $
*
*****************************************************************************/
@ -74,6 +74,26 @@ np_add_parameter(struct parameter_list **list, const char *name)
return new_path;
}
/* Delete a given parameter from list and return pointer to next element*/
struct parameter_list *
np_del_parameter(struct parameter_list *item, struct parameter_list *prev)
{
struct parameter_list *next;
if (item->name_next)
next = item->name_next;
else
next = NULL;
free(item);
if (prev)
prev->name_next = next;
return next;
}
/* returns a pointer to the struct found in the list */
struct parameter_list *
np_find_parameter(struct parameter_list *list, const char *name)
@ -161,8 +181,9 @@ np_regex_match_mount_entry (struct mount_entry* me, regex_t* re)
{
if (regexec(re, me->me_devname, (size_t) 0, NULL, 0) == 0 ||
regexec(re, me->me_mountdir, (size_t) 0, NULL, 0) == 0 ) {
return true;
return TRUE;
} else {
return false;
return FALSE;
}
}

View file

@ -31,6 +31,8 @@ int np_find_name (struct name_list *list, const char *name);
int np_seen_name (struct name_list *list, const char *name);
struct parameter_list *np_add_parameter(struct parameter_list **list, const char *name);
struct parameter_list *np_find_parameter(struct parameter_list *list, const char *name);
struct parameter_list *np_del_parameter(struct parameter_list *item, struct parameter_list *prev);
int search_parameter_list (struct parameter_list *list, const char *name);
void np_set_best_match(struct parameter_list *desired, struct mount_entry *mount_list, int exact);
int np_regex_match_mount_entry (struct mount_entry* me, regex_t* re);

60
lib/utils_tcp.c Normal file
View file

@ -0,0 +1,60 @@
/****************************************************************************
* Utils for check_tcp
*
* License: GPL
* Copyright (c) 1999-2007 nagios-plugins team
*
* Last Modified: $Date: 2007-09-22 18:48:33 +0100 (Sat, 22 Sep 2007) $
*
* Description:
*
* This file contains utilities for check_tcp. These are tested by libtap
*
* 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: utils_tcp.c 1787 2007-09-22 17:48:33Z psychotrahe $
*
*****************************************************************************/
#include "common.h"
#include "utils_tcp.h"
int
np_expect_match(char* status, char** server_expect, int expect_count, int all, int exact_match, int verbose)
{
int match = 0;
int i;
for (i = 0; i < expect_count; i++) {
if (verbose)
printf ("looking for [%s] %s [%s]\n", server_expect[i],
(exact_match) ? "in beginning of" : "anywhere in",
status);
if ((exact_match && !strncmp(status, server_expect[i], strlen(server_expect[i]))) ||
(! exact_match && strstr(status, server_expect[i])))
{
if(verbose) puts("found it");
match += 1;
} else
if(verbose) puts("couldn't find it");
}
if ((all == TRUE && match == expect_count) ||
(! all && match >= 1)) {
return TRUE;
} else
return FALSE;
}

4
lib/utils_tcp.h Normal file
View file

@ -0,0 +1,4 @@
/* Header file for utils_disk */
int np_expect_match(char* status, char** server_expect, int server_expect_count,
int all, int exact_match, int verbose);

View file

@ -1,5 +1,5 @@
Name: nagios-plugins
Version: 1.4.8
Version: 1.4.10
Release: 1
Summary: Host/service/network monitoring program plugins for Nagios

Binary file not shown.

Binary file not shown.

500
perlmods/Makefile Normal file
View file

@ -0,0 +1,500 @@
# Makefile.in generated by automake 1.9.5 from Makefile.am.
# perlmods/Makefile. Generated from Makefile.in by configure.
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
# 2003, 2004, 2005 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
srcdir = .
top_srcdir = ..
pkgdatadir = $(datadir)/nagios-plugins
pkglibdir = $(libdir)/nagios-plugins
pkgincludedir = $(includedir)/nagios-plugins
top_builddir = ..
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
install_sh_DATA = $(install_sh) -c -m 644
install_sh_PROGRAM = $(install_sh) -c
install_sh_SCRIPT = $(install_sh) -c
INSTALL_HEADER = $(INSTALL_DATA)
transform = $(program_transform_name)
NORMAL_INSTALL = :
PRE_INSTALL = :
POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
build_triplet = i686-pc-linux-gnu
host_triplet = i686-pc-linux-gnu
subdir = perlmods
DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/m4/np_mysqlclient.m4 \
$(top_srcdir)/gl/m4/absolute-header.m4 \
$(top_srcdir)/gl/m4/alloca.m4 \
$(top_srcdir)/gl/m4/arpa_inet_h.m4 \
$(top_srcdir)/gl/m4/c-strtod.m4 $(top_srcdir)/gl/m4/cloexec.m4 \
$(top_srcdir)/gl/m4/codeset.m4 $(top_srcdir)/gl/m4/dirname.m4 \
$(top_srcdir)/gl/m4/dos.m4 \
$(top_srcdir)/gl/m4/double-slash-root.m4 \
$(top_srcdir)/gl/m4/eoverflow.m4 $(top_srcdir)/gl/m4/error.m4 \
$(top_srcdir)/gl/m4/exitfail.m4 \
$(top_srcdir)/gl/m4/extensions.m4 \
$(top_srcdir)/gl/m4/fcntl-safer.m4 \
$(top_srcdir)/gl/m4/fstypename.m4 \
$(top_srcdir)/gl/m4/fsusage.m4 \
$(top_srcdir)/gl/m4/getaddrinfo.m4 \
$(top_srcdir)/gl/m4/gethostname.m4 \
$(top_srcdir)/gl/m4/getloadavg.m4 \
$(top_srcdir)/gl/m4/getopt.m4 $(top_srcdir)/gl/m4/gettext.m4 \
$(top_srcdir)/gl/m4/gnulib-common.m4 \
$(top_srcdir)/gl/m4/gnulib-comp.m4 \
$(top_srcdir)/gl/m4/iconv.m4 $(top_srcdir)/gl/m4/inet_ntop.m4 \
$(top_srcdir)/gl/m4/inline.m4 $(top_srcdir)/gl/m4/intmax_t.m4 \
$(top_srcdir)/gl/m4/inttypes_h.m4 \
$(top_srcdir)/gl/m4/lib-ld.m4 $(top_srcdir)/gl/m4/lib-link.m4 \
$(top_srcdir)/gl/m4/lib-prefix.m4 $(top_srcdir)/gl/m4/lock.m4 \
$(top_srcdir)/gl/m4/longdouble.m4 \
$(top_srcdir)/gl/m4/longlong.m4 \
$(top_srcdir)/gl/m4/ls-mntd-fs.m4 \
$(top_srcdir)/gl/m4/mbchar.m4 $(top_srcdir)/gl/m4/mbiter.m4 \
$(top_srcdir)/gl/m4/mbrtowc.m4 $(top_srcdir)/gl/m4/memchr.m4 \
$(top_srcdir)/gl/m4/minmax.m4 $(top_srcdir)/gl/m4/mountlist.m4 \
$(top_srcdir)/gl/m4/netinet_in_h.m4 $(top_srcdir)/gl/m4/nls.m4 \
$(top_srcdir)/gl/m4/onceonly_2_57.m4 $(top_srcdir)/gl/m4/po.m4 \
$(top_srcdir)/gl/m4/progtest.m4 $(top_srcdir)/gl/m4/regex.m4 \
$(top_srcdir)/gl/m4/safe-read.m4 \
$(top_srcdir)/gl/m4/safe-write.m4 \
$(top_srcdir)/gl/m4/size_max.m4 \
$(top_srcdir)/gl/m4/snprintf.m4 $(top_srcdir)/gl/m4/socklen.m4 \
$(top_srcdir)/gl/m4/sockpfaf.m4 $(top_srcdir)/gl/m4/ssize_t.m4 \
$(top_srcdir)/gl/m4/stdbool.m4 $(top_srcdir)/gl/m4/stdint.m4 \
$(top_srcdir)/gl/m4/stdint_h.m4 $(top_srcdir)/gl/m4/strcase.m4 \
$(top_srcdir)/gl/m4/strdup.m4 $(top_srcdir)/gl/m4/strndup.m4 \
$(top_srcdir)/gl/m4/strnlen.m4 \
$(top_srcdir)/gl/m4/sys_socket_h.m4 \
$(top_srcdir)/gl/m4/ulonglong.m4 \
$(top_srcdir)/gl/m4/unistd-safer.m4 \
$(top_srcdir)/gl/m4/unistd_h.m4 \
$(top_srcdir)/gl/m4/vasnprintf.m4 \
$(top_srcdir)/gl/m4/vasprintf.m4 \
$(top_srcdir)/gl/m4/vsnprintf.m4 $(top_srcdir)/gl/m4/wchar.m4 \
$(top_srcdir)/gl/m4/wchar_t.m4 $(top_srcdir)/gl/m4/wctype.m4 \
$(top_srcdir)/gl/m4/wcwidth.m4 $(top_srcdir)/gl/m4/wint_t.m4 \
$(top_srcdir)/gl/m4/xalloc.m4 $(top_srcdir)/gl/m4/xsize.m4 \
$(top_srcdir)/gl/m4/xstrndup.m4 $(top_srcdir)/acinclude.m4 \
$(top_srcdir)/configure.in
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(SHELL) $(top_srcdir)/build-aux/mkinstalldirs
CONFIG_HEADER = $(top_builddir)/config.h
CONFIG_CLEAN_FILES =
SOURCES =
DIST_SOURCES =
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
INSTALL = /usr/bin/install -c
ABSOLUTE_STDINT_H = "///usr/include/stdint.h"
ABSOLUTE_UNISTD_H = "///usr/include/unistd.h"
ABSOLUTE_WCHAR_H =
ABSOLUTE_WCTYPE_H = "///usr/include/wctype.h"
ACLOCAL = ${SHELL} /tmp/nagiosplug/build-aux/missing --run aclocal-1.9
ALLOCA =
ALLOCA_H = alloca.h
AMDEP_FALSE = #
AMDEP_TRUE =
AMTAR = ${SHELL} /tmp/nagiosplug/build-aux/missing --run tar
AR = ar
ARPA_INET_H =
AUTOCONF = ${SHELL} /tmp/nagiosplug/build-aux/missing --run autoconf
AUTOHEADER = ${SHELL} /tmp/nagiosplug/build-aux/missing --run autoheader
AUTOMAKE = ${SHELL} /tmp/nagiosplug/build-aux/missing --run automake-1.9
AWK = mawk
BASENAME = /usr/bin/basename
BITSIZEOF_PTRDIFF_T = 32
BITSIZEOF_SIG_ATOMIC_T = 32
BITSIZEOF_SIZE_T = 32
BITSIZEOF_WCHAR_T = 32
BITSIZEOF_WINT_T = 32
CC = gcc
CCDEPMODE = depmode=gcc3
CFLAGS = -g -O2
CPP = gcc -E
CPPFLAGS =
CXX = g++
CXXCPP = g++ -E
CXXDEPMODE = depmode=gcc3
CXXFLAGS = -g -O2
CYGPATH_W = echo
DEFS = -DHAVE_CONFIG_H
DEPDIR = .deps
DEPLIBS =
ECHO = echo
ECHO_C =
ECHO_N = -n
ECHO_T =
EGREP = grep -E
EOVERFLOW =
EXEEXT =
EXTRAS = check_ldap check_ide_smart check_mysql check_mysql_query check_procs check_nagios check_dns check_by_ssh check_swap check_dig check_apt check_nt
EXTRAS_ROOT =
EXTRA_NETOBJS =
EXTRA_TEST =
F77 =
FFLAGS =
GETLOADAVG_LIBS =
GETOPT_H =
GL_COND_LIBTOOL_FALSE =
GL_COND_LIBTOOL_TRUE = #
GMSGFMT = /usr/bin/msgfmt
GMSGFMT_015 = :
HAVE_INTTYPES_H = 1
HAVE_LONG_LONG_INT = 1
HAVE_SIGNED_SIG_ATOMIC_T = 1
HAVE_SIGNED_WCHAR_T = 1
HAVE_SIGNED_WINT_T = 0
HAVE_STDINT_H = 1
HAVE_SYS_BITYPES_H = 1
HAVE_SYS_INTTYPES_H = 0
HAVE_SYS_TYPES_H = 1
HAVE_UNSIGNED_LONG_LONG_INT = 1
HAVE_WCTYPE_H = 1
HAVE_WINT_T = 1
HAVE__BOOL = 1
HOSTNAME = /bin/hostname
INSTALL_DATA = ${INSTALL} -m 644
INSTALL_PROGRAM = ${INSTALL}
INSTALL_SCRIPT = ${INSTALL}
INSTALL_STRIP_PROGRAM = ${SHELL} $(install_sh) -c -s
INTLLIBS =
INTL_MACOSX_LIBS =
KMEM_GROUP =
KRBINCLUDE =
LDAPINCLUDE = -I/usr/include/ldap
LDAPLIBS = -lldap -llber
LDFLAGS = -L.
LIBGNUTLS_CONFIG =
LIBGNU_LIBDEPS =
LIBGNU_LTLIBDEPS =
LIBICONV = -liconv
LIBINTL =
LIBOBJS =
LIBS =
LIBTOOL = $(SHELL) $(top_builddir)/libtool
LN_S = ln -s
LTLIBICONV = -liconv
LTLIBINTL =
LTLIBOBJS =
MAKEINFO = ${SHELL} /tmp/nagiosplug/build-aux/missing --run makeinfo
MATHLIBS = -lm
MKDIR_P = $(mkdir_p)
MSGFMT = /usr/bin/msgfmt
MSGFMT_015 = :
MSGMERGE = /usr/bin/msgmerge
MYSQLCFLAGS = -I/usr/include/mysql -DBIG_JOINS=1
MYSQLINCLUDE = -I/usr/include/mysql
MYSQLLIBS = -L/usr/lib -lmysqlclient -lz -lcrypt -lnsl -lm
NEED_SETGID = false
NETINET_IN_H =
OBJEXT = o
PACKAGE = nagios-plugins
PACKAGE_BUGREPORT =
PACKAGE_NAME = nagios-plugins
PACKAGE_STRING = nagios-plugins 1.4.10
PACKAGE_TARNAME = nagios-plugins
PACKAGE_VERSION = 1.4.10
PATH_SEPARATOR = :
PATH_TO_APTGET = /usr/bin/apt-get
PATH_TO_DIG = /usr/bin/dig
PATH_TO_FPING =
PATH_TO_LMSTAT =
PATH_TO_LSPS =
PATH_TO_MAILQ = /usr/bin/mailq
PATH_TO_NSLOOKUP = /usr/bin/nslookup
PATH_TO_PING = /bin/ping
PATH_TO_PING6 = /bin/ping6
PATH_TO_PS = /bin/ps
PATH_TO_QMAIL_QSTAT =
PATH_TO_QSTAT =
PATH_TO_QUAKESTAT =
PATH_TO_RPCINFO = /usr/bin/rpcinfo
PATH_TO_SMBCLIENT =
PATH_TO_SNMPGET =
PATH_TO_SNMPGETNEXT =
PATH_TO_SSH = /usr/bin/ssh
PATH_TO_SWAP =
PATH_TO_SWAPINFO =
PATH_TO_UPTIME = /usr/bin/uptime
PATH_TO_WHO = /usr/bin/who
PERL = /usr/bin/perl
PERLMODS_DIR =
PGINCLUDE =
PGLIBS =
PKG_ARCH =
PLUGIN_TEST = t/check_cluster.t t/check_disk.t t/check_dns.t t/check_dummy.t t/check_fping.t t/check_ftp.t t/check_hpjd.t t/check_http.t t/check_imap.t t/check_jabber.t t/check_load.t t/check_mysql.t t/check_mysql_query.t t/check_nagios.t t/check_ntp.t t/check_ping.t t/check_pop.t t/check_procs.t t/check_smtp.t t/check_snmp.t t/check_swap.t t/check_tcp.t t/check_time.t t/check_udp.t t/check_users.t t/negate.t
POSUB = po
POW_LIB =
PTRDIFF_T_SUFFIX =
PYTHON = /usr/bin/python
RADIUSLIBS =
RANLIB = ranlib
RELEASE = 1
REV_DATESTAMP = 2007.09.29.02.03
REV_TIMESTAMP = 20070929020318
SCRIPT_TEST = t/check_file_age.t t/check_rpc.t t/utils.t
SET_MAKE =
SH = /bin/sh
SHELL = /bin/sh
SIG_ATOMIC_T_SUFFIX =
SIZE_T_SUFFIX = u
SOCKETLIBS = -lnsl -lresolv
SSLINCLUDE = -I/usr/include
SSLLIBS = -lssl -lcrypto
STDBOOL_H =
STDINT_H = stdint.h
STRIP = strip
SUPPORT = Send email to nagios-users@lists.sourceforge.net if you have questions\nregarding use of this software. To submit patches or suggest improvements,\nsend email to nagiosplug-devel@lists.sourceforge.net.\nPlease include version information with all correspondence (when possible,\nuse output from the --version option of the plugin itself).\n
SYS_SOCKET_H =
UNISTD_H =
USE_NLS = yes
VERSION = 1.4.10
WARRANTY = The nagios plugins come with ABSOLUTELY NO WARRANTY. You may redistribute\ncopies of the plugins under the terms of the GNU General Public License.\nFor more information about these matters, see the file named COPYING.\n
WCHAR_H =
WCHAR_T_SUFFIX = l
WCTYPE_H =
WINT_T_SUFFIX = u
XGETTEXT = /usr/bin/xgettext
XGETTEXT_015 = :
ac_ct_AR = ar
ac_ct_CC = gcc
ac_ct_CXX = g++
ac_ct_F77 =
ac_ct_RANLIB = ranlib
ac_ct_STRIP = strip
am__fastdepCC_FALSE = #
am__fastdepCC_TRUE =
am__fastdepCXX_FALSE = #
am__fastdepCXX_TRUE =
am__include = include
am__leading_dot = .
am__quote =
am__tar = ${AMTAR} chof - "$$tardir"
am__untar = ${AMTAR} xf -
bindir = ${exec_prefix}/bin
build = i686-pc-linux-gnu
build_alias =
build_cpu = i686
build_os = linux-gnu
build_vendor = pc
check_tcp_ssl = check_simap check_spop check_jabber check_nntps check_ssmtp
datadir = ${prefix}/share
exec_prefix = ${prefix}
gl_LIBOBJS = asnprintf.o basename.o c-strtod.o cloexec.o creat-safer.o dirname.o dup-safer.o exitfail.o fd-safer.o fsusage.o mbchar.o mountlist.o open-safer.o pipe-safer.o printf-args.o printf-parse.o regex.o safe-read.o safe-write.o strcasecmp.o stripslash.o vasnprintf.o xmalloc.o
gl_LTLIBOBJS = asnprintf.lo basename.lo c-strtod.lo cloexec.lo creat-safer.lo dirname.lo dup-safer.lo exitfail.lo fd-safer.lo fsusage.lo mbchar.lo mountlist.lo open-safer.lo pipe-safer.lo printf-args.lo printf-parse.lo regex.lo safe-read.lo safe-write.lo strcasecmp.lo stripslash.lo vasnprintf.lo xmalloc.lo
host = i686-pc-linux-gnu
host_alias =
host_cpu = i686
host_os = linux-gnu
host_vendor = pc
includedir = ${prefix}/include
infodir = ${prefix}/info
install_sh = /tmp/nagiosplug/build-aux/install-sh
libdir = ${exec_prefix}/lib
libexecdir = ${exec_prefix}/libexec
localedir = ${datadir}/locale
localstatedir = ${prefix}/var
mandir = ${prefix}/man
mkdir_p = mkdir -p --
np_mysql_config = /usr/bin/mysql_config
oldincludedir = /usr/include
prefix = /usr/local/nagios
program_transform_name = s,x,x,
sbindir = ${exec_prefix}/sbin
sharedstatedir = ${prefix}/com
sysconfdir = ${prefix}/etc
target_alias =
with_trusted_path = /bin:/sbin:/usr/bin:/usr/sbin
perlmoduledir = $(exec_prefix)/perl
all: all-am
.SUFFIXES:
$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
@for dep in $?; do \
case '$(am__configure_deps)' in \
*$$dep*) \
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
&& exit 0; \
exit 1;; \
esac; \
done; \
echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu perlmods/Makefile'; \
cd $(top_srcdir) && \
$(AUTOMAKE) --gnu perlmods/Makefile
.PRECIOUS: Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
*config.status*) \
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
*) \
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
esac;
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(top_srcdir)/configure: $(am__configure_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(ACLOCAL_M4): $(am__aclocal_m4_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
mostlyclean-libtool:
-rm -f *.lo
clean-libtool:
-rm -rf .libs _libs
distclean-libtool:
-rm -f libtool
uninstall-info-am:
tags: TAGS
TAGS:
ctags: CTAGS
CTAGS:
distdir: $(DISTFILES)
@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
list='$(DISTFILES)'; for file in $$list; do \
case $$file in \
$(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
$(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
esac; \
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
if test "$$dir" != "$$file" && test "$$dir" != "."; then \
dir="/$$dir"; \
$(mkdir_p) "$(distdir)$$dir"; \
else \
dir=''; \
fi; \
if test -d $$d/$$file; then \
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
fi; \
cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
else \
test -f $(distdir)/$$file \
|| cp -p $$d/$$file $(distdir)/$$file \
|| exit 1; \
fi; \
done
check-am: all-am
check: check-am
all-am: Makefile all-local
installdirs:
install: install-am
install-exec: install-exec-am
install-data: install-data-am
uninstall: uninstall-am
install-am: all-am
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
installcheck: installcheck-am
install-strip:
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
`test -z '$(STRIP)' || \
echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
mostlyclean-generic:
clean-generic:
distclean-generic:
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
maintainer-clean-generic:
@echo "This command is intended for maintainers to use"
@echo "it deletes files that may require special tools to rebuild."
clean: clean-am
clean-am: clean-generic clean-libtool clean-local mostlyclean-am
distclean: distclean-am
-rm -f Makefile
distclean-am: clean-am distclean-generic distclean-libtool
dvi: dvi-am
dvi-am:
html: html-am
info: info-am
info-am:
install-data-am:
install-exec-am: install-exec-local
install-info: install-info-am
install-man:
installcheck-am:
maintainer-clean: maintainer-clean-am
-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic
mostlyclean: mostlyclean-am
mostlyclean-am: mostlyclean-generic mostlyclean-libtool
pdf: pdf-am
pdf-am:
ps: ps-am
ps-am:
uninstall-am: uninstall-info-am
.PHONY: all all-am all-local check check-am clean clean-generic \
clean-libtool clean-local distclean distclean-generic \
distclean-libtool distdir dvi dvi-am html html-am info info-am \
install install-am install-data install-data-am install-exec \
install-exec-am install-exec-local install-info \
install-info-am install-man install-strip installcheck \
installcheck-am installdirs maintainer-clean \
maintainer-clean-generic mostlyclean mostlyclean-generic \
mostlyclean-libtool pdf pdf-am ps ps-am uninstall uninstall-am \
uninstall-info-am
all-local:
$(top_srcdir)/tools/build_perl_modules -d $(perlmoduledir) -m .
install-exec-local:
$(top_srcdir)/tools/build_perl_modules -d $(perlmoduledir) -i .
test:
$(top_srcdir)/tools/build_perl_modules -d $(perlmoduledir) -t .
clean-local:
$(top_srcdir)/tools/build_perl_modules -d $(perlmoduledir) -c .
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:

13
perlmods/Makefile.am Normal file
View file

@ -0,0 +1,13 @@
perlmoduledir = $(exec_prefix)/perl
all-local:
$(top_srcdir)/tools/build_perl_modules -d $(perlmoduledir) -m .
install-exec-local:
$(top_srcdir)/tools/build_perl_modules -d $(perlmoduledir) -i .
test:
$(top_srcdir)/tools/build_perl_modules -d $(perlmoduledir) -t .
clean-local:
$(top_srcdir)/tools/build_perl_modules -d $(perlmoduledir) -c .

500
perlmods/Makefile.in Normal file
View file

@ -0,0 +1,500 @@
# Makefile.in generated by automake 1.9.5 from Makefile.am.
# @configure_input@
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
# 2003, 2004, 2005 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
@SET_MAKE@
srcdir = @srcdir@
top_srcdir = @top_srcdir@
VPATH = @srcdir@
pkgdatadir = $(datadir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
top_builddir = ..
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
install_sh_DATA = $(install_sh) -c -m 644
install_sh_PROGRAM = $(install_sh) -c
install_sh_SCRIPT = $(install_sh) -c
INSTALL_HEADER = $(INSTALL_DATA)
transform = $(program_transform_name)
NORMAL_INSTALL = :
PRE_INSTALL = :
POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
build_triplet = @build@
host_triplet = @host@
subdir = perlmods
DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/m4/np_mysqlclient.m4 \
$(top_srcdir)/gl/m4/absolute-header.m4 \
$(top_srcdir)/gl/m4/alloca.m4 \
$(top_srcdir)/gl/m4/arpa_inet_h.m4 \
$(top_srcdir)/gl/m4/c-strtod.m4 $(top_srcdir)/gl/m4/cloexec.m4 \
$(top_srcdir)/gl/m4/codeset.m4 $(top_srcdir)/gl/m4/dirname.m4 \
$(top_srcdir)/gl/m4/dos.m4 \
$(top_srcdir)/gl/m4/double-slash-root.m4 \
$(top_srcdir)/gl/m4/eoverflow.m4 $(top_srcdir)/gl/m4/error.m4 \
$(top_srcdir)/gl/m4/exitfail.m4 \
$(top_srcdir)/gl/m4/extensions.m4 \
$(top_srcdir)/gl/m4/fcntl-safer.m4 \
$(top_srcdir)/gl/m4/fstypename.m4 \
$(top_srcdir)/gl/m4/fsusage.m4 \
$(top_srcdir)/gl/m4/getaddrinfo.m4 \
$(top_srcdir)/gl/m4/gethostname.m4 \
$(top_srcdir)/gl/m4/getloadavg.m4 \
$(top_srcdir)/gl/m4/getopt.m4 $(top_srcdir)/gl/m4/gettext.m4 \
$(top_srcdir)/gl/m4/gnulib-common.m4 \
$(top_srcdir)/gl/m4/gnulib-comp.m4 \
$(top_srcdir)/gl/m4/iconv.m4 $(top_srcdir)/gl/m4/inet_ntop.m4 \
$(top_srcdir)/gl/m4/inline.m4 $(top_srcdir)/gl/m4/intmax_t.m4 \
$(top_srcdir)/gl/m4/inttypes_h.m4 \
$(top_srcdir)/gl/m4/lib-ld.m4 $(top_srcdir)/gl/m4/lib-link.m4 \
$(top_srcdir)/gl/m4/lib-prefix.m4 $(top_srcdir)/gl/m4/lock.m4 \
$(top_srcdir)/gl/m4/longdouble.m4 \
$(top_srcdir)/gl/m4/longlong.m4 \
$(top_srcdir)/gl/m4/ls-mntd-fs.m4 \
$(top_srcdir)/gl/m4/mbchar.m4 $(top_srcdir)/gl/m4/mbiter.m4 \
$(top_srcdir)/gl/m4/mbrtowc.m4 $(top_srcdir)/gl/m4/memchr.m4 \
$(top_srcdir)/gl/m4/minmax.m4 $(top_srcdir)/gl/m4/mountlist.m4 \
$(top_srcdir)/gl/m4/netinet_in_h.m4 $(top_srcdir)/gl/m4/nls.m4 \
$(top_srcdir)/gl/m4/onceonly_2_57.m4 $(top_srcdir)/gl/m4/po.m4 \
$(top_srcdir)/gl/m4/progtest.m4 $(top_srcdir)/gl/m4/regex.m4 \
$(top_srcdir)/gl/m4/safe-read.m4 \
$(top_srcdir)/gl/m4/safe-write.m4 \
$(top_srcdir)/gl/m4/size_max.m4 \
$(top_srcdir)/gl/m4/snprintf.m4 $(top_srcdir)/gl/m4/socklen.m4 \
$(top_srcdir)/gl/m4/sockpfaf.m4 $(top_srcdir)/gl/m4/ssize_t.m4 \
$(top_srcdir)/gl/m4/stdbool.m4 $(top_srcdir)/gl/m4/stdint.m4 \
$(top_srcdir)/gl/m4/stdint_h.m4 $(top_srcdir)/gl/m4/strcase.m4 \
$(top_srcdir)/gl/m4/strdup.m4 $(top_srcdir)/gl/m4/strndup.m4 \
$(top_srcdir)/gl/m4/strnlen.m4 \
$(top_srcdir)/gl/m4/sys_socket_h.m4 \
$(top_srcdir)/gl/m4/ulonglong.m4 \
$(top_srcdir)/gl/m4/unistd-safer.m4 \
$(top_srcdir)/gl/m4/unistd_h.m4 \
$(top_srcdir)/gl/m4/vasnprintf.m4 \
$(top_srcdir)/gl/m4/vasprintf.m4 \
$(top_srcdir)/gl/m4/vsnprintf.m4 $(top_srcdir)/gl/m4/wchar.m4 \
$(top_srcdir)/gl/m4/wchar_t.m4 $(top_srcdir)/gl/m4/wctype.m4 \
$(top_srcdir)/gl/m4/wcwidth.m4 $(top_srcdir)/gl/m4/wint_t.m4 \
$(top_srcdir)/gl/m4/xalloc.m4 $(top_srcdir)/gl/m4/xsize.m4 \
$(top_srcdir)/gl/m4/xstrndup.m4 $(top_srcdir)/acinclude.m4 \
$(top_srcdir)/configure.in
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(SHELL) $(top_srcdir)/build-aux/mkinstalldirs
CONFIG_HEADER = $(top_builddir)/config.h
CONFIG_CLEAN_FILES =
SOURCES =
DIST_SOURCES =
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
INSTALL = @INSTALL@
ABSOLUTE_STDINT_H = @ABSOLUTE_STDINT_H@
ABSOLUTE_UNISTD_H = @ABSOLUTE_UNISTD_H@
ABSOLUTE_WCHAR_H = @ABSOLUTE_WCHAR_H@
ABSOLUTE_WCTYPE_H = @ABSOLUTE_WCTYPE_H@
ACLOCAL = @ACLOCAL@
ALLOCA = @ALLOCA@
ALLOCA_H = @ALLOCA_H@
AMDEP_FALSE = @AMDEP_FALSE@
AMDEP_TRUE = @AMDEP_TRUE@
AMTAR = @AMTAR@
AR = @AR@
ARPA_INET_H = @ARPA_INET_H@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
BASENAME = @BASENAME@
BITSIZEOF_PTRDIFF_T = @BITSIZEOF_PTRDIFF_T@
BITSIZEOF_SIG_ATOMIC_T = @BITSIZEOF_SIG_ATOMIC_T@
BITSIZEOF_SIZE_T = @BITSIZEOF_SIZE_T@
BITSIZEOF_WCHAR_T = @BITSIZEOF_WCHAR_T@
BITSIZEOF_WINT_T = @BITSIZEOF_WINT_T@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CXX = @CXX@
CXXCPP = @CXXCPP@
CXXDEPMODE = @CXXDEPMODE@
CXXFLAGS = @CXXFLAGS@
CYGPATH_W = @CYGPATH_W@
DEFS = @DEFS@
DEPDIR = @DEPDIR@
DEPLIBS = @DEPLIBS@
ECHO = @ECHO@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EGREP = @EGREP@
EOVERFLOW = @EOVERFLOW@
EXEEXT = @EXEEXT@
EXTRAS = @EXTRAS@
EXTRAS_ROOT = @EXTRAS_ROOT@
EXTRA_NETOBJS = @EXTRA_NETOBJS@
EXTRA_TEST = @EXTRA_TEST@
F77 = @F77@
FFLAGS = @FFLAGS@
GETLOADAVG_LIBS = @GETLOADAVG_LIBS@
GETOPT_H = @GETOPT_H@
GL_COND_LIBTOOL_FALSE = @GL_COND_LIBTOOL_FALSE@
GL_COND_LIBTOOL_TRUE = @GL_COND_LIBTOOL_TRUE@
GMSGFMT = @GMSGFMT@
GMSGFMT_015 = @GMSGFMT_015@
HAVE_INTTYPES_H = @HAVE_INTTYPES_H@
HAVE_LONG_LONG_INT = @HAVE_LONG_LONG_INT@
HAVE_SIGNED_SIG_ATOMIC_T = @HAVE_SIGNED_SIG_ATOMIC_T@
HAVE_SIGNED_WCHAR_T = @HAVE_SIGNED_WCHAR_T@
HAVE_SIGNED_WINT_T = @HAVE_SIGNED_WINT_T@
HAVE_STDINT_H = @HAVE_STDINT_H@
HAVE_SYS_BITYPES_H = @HAVE_SYS_BITYPES_H@
HAVE_SYS_INTTYPES_H = @HAVE_SYS_INTTYPES_H@
HAVE_SYS_TYPES_H = @HAVE_SYS_TYPES_H@
HAVE_UNSIGNED_LONG_LONG_INT = @HAVE_UNSIGNED_LONG_LONG_INT@
HAVE_WCTYPE_H = @HAVE_WCTYPE_H@
HAVE_WINT_T = @HAVE_WINT_T@
HAVE__BOOL = @HAVE__BOOL@
HOSTNAME = @HOSTNAME@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
INTLLIBS = @INTLLIBS@
INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@
KMEM_GROUP = @KMEM_GROUP@
KRBINCLUDE = @KRBINCLUDE@
LDAPINCLUDE = @LDAPINCLUDE@
LDAPLIBS = @LDAPLIBS@
LDFLAGS = @LDFLAGS@
LIBGNUTLS_CONFIG = @LIBGNUTLS_CONFIG@
LIBGNU_LIBDEPS = @LIBGNU_LIBDEPS@
LIBGNU_LTLIBDEPS = @LIBGNU_LTLIBDEPS@
LIBICONV = @LIBICONV@
LIBINTL = @LIBINTL@
LIBOBJS = @LIBOBJS@
LIBS = @LIBS@
LIBTOOL = @LIBTOOL@
LN_S = @LN_S@
LTLIBICONV = @LTLIBICONV@
LTLIBINTL = @LTLIBINTL@
LTLIBOBJS = @LTLIBOBJS@
MAKEINFO = @MAKEINFO@
MATHLIBS = @MATHLIBS@
MKDIR_P = @MKDIR_P@
MSGFMT = @MSGFMT@
MSGFMT_015 = @MSGFMT_015@
MSGMERGE = @MSGMERGE@
MYSQLCFLAGS = @MYSQLCFLAGS@
MYSQLINCLUDE = @MYSQLINCLUDE@
MYSQLLIBS = @MYSQLLIBS@
NEED_SETGID = @NEED_SETGID@
NETINET_IN_H = @NETINET_IN_H@
OBJEXT = @OBJEXT@
PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
PACKAGE_NAME = @PACKAGE_NAME@
PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
PATH_TO_APTGET = @PATH_TO_APTGET@
PATH_TO_DIG = @PATH_TO_DIG@
PATH_TO_FPING = @PATH_TO_FPING@
PATH_TO_LMSTAT = @PATH_TO_LMSTAT@
PATH_TO_LSPS = @PATH_TO_LSPS@
PATH_TO_MAILQ = @PATH_TO_MAILQ@
PATH_TO_NSLOOKUP = @PATH_TO_NSLOOKUP@
PATH_TO_PING = @PATH_TO_PING@
PATH_TO_PING6 = @PATH_TO_PING6@
PATH_TO_PS = @PATH_TO_PS@
PATH_TO_QMAIL_QSTAT = @PATH_TO_QMAIL_QSTAT@
PATH_TO_QSTAT = @PATH_TO_QSTAT@
PATH_TO_QUAKESTAT = @PATH_TO_QUAKESTAT@
PATH_TO_RPCINFO = @PATH_TO_RPCINFO@
PATH_TO_SMBCLIENT = @PATH_TO_SMBCLIENT@
PATH_TO_SNMPGET = @PATH_TO_SNMPGET@
PATH_TO_SNMPGETNEXT = @PATH_TO_SNMPGETNEXT@
PATH_TO_SSH = @PATH_TO_SSH@
PATH_TO_SWAP = @PATH_TO_SWAP@
PATH_TO_SWAPINFO = @PATH_TO_SWAPINFO@
PATH_TO_UPTIME = @PATH_TO_UPTIME@
PATH_TO_WHO = @PATH_TO_WHO@
PERL = @PERL@
PERLMODS_DIR = @PERLMODS_DIR@
PGINCLUDE = @PGINCLUDE@
PGLIBS = @PGLIBS@
PKG_ARCH = @PKG_ARCH@
PLUGIN_TEST = @PLUGIN_TEST@
POSUB = @POSUB@
POW_LIB = @POW_LIB@
PTRDIFF_T_SUFFIX = @PTRDIFF_T_SUFFIX@
PYTHON = @PYTHON@
RADIUSLIBS = @RADIUSLIBS@
RANLIB = @RANLIB@
RELEASE = @RELEASE@
REV_DATESTAMP = @REV_DATESTAMP@
REV_TIMESTAMP = @REV_TIMESTAMP@
SCRIPT_TEST = @SCRIPT_TEST@
SET_MAKE = @SET_MAKE@
SH = @SH@
SHELL = @SHELL@
SIG_ATOMIC_T_SUFFIX = @SIG_ATOMIC_T_SUFFIX@
SIZE_T_SUFFIX = @SIZE_T_SUFFIX@
SOCKETLIBS = @SOCKETLIBS@
SSLINCLUDE = @SSLINCLUDE@
SSLLIBS = @SSLLIBS@
STDBOOL_H = @STDBOOL_H@
STDINT_H = @STDINT_H@
STRIP = @STRIP@
SUPPORT = @SUPPORT@
SYS_SOCKET_H = @SYS_SOCKET_H@
UNISTD_H = @UNISTD_H@
USE_NLS = @USE_NLS@
VERSION = @VERSION@
WARRANTY = @WARRANTY@
WCHAR_H = @WCHAR_H@
WCHAR_T_SUFFIX = @WCHAR_T_SUFFIX@
WCTYPE_H = @WCTYPE_H@
WINT_T_SUFFIX = @WINT_T_SUFFIX@
XGETTEXT = @XGETTEXT@
XGETTEXT_015 = @XGETTEXT_015@
ac_ct_AR = @ac_ct_AR@
ac_ct_CC = @ac_ct_CC@
ac_ct_CXX = @ac_ct_CXX@
ac_ct_F77 = @ac_ct_F77@
ac_ct_RANLIB = @ac_ct_RANLIB@
ac_ct_STRIP = @ac_ct_STRIP@
am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
am__include = @am__include@
am__leading_dot = @am__leading_dot@
am__quote = @am__quote@
am__tar = @am__tar@
am__untar = @am__untar@
bindir = @bindir@
build = @build@
build_alias = @build_alias@
build_cpu = @build_cpu@
build_os = @build_os@
build_vendor = @build_vendor@
check_tcp_ssl = @check_tcp_ssl@
datadir = @datadir@
exec_prefix = @exec_prefix@
gl_LIBOBJS = @gl_LIBOBJS@
gl_LTLIBOBJS = @gl_LTLIBOBJS@
host = @host@
host_alias = @host_alias@
host_cpu = @host_cpu@
host_os = @host_os@
host_vendor = @host_vendor@
includedir = @includedir@
infodir = @infodir@
install_sh = @install_sh@
libdir = @libdir@
libexecdir = @libexecdir@
localedir = @localedir@
localstatedir = @localstatedir@
mandir = @mandir@
mkdir_p = @mkdir_p@
np_mysql_config = @np_mysql_config@
oldincludedir = @oldincludedir@
prefix = @prefix@
program_transform_name = @program_transform_name@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
sysconfdir = @sysconfdir@
target_alias = @target_alias@
with_trusted_path = @with_trusted_path@
perlmoduledir = $(exec_prefix)/perl
all: all-am
.SUFFIXES:
$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
@for dep in $?; do \
case '$(am__configure_deps)' in \
*$$dep*) \
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
&& exit 0; \
exit 1;; \
esac; \
done; \
echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu perlmods/Makefile'; \
cd $(top_srcdir) && \
$(AUTOMAKE) --gnu perlmods/Makefile
.PRECIOUS: Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
*config.status*) \
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
*) \
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
esac;
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(top_srcdir)/configure: $(am__configure_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(ACLOCAL_M4): $(am__aclocal_m4_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
mostlyclean-libtool:
-rm -f *.lo
clean-libtool:
-rm -rf .libs _libs
distclean-libtool:
-rm -f libtool
uninstall-info-am:
tags: TAGS
TAGS:
ctags: CTAGS
CTAGS:
distdir: $(DISTFILES)
@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
list='$(DISTFILES)'; for file in $$list; do \
case $$file in \
$(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
$(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
esac; \
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
if test "$$dir" != "$$file" && test "$$dir" != "."; then \
dir="/$$dir"; \
$(mkdir_p) "$(distdir)$$dir"; \
else \
dir=''; \
fi; \
if test -d $$d/$$file; then \
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
fi; \
cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
else \
test -f $(distdir)/$$file \
|| cp -p $$d/$$file $(distdir)/$$file \
|| exit 1; \
fi; \
done
check-am: all-am
check: check-am
all-am: Makefile all-local
installdirs:
install: install-am
install-exec: install-exec-am
install-data: install-data-am
uninstall: uninstall-am
install-am: all-am
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
installcheck: installcheck-am
install-strip:
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
`test -z '$(STRIP)' || \
echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
mostlyclean-generic:
clean-generic:
distclean-generic:
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
maintainer-clean-generic:
@echo "This command is intended for maintainers to use"
@echo "it deletes files that may require special tools to rebuild."
clean: clean-am
clean-am: clean-generic clean-libtool clean-local mostlyclean-am
distclean: distclean-am
-rm -f Makefile
distclean-am: clean-am distclean-generic distclean-libtool
dvi: dvi-am
dvi-am:
html: html-am
info: info-am
info-am:
install-data-am:
install-exec-am: install-exec-local
install-info: install-info-am
install-man:
installcheck-am:
maintainer-clean: maintainer-clean-am
-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic
mostlyclean: mostlyclean-am
mostlyclean-am: mostlyclean-generic mostlyclean-libtool
pdf: pdf-am
pdf-am:
ps: ps-am
ps-am:
uninstall-am: uninstall-info-am
.PHONY: all all-am all-local check check-am clean clean-generic \
clean-libtool clean-local distclean distclean-generic \
distclean-libtool distdir dvi dvi-am html html-am info info-am \
install install-am install-data install-data-am install-exec \
install-exec-am install-exec-local install-info \
install-info-am install-man install-strip installcheck \
installcheck-am installdirs maintainer-clean \
maintainer-clean-generic mostlyclean mostlyclean-generic \
mostlyclean-libtool pdf pdf-am ps ps-am uninstall uninstall-am \
uninstall-info-am
all-local:
$(top_srcdir)/tools/build_perl_modules -d $(perlmoduledir) -m .
install-exec-local:
$(top_srcdir)/tools/build_perl_modules -d $(perlmoduledir) -i .
test:
$(top_srcdir)/tools/build_perl_modules -d $(perlmoduledir) -t .
clean-local:
$(top_srcdir)/tools/build_perl_modules -d $(perlmoduledir) -c .
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

7
perlmods/install_order Normal file
View file

@ -0,0 +1,7 @@
# Modules installed in this order
Test-Simple
Params-Validate
Math-Calc-Units
Class-Accessor
Config-Tiny
Nagios-Plugin

View file

@ -1,2 +0,0 @@
.cvsignore
pkginfo

View file

@ -2,11 +2,11 @@ PKG="NAGplugin"
NAME="nagios-plugins"
DESC="Nagios network monitoring plugins"
ARCH=""
VERSION="1.4.8,REV=2007.04.11.13.13"
VERSION="1.4.10,REV=2007.09.29.02.03"
CATEGORY="application"
VENDOR="Nagios Plugin Development Team"
EMAIL="nagiosplug-devel@lists.sourceforge.net"
PSTAMP="nag20070411131329"
PSTAMP="nag20070929020318"
BASEDIR="/"
CLASSES="none"

View file

@ -1,4 +1,4 @@
# Makefile.in generated by automake 1.9.6 from Makefile.am.
# Makefile.in generated by automake 1.9.5 from Makefile.am.
# @configure_input@
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
@ -14,6 +14,8 @@
@SET_MAKE@
SOURCES = check_dhcp.c check_icmp.c pst3.c
srcdir = @srcdir@
top_srcdir = @top_srcdir@
pkgdatadir = $(datadir)/@PACKAGE@
@ -97,7 +99,7 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/np_mysqlclient.m4 \
$(top_srcdir)/configure.in
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(install_sh) -d
mkinstalldirs = $(SHELL) $(top_srcdir)/build-aux/mkinstalldirs
CONFIG_HEADER = $(top_builddir)/config.h
CONFIG_CLEAN_FILES =
PROGRAMS = $(noinst_PROGRAMS)
@ -265,6 +267,7 @@ PATH_TO_SWAPINFO = @PATH_TO_SWAPINFO@
PATH_TO_UPTIME = @PATH_TO_UPTIME@
PATH_TO_WHO = @PATH_TO_WHO@
PERL = @PERL@
PERLMODS_DIR = @PERLMODS_DIR@
PGINCLUDE = @PGINCLUDE@
PGLIBS = @PGLIBS@
PKG_ARCH = @PKG_ARCH@

View file

@ -6,7 +6,7 @@
* Copyright (c) 2001-2004 Ethan Galstad (nagios@nagios.org)
* Copyright (c) 2001-2006 Nagios Plugin Development Team
*
* Last Modified: $Date: 2007/01/28 21:46:41 $
* Last Modified: $Date: 2007-07-26 18:32:37 +0100 (Thu, 26 Jul 2007) $
*
* Description:
*
@ -31,12 +31,18 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*
* $Id: check_dhcp.c,v 1.8 2007/01/28 21:46:41 hweiss Exp $
* $Id: check_dhcp.c 1766 2007-07-26 17:32:37Z hweiss $
*
* ------------------------------------------------------------------------
* Unicast mode was originally implemented by Heiti of Boras Kommun with
* general improvements as well as usability fixes and "forward"-porting by
* Andreas Ericsson of OP5 AB.
* ------------------------------------------------------------------------
*
*****************************************************************************/
const char *progname = "check_dhcp";
const char *revision = "$Revision: 1.8 $";
const char *revision = "$Revision: 1766 $";
const char *copyright = "2001-2006";
const char *email = "nagiosplug-devel@lists.sourceforge.net";
@ -44,6 +50,7 @@ const char *email = "nagiosplug-devel@lists.sourceforge.net";
#include "netutils.h"
#include "utils.h"
#include <ctype.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@ -59,6 +66,9 @@ const char *email = "nagiosplug-devel@lists.sourceforge.net";
#include <netinet/in.h>
#include <net/if.h>
#include <arpa/inet.h>
#if HAVE_SYS_SOCKIO_H
#include <sys/sockio.h>
#endif
#if defined( __linux__ )
@ -182,12 +192,15 @@ typedef struct requested_server_struct{
#define DHCP_OPTION_BROADCAST_ADDRESS 28
#define DHCP_OPTION_REQUESTED_ADDRESS 50
#define DHCP_OPTION_LEASE_TIME 51
#define DHCP_OPTION_SERVER_IDENTIFIER 54
#define DHCP_OPTION_RENEWAL_TIME 58
#define DHCP_OPTION_REBINDING_TIME 59
#define DHCP_OPTION_END 255
#define DHCP_INFINITE_TIME 0xFFFFFFFF
#define DHCP_BROADCAST_FLAG 32768
#define DHCP_UNICAST_FLAG 0
#define DHCP_SERVER_PORT 67
#define DHCP_CLIENT_PORT 68
@ -195,7 +208,11 @@ typedef struct requested_server_struct{
#define ETHERNET_HARDWARE_ADDRESS 1 /* used in htype field of dhcp packet */
#define ETHERNET_HARDWARE_ADDRESS_LENGTH 6 /* length of Ethernet hardware addresses */
u_int8_t unicast = 0; /* unicast mode: mimic a DHCP relay */
struct in_addr my_ip; /* our address (required for relay) */
struct in_addr dhcp_ip; /* server to query (if in unicast mode) */
unsigned char client_hardware_address[MAX_DHCP_CHADDR_LENGTH]="";
unsigned char *user_specified_mac=NULL;
char network_interface_name[IFNAMSIZ]="eth0";
@ -226,7 +243,11 @@ int validate_arguments(void);
void print_usage(void);
void print_help(void);
void resolve_host(const char *in,struct in_addr *out);
unsigned char *mac_aton(const char *);
void print_hardware_address(const unsigned char *);
int get_hardware_address(int,char *);
int get_ip_address(int,char *);
int send_dhcp_discover(int);
int get_dhcp_offer(int);
@ -248,10 +269,13 @@ int main(int argc, char **argv){
int dhcp_socket;
int result = STATE_UNKNOWN;
/* this plugin almost certainly needs root permissions. */
np_warn_if_not_root();
setlocale (LC_ALL, "");
bindtextdomain (PACKAGE, LOCALEDIR);
textdomain (PACKAGE);
if(process_arguments(argc,argv)!=OK){
usage4 (_("Could not parse arguments"));
}
@ -260,7 +284,13 @@ int main(int argc, char **argv){
dhcp_socket=create_dhcp_socket();
/* get hardware address of client machine */
get_hardware_address(dhcp_socket,network_interface_name);
if(user_specified_mac!=NULL)
memcpy(client_hardware_address,user_specified_mac,6);
else
get_hardware_address(dhcp_socket,network_interface_name);
if(unicast) /* get IP address of client machine */
get_ip_address(dhcp_socket,network_interface_name);
/* send DHCPDISCOVER packet */
send_dhcp_discover(dhcp_socket);
@ -286,12 +316,11 @@ int main(int argc, char **argv){
/* determines hardware address on client machine */
int get_hardware_address(int sock,char *interface_name){
int i;
#if defined(__linux__)
struct ifreq ifr;
strncpy((char *)&ifr.ifr_name,interface_name,sizeof(ifr.ifr_name));
strncpy((char *)&ifr.ifr_name,interface_name,sizeof(ifr.ifr_name)-1);
ifr.ifr_name[sizeof(ifr.ifr_name)-1]='\0';
/* try and grab hardware address of requested interface */
if(ioctl(sock,SIOCGIFHWADDR,&ifr)<0){
@ -381,25 +410,48 @@ int get_hardware_address(int sock,char *interface_name){
/* Kompf 2000-2003 */
#else
printf(_("Error: can't get MAC address for this architecture.\n"));
printf(_("Error: can't get MAC address for this architecture. Use the --mac option.\n"));
exit(STATE_UNKNOWN);
#endif
if(verbose){
printf(_("Hardware address: "));
for (i=0; i<6; ++i)
printf("%2.2x", client_hardware_address[i]);
printf( "\n");
}
if(verbose)
print_hardware_address(client_hardware_address);
return OK;
}
/* determines IP address of the client interface */
int get_ip_address(int sock,char *interface_name){
#if defined(SIOCGIFADDR)
struct ifreq ifr;
strncpy((char *)&ifr.ifr_name,interface_name,sizeof(ifr.ifr_name)-1);
ifr.ifr_name[sizeof(ifr.ifr_name)-1]='\0';
if(ioctl(sock,SIOCGIFADDR,&ifr)<0){
printf(_("Error: Cannot determine IP address of interface %s\n"),
interface_name);
exit(STATE_UNKNOWN);
}
my_ip=((struct sockaddr_in *)&ifr.ifr_addr)->sin_addr;
#else
printf(_("Error: Cannot get interface IP address on this platform.\n"));
exit(STATE_UNKNOWN);
#endif
if(verbose)
printf(_("Pretending to be relay client %s\n"),inet_ntoa(my_ip));
return OK;
}
/* sends a DHCPDISCOVER broadcast message in an attempt to find DHCP servers */
int send_dhcp_discover(int sock){
dhcp_packet discover_packet;
struct sockaddr_in sockaddr_broadcast;
unsigned short opts;
/* clear the packet data structure */
@ -415,9 +467,10 @@ int send_dhcp_discover(int sock){
/* length of our hardware address */
discover_packet.hlen=ETHERNET_HARDWARE_ADDRESS_LENGTH;
discover_packet.hops=0;
/* transaction id is supposed to be random */
/*
* transaction ID is supposed to be random. We won't use the address so
* we don't care about high entropy here. time(2) is good enough.
*/
srand(time(NULL));
packet_xid=random();
discover_packet.xid=htonl(packet_xid);
@ -429,8 +482,11 @@ int send_dhcp_discover(int sock){
/*discover_packet.secs=htons(65535);*/
discover_packet.secs=0xFF;
/* tell server it should broadcast its response */
discover_packet.flags=htons(DHCP_BROADCAST_FLAG);
/*
* server needs to know if it should broadcast or unicast its response:
* 0x8000L == 32768 == 1 << 15 == broadcast, 0 == unicast
*/
discover_packet.flags = unicast ? 0 : htons(DHCP_BROADCAST_FLAG);
/* our hardware address */
memcpy(discover_packet.chaddr,client_hardware_address,ETHERNET_HARDWARE_ADDRESS_LENGTH);
@ -441,28 +497,38 @@ int send_dhcp_discover(int sock){
discover_packet.options[2]='\x53';
discover_packet.options[3]='\x63';
opts = 4;
/* DHCP message type is embedded in options field */
discover_packet.options[4]=DHCP_OPTION_MESSAGE_TYPE; /* DHCP message type option identifier */
discover_packet.options[5]='\x01'; /* DHCP message option length in bytes */
discover_packet.options[6]=DHCPDISCOVER;
discover_packet.options[opts++]=DHCP_OPTION_MESSAGE_TYPE; /* DHCP message type option identifier */
discover_packet.options[opts++]='\x01'; /* DHCP message option length in bytes */
discover_packet.options[opts++]=DHCPDISCOVER;
/* the IP address we're requesting */
if(request_specific_address==TRUE){
discover_packet.options[7]=DHCP_OPTION_REQUESTED_ADDRESS;
discover_packet.options[8]='\x04';
memcpy(&discover_packet.options[9],&requested_address,sizeof(requested_address));
discover_packet.options[opts++]=DHCP_OPTION_REQUESTED_ADDRESS;
discover_packet.options[opts++]='\x04';
memcpy(&discover_packet.options[opts],&requested_address,sizeof(requested_address));
opts += sizeof(requested_address);
}
discover_packet.options[opts++]=DHCP_OPTION_END;
/* unicast fields */
if(unicast)
discover_packet.giaddr.s_addr = my_ip.s_addr;
/* see RFC 1542, 4.1.1 */
discover_packet.hops = unicast ? 1 : 0;
/* send the DHCPDISCOVER packet to broadcast address */
sockaddr_broadcast.sin_family=AF_INET;
sockaddr_broadcast.sin_port=htons(DHCP_SERVER_PORT);
sockaddr_broadcast.sin_addr.s_addr=INADDR_BROADCAST;
sockaddr_broadcast.sin_addr.s_addr = unicast ? dhcp_ip.s_addr : INADDR_BROADCAST;
bzero(&sockaddr_broadcast.sin_zero,sizeof(sockaddr_broadcast.sin_zero));
if(verbose){
printf(_("DHCPDISCOVER to %s port %d\n"),inet_ntoa(sockaddr_broadcast.sin_addr),ntohs(sockaddr_broadcast.sin_port));
printf("DHCPDISCOVER XID: %lu (0x%X)\n",ntohl(discover_packet.xid),ntohl(discover_packet.xid));
printf("DHCPDISCOVER XID: %u (0x%X)\n",ntohl(discover_packet.xid),ntohl(discover_packet.xid));
printf("DHCDISCOVER ciaddr: %s\n",inet_ntoa(discover_packet.ciaddr));
printf("DHCDISCOVER yiaddr: %s\n",inet_ntoa(discover_packet.yiaddr));
printf("DHCDISCOVER siaddr: %s\n",inet_ntoa(discover_packet.siaddr));
@ -487,7 +553,6 @@ int get_dhcp_offer(int sock){
struct sockaddr_in source;
struct sockaddr_in via;
int result=OK;
int timeout=1;
int responses=0;
int x;
time_t start_time;
@ -537,13 +602,13 @@ int get_dhcp_offer(int sock){
if(verbose){
printf(_("DHCPOFFER from IP address %s"),inet_ntoa(source.sin_addr));
printf(_(" via %s\n"),inet_ntoa(via.sin_addr));
printf("DHCPOFFER XID: %lu (0x%X)\n",ntohl(offer_packet.xid),ntohl(offer_packet.xid));
printf("DHCPOFFER XID: %u (0x%X)\n",ntohl(offer_packet.xid),ntohl(offer_packet.xid));
}
/* check packet xid to see if its the same as the one we used in the discover packet */
if(ntohl(offer_packet.xid)!=packet_xid){
if(verbose)
printf(_("DHCPOFFER XID (%lu) did not match DHCPDISCOVER XID (%lu) - ignoring packet\n"),ntohl(offer_packet.xid),packet_xid);
printf(_("DHCPOFFER XID (%u) did not match DHCPDISCOVER XID (%u) - ignoring packet\n"),ntohl(offer_packet.xid),packet_xid);
continue;
}
@ -594,7 +659,6 @@ int get_dhcp_offer(int sock){
/* sends a DHCP packet */
int send_dhcp_packet(void *buffer, int buffer_size, int sock, struct sockaddr_in *dest){
struct sockaddr_in myname;
int result;
result=sendto(sock,(char *)buffer,buffer_size,0,(struct sockaddr *)dest,sizeof(*dest));
@ -614,22 +678,26 @@ int send_dhcp_packet(void *buffer, int buffer_size, int sock, struct sockaddr_in
int receive_dhcp_packet(void *buffer, int buffer_size, int sock, int timeout, struct sockaddr_in *address){
struct timeval tv;
fd_set readfds;
fd_set oobfds;
int recv_result;
socklen_t address_size;
struct sockaddr_in source_address;
int nfound;
/* wait for data to arrive (up time timeout) */
tv.tv_sec=timeout;
tv.tv_usec=0;
FD_ZERO(&readfds);
FD_ZERO(&oobfds);
FD_SET(sock,&readfds);
select(sock+1,&readfds,NULL,NULL,&tv);
FD_SET(sock,&oobfds);
nfound = select(sock+1,&readfds,NULL,&oobfds,&tv);
/* make sure some data has arrived */
if(!FD_ISSET(sock,&readfds)){
if(verbose)
printf(_("No (more) data received\n"));
printf(_("No (more) data received (nfound: %d)\n"), nfound);
return ERROR;
}
@ -678,8 +746,9 @@ int create_dhcp_socket(void){
/* Set up the address we're going to bind to. */
bzero(&myname,sizeof(myname));
myname.sin_family=AF_INET;
myname.sin_port=htons(DHCP_CLIENT_PORT);
myname.sin_addr.s_addr=INADDR_ANY; /* listen on any address */
/* listen to DHCP server port if we're in unicast mode */
myname.sin_port = htons(unicast ? DHCP_SERVER_PORT : DHCP_CLIENT_PORT);
myname.sin_addr.s_addr = unicast ? my_ip.s_addr : INADDR_ANY;
bzero(&myname.sin_zero,sizeof(myname.sin_zero));
/* create a socket for DHCP communications */
@ -707,14 +776,16 @@ int create_dhcp_socket(void){
/* bind socket to interface */
#if defined(__linux__)
strncpy(interface.ifr_ifrn.ifrn_name,network_interface_name,IFNAMSIZ);
strncpy(interface.ifr_ifrn.ifrn_name,network_interface_name,IFNAMSIZ-1);
interface.ifr_ifrn.ifrn_name[IFNAMSIZ-1]='\0';
if(setsockopt(sock,SOL_SOCKET,SO_BINDTODEVICE,(char *)&interface,sizeof(interface))<0){
printf(_("Error: Could not bind socket to interface %s. Check your privileges...\n"),network_interface_name);
exit(STATE_UNKNOWN);
}
#else
strncpy(interface.ifr_name,network_interface_name,IFNAMSIZ);
strncpy(interface.ifr_name,network_interface_name,IFNAMSIZ-1);
interface.ifr_name[IFNAMSIZ-1]='\0';
#endif
/* bind the socket */
@ -765,9 +836,9 @@ int add_requested_server(struct in_addr server_address){
int add_dhcp_offer(struct in_addr source,dhcp_packet *offer_packet){
dhcp_offer *new_offer;
int x;
int y;
unsigned option_type;
unsigned option_length;
struct in_addr serv_ident = {0};
if(offer_packet==NULL)
return ERROR;
@ -789,23 +860,28 @@ int add_dhcp_offer(struct in_addr source,dhcp_packet *offer_packet){
printf("Option: %d (0x%02X)\n",option_type,option_length);
/* get option data */
if(option_type==DHCP_OPTION_LEASE_TIME){
switch(option_type){
case DHCP_OPTION_LEASE_TIME:
memcpy(&dhcp_lease_time, &offer_packet->options[x],sizeof(dhcp_lease_time));
dhcp_lease_time = ntohl(dhcp_lease_time);
}
if(option_type==DHCP_OPTION_RENEWAL_TIME){
break;
case DHCP_OPTION_RENEWAL_TIME:
memcpy(&dhcp_renewal_time, &offer_packet->options[x],sizeof(dhcp_renewal_time));
dhcp_renewal_time = ntohl(dhcp_renewal_time);
}
if(option_type==DHCP_OPTION_REBINDING_TIME){
break;
case DHCP_OPTION_REBINDING_TIME:
memcpy(&dhcp_rebinding_time, &offer_packet->options[x],sizeof(dhcp_rebinding_time));
dhcp_rebinding_time = ntohl(dhcp_rebinding_time);
break;
case DHCP_OPTION_SERVER_IDENTIFIER:
memcpy(&serv_ident.s_addr, &offer_packet->options[x],sizeof(serv_ident.s_addr));
break;
}
/* skip option data we're ignoring */
else
for(y=0;y<option_length;y++,x++);
}
if(option_type!=DHCP_OPTION_REBINDING_TIME)
x+=option_length;
}
if(verbose){
if(dhcp_lease_time==DHCP_INFINITE_TIME)
@ -826,7 +902,19 @@ int add_dhcp_offer(struct in_addr source,dhcp_packet *offer_packet){
if(new_offer==NULL)
return ERROR;
new_offer->server_address=source;
/*
* RFC 2131 (2.) says: "DHCP clarifies the interpretation of the
* 'siaddr' field as the address of the server to use in the next step
* of the client's bootstrap process. A DHCP server may return its own
* address in the 'siaddr' field, if the server is prepared to supply
* the next bootstrap service (e.g., delivery of an operating system
* executable image). A DHCP server always returns its own address in
* the 'server identifier' option." 'serv_ident' is the 'server
* identifier' option, 'source' is the 'siaddr' field or (if 'siaddr'
* wasn't available) the IP address we received the DHCPOFFER from. If
* 'serv_ident' isn't available for some reason, we use 'source'.
*/
new_offer->server_address=serv_ident.s_addr?serv_ident:source;
new_offer->offered_address=offer_packet->yiaddr;
new_offer->lease_time=dhcp_lease_time;
new_offer->renewal_time=dhcp_renewal_time;
@ -1002,7 +1090,6 @@ int process_arguments(int argc, char **argv){
int call_getopt(int argc, char **argv){
int c=0;
int i=0;
struct in_addr ipaddress;
int option_index = 0;
static struct option long_options[] =
@ -1011,6 +1098,8 @@ int call_getopt(int argc, char **argv){
{"requestedip", required_argument,0,'r'},
{"timeout", required_argument,0,'t'},
{"interface", required_argument,0,'i'},
{"mac", required_argument,0,'m'},
{"unicast", no_argument, 0,'u'},
{"verbose", no_argument, 0,'v'},
{"version", no_argument, 0,'V'},
{"help", no_argument, 0,'h'},
@ -1018,7 +1107,7 @@ int call_getopt(int argc, char **argv){
};
while(1){
c=getopt_long(argc,argv,"+hVvt:s:r:t:i:",long_options,&option_index);
c=getopt_long(argc,argv,"+hVvt:s:r:t:i:m:u",long_options,&option_index);
i++;
@ -1039,23 +1128,13 @@ int call_getopt(int argc, char **argv){
switch(c){
case 's': /* DHCP server address */
if(inet_aton(optarg,&ipaddress))
add_requested_server(ipaddress);
/*
else
usage("Invalid server IP address\n");
*/
resolve_host(optarg,&dhcp_ip);
add_requested_server(dhcp_ip);
break;
case 'r': /* address we are requested from DHCP servers */
if(inet_aton(optarg,&ipaddress)){
requested_address=ipaddress;
request_specific_address=TRUE;
}
/*
else
usage("Invalid requested IP address\n");
*/
resolve_host(optarg,&requested_address);
request_specific_address=TRUE;
break;
case 't': /* timeout */
@ -1071,6 +1150,15 @@ int call_getopt(int argc, char **argv){
*/
break;
case 'm': /* MAC address */
if((user_specified_mac=mac_aton(optarg)) == NULL)
usage("Cannot parse MAC address.\n");
if(verbose)
print_hardware_address(user_specified_mac);
break;
case 'i': /* interface name */
strncpy(network_interface_name,optarg,sizeof(network_interface_name)-1);
@ -1078,6 +1166,10 @@ int call_getopt(int argc, char **argv){
break;
case 'u': /* unicast testing */
unicast=1;
break;
case 'V': /* version */
print_revision(progname,revision);
exit(STATE_OK);
@ -1246,6 +1338,53 @@ long mac_addr_dlpi( const char *dev, int unit, u_char *addr){
#endif
/* resolve host name or die (TODO: move this to netutils.c!) */
void resolve_host(const char *in,struct in_addr *out){
struct addrinfo hints, *ai;
memset(&hints,0,sizeof(hints));
hints.ai_family=PF_INET;
if (getaddrinfo(in,NULL,&hints,&ai) != 0)
usage_va(_("Invalid hostname/address - %s"),optarg);
memcpy(out,&((struct sockaddr_in *)ai->ai_addr)->sin_addr,sizeof(*out));
freeaddrinfo(ai);
}
/* parse MAC address string, return 6 bytes (unterminated) or NULL */
unsigned char *mac_aton(const char *string){
static unsigned char result[6];
char tmp[3];
unsigned i, j;
for(i=0, j=0; string[i] != '\0' && j < sizeof(result); i++){
/* ignore ':' and any other non-hex character */
if(!isxdigit(string[i]) || !isxdigit(string[i+1]))
continue;
tmp[0]=string[i];
tmp[1]=string[i+1];
tmp[2]='\0';
result[j]=strtol(tmp,(char **)NULL,16);
i++;
j++;
}
return (j==6) ? result : NULL;
}
void print_hardware_address(const unsigned char *address){
int i;
printf(_("Hardware address: "));
for (i=0; i<5; i++)
printf("%2.2x:", address[i]);
printf("%2.2x", address[i]);
putchar('\n');
}
/* print usage help */
void print_help(void){
@ -1272,6 +1411,10 @@ void print_help(void){
printf (" %s\n", _("Seconds to wait for DHCPOFFER before timeout occurs"));
printf (" %s\n", "-i, --interface=STRING");
printf (" %s\n", _("Interface to to use for listening (i.e. eth0)"));
printf (" %s\n", "-m, --mac=STRING");
printf (" %s\n", _("MAC address to use in the DHCP request"));
printf (" %s\n", "-u, --unicast");
printf (" %s\n", _("Unicast testing: mimic a DHCP relay, requires -s"));
return;
}
@ -1281,7 +1424,8 @@ void
print_usage(void){
printf (_("Usage:"));
printf ("%s [-s serverip] [-r requestedip] [-t timeout] [-i interface] [-v]\n",progname);
printf (" %s [-v] [-u] [-s serverip] [-r requestedip] [-t timeout]\n",progname);
printf (" [-i interface] [-m mac]\n");
return;
}

View file

@ -7,7 +7,7 @@
*
* Original Author : Andreas Ericsson <ae@op5.se>
*
* Last Modified: $Date: 2007/03/27 06:53:57 $
* Last Modified: $Date: 2007-09-15 12:55:12 +0100 (Sat, 15 Sep 2007) $
*
* Description:
*
@ -38,14 +38,14 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*
* $Id: check_icmp.c,v 1.12 2007/03/27 06:53:57 dermoth Exp $
* $Id: check_icmp.c 1779 2007-09-15 11:55:12Z hweiss $
*
*****************************************************************************/
/* progname may change */
/* char *progname = "check_icmp"; */
char *progname;
const char *revision = "$Revision: 1.12 $";
const char *revision = "$Revision: 1779 $";
const char *copyright = "2005-2007";
const char *email = "nagiosplug-devel@lists.sourceforge.net";
@ -294,7 +294,7 @@ get_icmp_error_msg(unsigned char icmp_type, unsigned char icmp_code)
static int
handle_random_icmp(struct icmp *p, struct sockaddr_in *addr)
{
struct icmp *sent_icmp = NULL;
struct icmp sent_icmp;
struct rta_host *host = NULL;
unsigned char *ptr;
@ -324,16 +324,16 @@ handle_random_icmp(struct icmp *p, struct sockaddr_in *addr)
/* might be for us. At least it holds the original package (according
* to RFC 792). If it isn't, just ignore it */
sent_icmp = (struct icmp *)(ptr + 28);
if(sent_icmp->icmp_type != ICMP_ECHO || sent_icmp->icmp_id != pid ||
sent_icmp->icmp_seq >= targets)
memcpy(&sent_icmp, ptr + 28, sizeof(sent_icmp));
if(sent_icmp.icmp_type != ICMP_ECHO || sent_icmp.icmp_id != pid ||
sent_icmp.icmp_seq >= targets)
{
if(debug) printf("Packet is no response to a packet we sent\n");
return 0;
}
/* it is indeed a response for us */
host = table[sent_icmp->icmp_seq];
host = table[sent_icmp.icmp_seq];
if(debug) {
printf("Received \"%s\" from %s for ICMP ECHO sent to %s.\n",
get_icmp_error_msg(p->icmp_type, p->icmp_code),
@ -372,6 +372,9 @@ main(int argc, char **argv)
int result;
struct rta_host *host;
/* print a helpful error message if geteuid != 0 */
np_warn_if_not_root();
/* we only need to be setsuid when we get the sockets, so do
* that before pointer magic (esp. on network data) */
icmp_sockerrno = udp_sockerrno = tcp_sockerrno = sockets = 0;
@ -674,9 +677,9 @@ wait_for_reply(int sock, u_int t)
static char buf[4096];
struct sockaddr_in resp_addr;
struct ip *ip;
struct icmp *icp, *sent_icmp;
struct icmp icp;
struct rta_host *host;
struct icmp_ping_data *data;
struct icmp_ping_data data;
struct timeval wait_start, now;
u_int tdiff, i, per_pkt_wait;
@ -738,32 +741,25 @@ wait_for_reply(int sock, u_int t)
/* } */
/* check the response */
icp = (struct icmp *)(buf + hlen);
sent_icmp = (struct icmp *)(buf + hlen + ICMP_MINLEN);
/* printf("buf: %p, icp: %p, distance: %u (expected %u)\n", */
/* buf, icp, */
/* (u_int)icp - (u_int)buf, hlen); */
/* printf("buf: %p, sent_icmp: %p, distance: %u (expected %u)\n", */
/* buf, sent_icmp, */
/* (u_int)sent_icmp - (u_int)buf, hlen + ICMP_MINLEN); */
memcpy(&icp, buf + hlen, sizeof(icp));
if(icp->icmp_id != pid) {
handle_random_icmp(icp, &resp_addr);
if(icp.icmp_id != pid) {
handle_random_icmp(&icp, &resp_addr);
continue;
}
if(icp->icmp_type != ICMP_ECHOREPLY || icp->icmp_seq >= targets) {
if(icp.icmp_type != ICMP_ECHOREPLY || icp.icmp_seq >= targets) {
if(debug > 2) printf("not a proper ICMP_ECHOREPLY\n");
handle_random_icmp(icp, &resp_addr);
handle_random_icmp(&icp, &resp_addr);
continue;
}
/* this is indeed a valid response */
data = (struct icmp_ping_data *)(icp->icmp_data);
memcpy(&data, icp.icmp_data, sizeof(data));
host = table[icp->icmp_seq];
host = table[icp.icmp_seq];
gettimeofday(&now, &tz);
tdiff = get_timevaldiff(&data->stime, &now);
tdiff = get_timevaldiff(&data.stime, &now);
host->time_waited += tdiff;
host->icmp_recv++;
@ -793,14 +789,16 @@ wait_for_reply(int sock, u_int t)
static int
send_icmp_ping(int sock, struct rta_host *host)
{
static char *buf = NULL; /* re-use so we prevent leaks */
static union {
char *buf; /* re-use so we prevent leaks */
struct icmp *icp;
u_short *cksum_in;
} packet = { NULL };
long int len;
struct icmp *icp;
struct icmp_ping_data *data;
struct icmp_ping_data data;
struct timeval tv;
struct sockaddr *addr;
if(sock == -1) {
errno = 0;
crash("Attempt to send on bogus socket");
@ -808,30 +806,28 @@ send_icmp_ping(int sock, struct rta_host *host)
}
addr = (struct sockaddr *)&host->saddr_in;
if(!buf) {
buf = (char *)malloc(icmp_pkt_size + sizeof(struct ip));
if(!buf) {
if(!packet.buf) {
if (!(packet.buf = malloc(icmp_pkt_size))) {
crash("send_icmp_ping(): failed to malloc %d bytes for send buffer",
icmp_pkt_size);
return -1; /* might be reached if we're in debug mode */
}
}
memset(buf, 0, icmp_pkt_size + sizeof(struct ip));
memset(packet.buf, 0, icmp_pkt_size);
if((gettimeofday(&tv, &tz)) == -1) return -1;
icp = (struct icmp *)buf;
icp->icmp_type = ICMP_ECHO;
icp->icmp_code = 0;
icp->icmp_cksum = 0;
icp->icmp_id = pid;
icp->icmp_seq = host->id;
data = (struct icmp_ping_data *)icp->icmp_data;
data->ping_id = 10; /* host->icmp.icmp_sent; */
memcpy(&data->stime, &tv, sizeof(struct timeval));
icp->icmp_cksum = icmp_checksum((u_short *)icp, icmp_pkt_size);
data.ping_id = 10; /* host->icmp.icmp_sent; */
memcpy(&data.stime, &tv, sizeof(tv));
memcpy(&packet.icp->icmp_data, &data, sizeof(data));
packet.icp->icmp_type = ICMP_ECHO;
packet.icp->icmp_code = 0;
packet.icp->icmp_cksum = 0;
packet.icp->icmp_id = pid;
packet.icp->icmp_seq = host->id;
packet.icp->icmp_cksum = icmp_checksum(packet.cksum_in, icmp_pkt_size);
len = sendto(sock, buf, icmp_pkt_size, 0, (struct sockaddr *)addr,
len = sendto(sock, packet.buf, icmp_pkt_size, 0, (struct sockaddr *)addr,
sizeof(struct sockaddr));
if(len < 0 || (unsigned int)len != icmp_pkt_size) {

View file

@ -1,252 +1,252 @@
/* pst3.c
*
* Third version to get process arg info; this time by using
* a combination of reading the /proc/<pid>/psinfo structures
* and reading the complete arg vector from kernel memory structures.
*
* Developed and tested under Solaris 5.8 (both 32 and 64 bit modes).
*
* NOTE: This program must be setuid-root (or run by root) to work!
*
* Written: 2005-04-28 R.W.Ingraham
*/
#define _KMEMUSER 1
#include <kvm.h>
#include <sys/param.h>
#include <sys/user.h>
#include <sys/time.h>
#include <sys/proc.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
#include <procfs.h>
#include <fcntl.h>
#include <dirent.h>
#include <errno.h>
/*
* Constants
*/
#define PROC_DIR "/proc"
#define MAX_PATH 1024
/*
* Structures
*/
/*
* Globals
*/
static char * szProg;
static kvm_t * kd;
static struct proc * pProc;
static struct user * pUser;
static char ** myArgv;
/*
* Prototypes
*/
static int HandleFile (struct dirent *pDent);
static int HandlePsInfo (char *szPath, psinfo_t *pPsInfo);
static int GetArgVectors (pid_t pid);
static void ShowArgVectors (void);
static void ReleaseArgVectors();
/*----------------------------------------------------------------------------*/
int main (int argc, char **argv)
{
DIR *pDir;
struct dirent *pDent;
int retcode = 0;
/* Set our program name global */
if ((szProg = strrchr(argv[0], '/')) != NULL)
szProg++;
else
szProg = argv[0];
/* Make sure that our euid is root */
if (geteuid() != 0)
{
fprintf(stderr, "%s: This program can only be run by the root user!\n", szProg);
exit(1);
}
/* Get a handle to the running kernel image */
if ((kd = kvm_open(NULL, NULL, NULL, O_RDONLY, argv[0])) == NULL)
{
fprintf(stderr, "%s: Failed to open kernel memory: %s\n", szProg, strerror(errno));
exit(2);
}
/* Open the /proc directory */
if ((pDir = opendir(PROC_DIR)) != NULL)
{
/* Display column headings */
printf("S UID PPID VSZ RSS %%CPU COMMAND ARGS\n");
/* Zip through all of the process entries */
while ((pDent = readdir(pDir)) != NULL)
{
/* Handle each pid sub-directory */
HandleFile(pDent);
}
/* Close the directory */
closedir(pDir);
}
else /* ERROR: Failure to open PROC_DIR */
{
fprintf(stderr, "%s: Failed to open \"%s\": %s\n", szProg, PROC_DIR, strerror(errno));
retcode = 3;
}
/* Close the handle to the running kernel image */
kvm_close(kd);
return retcode;
}
/*----------------------------------------------------------------------------*/
static int HandleFile (struct dirent *pDent)
{
char szPath[MAX_PATH];
psinfo_t sPsInfo;
int fd, len;
int rc = 0;
/* Skip files beginning with a "." */
if (pDent->d_name[0] == '.')
return 0;
/* Cosntruct the path to the psinfo file */
len = sprintf(szPath, "%s/%s/psinfo", PROC_DIR, pDent->d_name);
/* Open the psinfo file for this pid and print out its arg vectors */
if ((fd = open(szPath, O_RDONLY)) >= 0)
{
/* Read the psinfo struct */
if ((len = read(fd, &sPsInfo, sizeof(sPsInfo))) != sizeof(sPsInfo))
{
rc = errno;
fprintf(stderr, "%s: Read error of psinfo structure (%d)\n", szPath, len);
return rc;
}
/* Close the psinfo file */
close(fd);
/* Pass psinfo struct to reporting function */
HandlePsInfo(szPath, &sPsInfo);
}
else if (errno != ENOENT)
{
rc = errno;
fprintf(stderr, "%s: %s\n", szPath, strerror(errno));
}
return 0;
}
/*----------------------------------------------------------------------------*/
static int HandlePsInfo (char *szPath, psinfo_t *pPsInfo)
{
int retcode;
char *thisProg;
/* Make sure that the process is still there */
if ((retcode = GetArgVectors(pPsInfo->pr_pid)) == 0)
{
/* We use the program name from the kvm argv[0] instead
* of pr_fname from the psinfo struct because pr_fname
* may be truncated.
*
* Also, strip-off leading path information.
*/
if ((thisProg = strrchr(myArgv[0], '/')) != NULL)
thisProg++;
else
thisProg = myArgv[0];
/* Display the ps columns (except for argv) */
printf("%c %5d %5d %6lu %6lu %4.1f %s ",
pPsInfo->pr_lwp.pr_sname,
(int)(pPsInfo->pr_euid),
(int)(pPsInfo->pr_ppid),
(unsigned long)(pPsInfo->pr_size),
(unsigned long)(pPsInfo->pr_rssize),
((float)(pPsInfo->pr_pctcpu) / 0x8000 * 100.0),
thisProg);
/* Display the arg vectors associated with this pid */
ShowArgVectors();
/* Release the arg vector buffer memory */
ReleaseArgVectors();
}
return retcode;
}
/*----------------------------------------------------------------------------*/
static int GetArgVectors (pid_t pid)
{
int retcode = 1;
/* Get the proc structure for the specified PID */
if ((pProc = kvm_getproc(kd, pid)) != NULL)
{
/* Save a copy of the process' u-area */
if ((pUser = kvm_getu(kd, pProc)) != NULL)
{
/* Reconstruct the process' argv vector array */
if (kvm_getcmd(kd, pProc, pUser, &myArgv, NULL) == 0)
{
retcode = 0;
}
}
}
return retcode;
}
/*----------------------------------------------------------------------------*/
static void ShowArgVectors (void)
{
int i;
for (i=0; myArgv[i]; i++)
{
printf(" %s", myArgv[i]);
}
printf("\n");
}
/*----------------------------------------------------------------------------*/
static void ReleaseArgVectors()
{
/* NOOP */
}
/*----------------------------------------------------------------------------*/
/* pst3.c
*
* Third version to get process arg info; this time by using
* a combination of reading the /proc/<pid>/psinfo structures
* and reading the complete arg vector from kernel memory structures.
*
* Developed and tested under Solaris 5.8 (both 32 and 64 bit modes).
*
* NOTE: This program must be setuid-root (or run by root) to work!
*
* Written: 2005-04-28 R.W.Ingraham
*/
#define _KMEMUSER 1
#include <kvm.h>
#include <sys/param.h>
#include <sys/user.h>
#include <sys/time.h>
#include <sys/proc.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
#include <procfs.h>
#include <fcntl.h>
#include <dirent.h>
#include <errno.h>
/*
* Constants
*/
#define PROC_DIR "/proc"
#define MAX_PATH 1024
/*
* Structures
*/
/*
* Globals
*/
static char * szProg;
static kvm_t * kd;
static struct proc * pProc;
static struct user * pUser;
static char ** myArgv;
/*
* Prototypes
*/
static int HandleFile (struct dirent *pDent);
static int HandlePsInfo (char *szPath, psinfo_t *pPsInfo);
static int GetArgVectors (pid_t pid);
static void ShowArgVectors (void);
static void ReleaseArgVectors();
/*----------------------------------------------------------------------------*/
int main (int argc, char **argv)
{
DIR *pDir;
struct dirent *pDent;
int retcode = 0;
/* Set our program name global */
if ((szProg = strrchr(argv[0], '/')) != NULL)
szProg++;
else
szProg = argv[0];
/* Make sure that our euid is root */
if (geteuid() != 0)
{
fprintf(stderr, "%s: This program can only be run by the root user!\n", szProg);
exit(1);
}
/* Get a handle to the running kernel image */
if ((kd = kvm_open(NULL, NULL, NULL, O_RDONLY, argv[0])) == NULL)
{
fprintf(stderr, "%s: Failed to open kernel memory: %s\n", szProg, strerror(errno));
exit(2);
}
/* Open the /proc directory */
if ((pDir = opendir(PROC_DIR)) != NULL)
{
/* Display column headings */
printf("S UID PPID VSZ RSS %%CPU COMMAND ARGS\n");
/* Zip through all of the process entries */
while ((pDent = readdir(pDir)) != NULL)
{
/* Handle each pid sub-directory */
HandleFile(pDent);
}
/* Close the directory */
closedir(pDir);
}
else /* ERROR: Failure to open PROC_DIR */
{
fprintf(stderr, "%s: Failed to open \"%s\": %s\n", szProg, PROC_DIR, strerror(errno));
retcode = 3;
}
/* Close the handle to the running kernel image */
kvm_close(kd);
return retcode;
}
/*----------------------------------------------------------------------------*/
static int HandleFile (struct dirent *pDent)
{
char szPath[MAX_PATH];
psinfo_t sPsInfo;
int fd, len;
int rc = 0;
/* Skip files beginning with a "." */
if (pDent->d_name[0] == '.')
return 0;
/* Cosntruct the path to the psinfo file */
len = sprintf(szPath, "%s/%s/psinfo", PROC_DIR, pDent->d_name);
/* Open the psinfo file for this pid and print out its arg vectors */
if ((fd = open(szPath, O_RDONLY)) >= 0)
{
/* Read the psinfo struct */
if ((len = read(fd, &sPsInfo, sizeof(sPsInfo))) != sizeof(sPsInfo))
{
rc = errno;
fprintf(stderr, "%s: Read error of psinfo structure (%d)\n", szPath, len);
return rc;
}
/* Close the psinfo file */
close(fd);
/* Pass psinfo struct to reporting function */
HandlePsInfo(szPath, &sPsInfo);
}
else if (errno != ENOENT)
{
rc = errno;
fprintf(stderr, "%s: %s\n", szPath, strerror(errno));
}
return 0;
}
/*----------------------------------------------------------------------------*/
static int HandlePsInfo (char *szPath, psinfo_t *pPsInfo)
{
int retcode;
char *thisProg;
/* Make sure that the process is still there */
if ((retcode = GetArgVectors(pPsInfo->pr_pid)) == 0)
{
/* We use the program name from the kvm argv[0] instead
* of pr_fname from the psinfo struct because pr_fname
* may be truncated.
*
* Also, strip-off leading path information.
*/
if ((thisProg = strrchr(myArgv[0], '/')) != NULL)
thisProg++;
else
thisProg = myArgv[0];
/* Display the ps columns (except for argv) */
printf("%c %5d %5d %6lu %6lu %4.1f %s ",
pPsInfo->pr_lwp.pr_sname,
(int)(pPsInfo->pr_euid),
(int)(pPsInfo->pr_ppid),
(unsigned long)(pPsInfo->pr_size),
(unsigned long)(pPsInfo->pr_rssize),
((float)(pPsInfo->pr_pctcpu) / 0x8000 * 100.0),
thisProg);
/* Display the arg vectors associated with this pid */
ShowArgVectors();
/* Release the arg vector buffer memory */
ReleaseArgVectors();
}
return retcode;
}
/*----------------------------------------------------------------------------*/
static int GetArgVectors (pid_t pid)
{
int retcode = 1;
/* Get the proc structure for the specified PID */
if ((pProc = kvm_getproc(kd, pid)) != NULL)
{
/* Save a copy of the process' u-area */
if ((pUser = kvm_getu(kd, pProc)) != NULL)
{
/* Reconstruct the process' argv vector array */
if (kvm_getcmd(kd, pProc, pUser, &myArgv, NULL) == 0)
{
retcode = 0;
}
}
}
return retcode;
}
/*----------------------------------------------------------------------------*/
static void ShowArgVectors (void)
{
int i;
for (i=0; myArgv[i]; i++)
{
printf(" %s", myArgv[i]);
}
printf("\n");
}
/*----------------------------------------------------------------------------*/
static void ReleaseArgVectors()
{
/* NOOP */
}
/*----------------------------------------------------------------------------*/

View file

@ -1,4 +1,4 @@
# Makefile.in generated by automake 1.9.6 from Makefile.am.
# Makefile.in generated by automake 1.9.5 from Makefile.am.
# @configure_input@
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
@ -95,7 +95,7 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/np_mysqlclient.m4 \
$(top_srcdir)/configure.in
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(install_sh) -d
mkinstalldirs = $(SHELL) $(top_srcdir)/build-aux/mkinstalldirs
CONFIG_HEADER = $(top_builddir)/config.h
CONFIG_CLEAN_FILES = subst utils.pm utils.sh
am__installdirs = "$(DESTDIR)$(libexecdir)"
@ -239,6 +239,7 @@ PATH_TO_SWAPINFO = @PATH_TO_SWAPINFO@
PATH_TO_UPTIME = @PATH_TO_UPTIME@
PATH_TO_WHO = @PATH_TO_WHO@
PERL = @PERL@
PERLMODS_DIR = @PERLMODS_DIR@
PGINCLUDE = @PGINCLUDE@
PGLIBS = @PGLIBS@
PKG_ARCH = @PKG_ARCH@

View file

@ -26,7 +26,7 @@ GetOptions
"C=s" => \$opt_C, "community=s" => \$opt_C);
if ($opt_V) {
print_revision($PROGNAME,'$Revision: 1.5 $');
print_revision($PROGNAME,'$Revision: 820 $');
exit $ERRORS{'OK'};
}
@ -65,7 +65,7 @@ sub print_usage () {
}
sub print_help () {
print_revision($PROGNAME,'$Revision: 1.5 $');
print_revision($PROGNAME,'$Revision: 820 $');
print "Copyright (c) 2000 Jeffrey Blank/Karl DeBisschop
This plugin reports the signal strength of a Breezecom wireless equipment

Some files were not shown because too many files have changed in this diff Show more