Package: nagios-plugins Version: 1.4-3 Severity: wishlist Tags: patch I have added a configuration file for checking dhcp, but the plugin only runs as root. I also have made some changes to the plugin check_disk_smb and that implemented in the file disk.cfg. In the plugin check_disk_smb I have added the option "-a" for the address to check servers if they are on a different network. Further, it is legal to have spaces in windows-hostnames, so I implemented that too. I have added the command check_https_auth, because I have to authenticate to get the test-page. I have corrected some pathes, because in Debian those coommands are in /usr/bin in stead of /bin. In the plugin check_mailq I have disabled the emptying the PATH-variable to disable errormessages.
-- System Information: Debian Release: 3.0 Architecture: i386 (i586) Kernel: Linux 2.4.27 Locale: LANG=C, LC_CTYPE=C Versions of packages nagios-plugins depends on: ii bind9-host [host] 1:9.2.1-2.woody.2 Version of 'host' bundled with BIN ii dnsutils 1:9.2.1-2.woody.2 Clients provided with BIND ii fping 2.4b2-to-ipv6-4 Send ICMP ECHO_REQUEST packets to ii iputils-ping [ping] 3:20020124-3 The ping utility from iputils ii libc6 2.3.2.ds1-21 GNU C Library: Shared libraries an ii libldap2 2.1.23-1 OpenLDAP libraries ii libmysqlclient12 4.0.21-7 mysql database client library ii libnet-snmp-perl 3.6-7 Script SNMP connections ii libpq3 7.4.5-3 Shared library libpq.so.3 for Post ii libssl0.9.7 0.9.7d-5 SSL shared libraries ii ntp 1:4.1.0-8 Daemon and utilities for full NTP ii ntp-simple 1:4.1.0-8 NTP v4 daemon for simple systems. ii ntpdate 1:4.1.0-8 The ntpdate client for setting sys ii procps 1:2.0.7-8.woody1 The /proc file system utilities. ii qstat 2.4e-1 Command-line tool for querying qua ii radiusclient1 0.3.1-12.1 /bin/login replacement which uses ii smbclient 2.2.3a-15 A LanManager like simple client fo ii snmp 4.2.3-2 NET SNMP (Simple Network Managemen -- no debconf information --- Cut here --- diff -rcN /etc/nagios-plugins/config.orig/dhcp.cfg /etc/nagios-plugins/config/dhcp.cfg *** /etc/nagios-plugins/config.orig/dhcp.cfg Thu Jan 1 01:00:00 1970 --- /etc/nagios-plugins/config/dhcp.cfg Mon May 9 18:47:26 2005 *************** *** 0 **** --- 1,12 ---- + # 'check_dhcp' command definition + define command{ + command_name check_dhcp + command_line /usr/lib/nagios/plugins/check_dhcp -s $HOSTADDRESS$ + } + + # 'check_dhcp_interface' command definition + define command{ + command_name check_dhcp_interface + command_line /usr/lib/nagios/plugins/check_dhcp -s $HOSTADDRESS$ -i $ARG1$ + } + diff -rcN /etc/nagios-plugins/config.orig/disk.cfg /etc/nagios-plugins/config/disk.cfg *** /etc/nagios-plugins/config.orig/disk.cfg Mon Mar 7 05:33:30 2005 --- /etc/nagios-plugins/config/disk.cfg Mon May 9 22:55:20 2005 *************** *** 5,14 **** --- 5,77 ---- } + # 'check_all_disks' command definition + define command{ + command_name check_all_disks + command_line /usr/lib/nagios/plugins/check_disk -w $ARG1$ -c $ARG2$ + } + + # 'ssh_disk' command definition define command{ command_name ssh_disk command_line /usr/lib/nagios/plugins/check_by_ssh -H $HOSTADDRESS$ -C '/usr/lib/nagios/plugins/check_disk -w $ARG1$ -c $ARG2$ -p $ARG3$' + } + + + # 'check_disk_smb' command definition + define command{ + command_name check_disk_smb + command_line /usr/lib/nagios/plugins/check_disk_smb -H "$ARG1$" -s $ARG2$ + } + + + # 'check_disk_smb_workgroup' command definition + define command{ + command_name check_disk_smb_workgroup + command_line /usr/lib/nagios/plugins/check_disk_smb -H "$ARG1$" -s $ARG2$ -W $ARG3$ + } + + + # 'check_disk_smb_host' command definition + define command{ + command_name check_disk_smb_host + command_line /usr/lib/nagios/plugins/check_disk_smb -a $HOSTADDRESS$ -H "$ARG1$" -s $ARG2$ + } + + + # 'check_disk_smb_workgroup_host' command definition + define command{ + command_name check_disk_smb_workgroup_host + command_line /usr/lib/nagios/plugins/check_disk_smb -a $HOSTADDRESS$ -H "$ARG1$" -s $ARG2$ -W $ARG3$ + } + + + # 'check_disk_smb_user' command definition + define command{ + command_name check_disk_smb_user + command_line /usr/lib/nagios/plugins/check_disk_smb -H "$ARG1$" -s $ARG2$ -u $ARG3$ -p $ARG4$ + } + + + # 'check_disk_smb_workgroup_user' command definition + define command{ + command_name check_disk_smb_workgroup_user + command_line /usr/lib/nagios/plugins/check_disk_smb -H "$ARG1$" -s $ARG2$ -W $ARG3$ -u $ARG4$ -p $ARG5$ + } + + + # 'check_disk_smb_host_user' command definition + define command{ + command_name check_disk_smb_host_user + command_line /usr/lib/nagios/plugins/check_disk_smb -a $HOSTADDRESS$ -H "$ARG1$" -s $ARG2$ -u $ARG3$ -p $ARG4$ + } + + + # 'check_disk_smb_workgroup_host_user' command definition + define command{ + command_name check_disk_smb_workgroup_host_user + command_line /usr/lib/nagios/plugins/check_disk_smb -a $HOSTADDRESS$ -H "$ARG1$" -s $ARG2$ -W $ARG3$ -u $ARG4$ -p $ARG5$ } diff -rcN /etc/nagios-plugins/config.orig/http.cfg /etc/nagios-plugins/config/http.cfg *** /etc/nagios-plugins/config.orig/http.cfg Mon Mar 7 05:33:30 2005 --- /etc/nagios-plugins/config/http.cfg Sat May 7 06:51:01 2005 *************** *** 19,25 **** # 'check_https' command definition define command{ ! command_name check_https command_line /usr/lib/nagios/plugins/check_http --ssl -H $HOSTADDRESS$ -I $HOSTADDRESS$ } --- 19,31 ---- # 'check_https' command definition define command{ ! command_name check_https command_line /usr/lib/nagios/plugins/check_http --ssl -H $HOSTADDRESS$ -I $HOSTADDRESS$ + } + + # 'check_https_auth' command definition + define command{ + command_name check_https_auth + command_line /usr/lib/nagios/plugins/check_http --ssl -H $HOSTADDRESS$ -I $HOSTADDRESS$ -a $ARG1$ } diff -rcN /usr/lib/nagios/plugins.orig/check_disk_smb /usr/lib/nagios/plugins/check_disk_smb *** /usr/lib/nagios/plugins.orig/check_disk_smb Mon Mar 7 05:33:28 2005 --- /usr/lib/nagios/plugins/check_disk_smb Thu May 19 00:15:44 2005 *************** *** 23,29 **** use POSIX; use strict; use Getopt::Long; ! use vars qw($opt_P $opt_V $opt_h $opt_H $opt_s $opt_W $opt_u $opt_p $opt_w $opt_c $verbose); use vars qw($PROGNAME); use lib "/usr/lib/nagios/plugins" ; use utils qw($TIMEOUT %ERRORS &print_revision &support &usage); --- 23,29 ---- use POSIX; use strict; use Getopt::Long; ! use vars qw($opt_P $opt_V $opt_h $opt_H $opt_s $opt_W $opt_u $opt_p $opt_w $opt_c $opt_a $verbose); use vars qw($PROGNAME); use lib "/usr/lib/nagios/plugins" ; use utils qw($TIMEOUT %ERRORS &print_revision &support &usage); *************** *** 49,55 **** "u=s" => \$opt_u, "username=s" => \$opt_u, "s=s" => \$opt_s, "share=s" => \$opt_s, "W=s" => \$opt_W, "workgroup=s" => \$opt_W, ! "H=s" => \$opt_H, "hostname=s" => \$opt_H); if ($opt_V) { print_revision($PROGNAME,'$Revision: 1.10 $'); #' --- 49,56 ---- "u=s" => \$opt_u, "username=s" => \$opt_u, "s=s" => \$opt_s, "share=s" => \$opt_s, "W=s" => \$opt_W, "workgroup=s" => \$opt_W, ! "H=s" => \$opt_H, "hostname=s" => \$opt_H, ! "a=s" => \$opt_a, "address=s" => \$opt_a); if ($opt_V) { print_revision($PROGNAME,'$Revision: 1.10 $'); #' *************** *** 65,71 **** # Options checking ($opt_H) || ($opt_H = shift) || usage("Host name not specified\n"); ! my $host = $1 if ($opt_H =~ /^([-_.A-Za-z0-9]+\$?)$/); ($host) || usage("Invalid host: $opt_H\n"); ($opt_s) || ($opt_s = shift) || usage("Share volume not specified\n"); --- 66,72 ---- # Options checking ($opt_H) || ($opt_H = shift) || usage("Host name not specified\n"); ! my $host = $1 if ($opt_H =~ /^([-_.A-Za-z0-9 ]+\$?)$/); ($host) || usage("Invalid host: $opt_H\n"); ($opt_s) || ($opt_s = shift) || usage("Share volume not specified\n"); *************** *** 105,110 **** --- 106,113 ---- my $workgroup = $1 if (defined($opt_W) && $opt_W =~ /(.*)/); + my $address = $1 if (defined($opt_a) && $opt_a =~ /(.*)/); + # end of options checking *************** *** 123,132 **** # Execute an "ls" on the share using smbclient program # get the results into $res if (defined($workgroup)) { ! $res = qx/$smbclient \/\/$host\/$share $pass -W $workgroup -U $user $smbclientoptions -c ls/; } else { ! print "$smbclient " . "\/\/$host\/$share" ." $pass -U $user $smbclientoptions -c ls\n" if ($verbose); ! $res = qx/$smbclient \/\/$host\/$share $pass -U $user $smbclientoptions -c ls/; } #Turn off alarm alarm(0); --- 126,146 ---- # Execute an "ls" on the share using smbclient program # get the results into $res if (defined($workgroup)) { ! if (defined($address)) { ! print "$smbclient " . "\/\/$host\/$share" ." $pass -W $workgroup -U $user $smbclientoptions -I $address -c ls\n" if ($verbose); ! $res = qx/$smbclient "\/\/$host\/$share" $pass -W $workgroup -U $user $smbclientoptions -I $address -c ls/; ! } else { ! print "$smbclient " . "\/\/$host\/$share" ." $pass -W $workgroup -U $user $smbclientoptions -c ls\n" if ($verbose); ! $res = qx/$smbclient "\/\/$host\/$share" $pass -W $workgroup -U $user $smbclientoptions -c ls/; ! } } else { ! if (defined($address)) { ! print "$smbclient " . "\/\/$host\/$share" ." $pass -U $user $smbclientoptions -I $address -c ls\n" if ($verbose); ! $res = qx/$smbclient "\/\/$host\/$share" $pass -U $user $smbclientoptions -I $address -c ls/; ! } else { ! print "$smbclient " . "\/\/$host\/$share" ." $pass -U $user $smbclientoptions -c ls\n" if ($verbose); ! $res = qx/$smbclient "\/\/$host\/$share" $pass -U $user $smbclientoptions -c ls/; ! } } #Turn off alarm alarm(0); *************** *** 231,237 **** sub print_usage () { print "Usage: $PROGNAME -H <host> -s <share> -u <user> -p <password> ! -w <warn> -c <crit> [-W <workgroup>] [-P <port>]\n"; } sub print_help () { --- 245,251 ---- sub print_usage () { print "Usage: $PROGNAME -H <host> -s <share> -u <user> -p <password> ! -w <warn> -c <crit> [-W <workgroup>] [-P <port>] [-a <IP>]\n"; } sub print_help () { *************** *** 249,254 **** --- 263,270 ---- Share name to be tested -W, --workgroup=STRING Workgroup or Domain used (Defaults to \"WORKGROUP\") + -a, --address=IP + IP-address of HOST (only necessary if HOST is in another network) -u, --user=STRING Username to log in to server. (Defaults to \"guest\") -p, --password=STRING diff -rcN /usr/lib/nagios/plugins.orig/check_log /usr/lib/nagios/plugins/check_log *** /usr/lib/nagios/plugins.orig/check_log Mon Mar 7 05:33:28 2005 --- /usr/lib/nagios/plugins/check_log Tue May 10 00:10:23 2005 *************** *** 62,73 **** ECHO="/bin/echo" GREP="/bin/grep" ! DIFF="/bin/diff" ! TAIL="/bin/tail" CAT="/bin/cat" RM="/bin/rm" ! PROGNAME=`/bin/basename $0` PROGPATH=`echo $0 | /bin/sed -e 's,[\\/][^\\/][^\\/]*$,,'` REVISION=`echo '$Revision: 1.4 $' | /bin/sed -e 's/[^0-9.]//g'` --- 62,73 ---- ECHO="/bin/echo" GREP="/bin/grep" ! DIFF="/usr/bin/diff" ! TAIL="/usr/bin/tail" CAT="/bin/cat" RM="/bin/rm" ! PROGNAME=`/usr/bin/basename $0` PROGPATH=`echo $0 | /bin/sed -e 's,[\\/][^\\/][^\\/]*$,,'` REVISION=`echo '$Revision: 1.4 $' | /bin/sed -e 's/[^0-9.]//g'` diff -rcN /usr/lib/nagios/plugins.orig/check_mailq /usr/lib/nagios/plugins/check_mailq *** /usr/lib/nagios/plugins.orig/check_mailq Mon Mar 7 05:33:29 2005 --- /usr/lib/nagios/plugins/check_mailq Wed May 18 23:52:33 2005 *************** *** 40,46 **** sub print_usage (); sub process_arguments (); ! $ENV{'PATH'}=''; $ENV{'BASH_ENV'}=''; $ENV{'ENV'}=''; $PROGNAME = "check_mailq"; --- 40,46 ---- sub print_usage (); sub process_arguments (); ! #$ENV{'PATH'}=''; $ENV{'BASH_ENV'}=''; $ENV{'ENV'}=''; $PROGNAME = "check_mailq"; -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]