[svn-inject] Applying Debian modifications to trunk

This commit is contained in:
Jan Wagner 2007-02-09 13:59:02 +00:00
commit dc54b0930e
19 changed files with 572 additions and 0 deletions

263
debian/README.Debian vendored Normal file
View file

@ -0,0 +1,263 @@
nagios-snmp-plugins for Debian
------------------------------
If you are using snmp v1 and v2c, you can provide your community as last
argument with your check_command. So you can specify different communities
for different services. With snmp v3 you need to set $USER9$ like shown in
the config snipsets in your resource.cfg or you need to modify your
command definitions!
See http://www.manubulon.com/nagios/index_commands.html#snmplogin
and http://www.manubulon.com/nagios/index_info.html#snmplogin
-- Jan Wagner <waja@cyconet.org> Fri, 26 Jan 2007 16:32:47 +0100
These snipsets are dumped from nagios-snmp-plugins website.
Look at <http://www.manubulon.com/nagios/index_commands.html> and
<http://www.manubulon.com/nagios/index_info.html> for more (actual) info!
Here are commands example to use the scripts with nagios.
All these commands use $USER<n>$ macros to put snmp login. You
have to do this for these examples to work.
The $USER<n>$ macro are defined in the resources.cfg file
If you are using snmp v1 :
$USER7$=-C <community>
If you are using snmp v2c :
$USER7$=-C <community> -2
Examples of snmp v3 login :
AuthNoPriv (md5) :
$USER8$=-l <login> -x <pass>
AuthPriv (md5,aes) :
$USER8$=-l <login> -x <pass> -X <pass> -L md5,aes
About regular expressions
With all these scripts, when you select an interface, a service or process name
etc... you use by default regular expresions :
Note : you can disable this by using "-r"
Examples : Don't forget it is perl regular expressions.
Regexp Will match
eth eth0, eth1, eth2 but also Fastethernet0/0 ....
eth[1-9] eth1, eth2, ... eth9 but also eth10, eth11
eth[1-2]$ eth1, eth2 only (not eth11 for ex).
dhcp dhcpc, dhpcd
* check_snmp_cpfw.pl
define command {
command_name check_snmp_cpfw_v3
command_line $USER1$/check_snmp_cpfw.pl -H $HOSTADDRESS$ $USER8$
$ARG1$
}
define service {
name checkpoint_verification
check_command check_snmp_cpfw_v3!-swa -p Solsoft_Policy \
-c 100000,200000 -f
}
* check_snmp_load.pl
define command {
command_name check_snmp_load_v1
command_line $USER1$/check_snmp_load.pl -H $HOSTADDRESS$ $USER7$ -T
$ARG1$ -w $ARG2$ -c $ARG3$ $ARG4$
}
define command {
command_name check_snmp_load_v3
command_line $USER1$/check_snmp_load.pl -H $HOSTADDRESS$ $USER8$ -T
$ARG1$ -w $ARG2$ -c $ARG3$ $ARG4$
}
define service {
name bluecoat_load
check_command check_snmp_load_v1!bc!95!99
}
define service {
name Linux_load
check_command check_snmp_load_v1!netsl!4,3,3!8,5,5
}
define service {
name Cisco_load
check_command check_snmp_load_v1!cisco!90,80,60!100,100,100
}
define service {
name lp_load
check_command check_snmp_load_v1!lp!90!99
}
* check_snmp_interface.pl
define command {
command_name check_snmp_int_v1
command_line $USER1$/check_snmp_int.pl -H $HOSTADDRESS$ $USER7$ -n
$ARG1$ $ARG2$
}
define command{
command_name check_snmp_int_v3
command_line $USER1$/check_snmp_int.pl -H $HOSTADDRESS$ $USER8$ -n
$ARG1$ $ARG2$
}
define service {
name check_int_1_6
check_command check_snmp_int_v1!"FastEthernet-[1-6]"
}
define service {
name check_int_eth0_bdw
check_command check_snmp_int_v3!eth0!-k -w 100,50 -c 0,0
}
* check_snmp_mem.pl
define command {
command_name check_snmp_mem_v1
command_line $USER1$/check_snmp_mem.pl -H $HOSTADDRESS$ $USER7$ $ARG1$
-w $ARG2$ -c $ARG3$ $ARG4$
}
define command {
command_name check_snmp_mem_v3
command_line $USER1$/check_snmp_mem.pl -H $HOSTADDRESS$ $USER8$ $ARG1$
-w $ARG2$ -c $ARG3$ $ARG4$
}
define service {
name Linux_memory
check_command check_snmp_mem_v1!-N!95,60!99,90
}
define service {
name Cisco_mem
check_command check_snmp_mem_v1!-I!80!99
}
* check_snmp_process.pl
define command {
command_name check_snmp_process_v1
command_line $USER1$/check_snmp_process.pl -H $HOSTADDRESS$ $USER7$ -n
$ARG1$ -w $ARG2$ -c $ARG3$ $ARG4$
}
define service {
name proxy_checks
check_command check_snmp_process_v1!proxy!21,1999!20,2000!-2
}
define service {
name Check_httpd_all
check_command check_snmp_process_v1!httpd!5,100!0!-2 -m 20,30 -u 90,99
}
define service {
name check_crontab
service_description Check Crontab service
check_command check_snmp_process!crond!0!0
}
* check_snmp_storage.pl
define command {
command_name check_snmp_storage_v1
command_line $USER1$/check_snmp_storage.pl -H $HOSTADDRESS$ $USER7$ -m
$ARG1$ -w $ARG2$ -c $ARG3$ $ARG4$
}
define command {
command_name check_snmp_storage_v3
command_line $USER1$/check_snmp_storage.pl -H $HOSTADDRESS$ $USER8$ -m
$ARG1$ -w $ARG2$ -c $ARG3$ $ARG4$
}
define service {
name Check_LinDisk_home
service_description Check /home
check_command check_snmp_storage_v3!/home!90!97!-r
}
define service {
name Win_check_swap
service_description Check Windows swap
check_command check_snmp_storage_v3!Virtual!60!90
}
define service {
name check_linux_swap
service_description Check swap linux
check_command check_snmp_storage_v1!Swap!60!90!
}
define service {
name check_disk_all
service_description Check / /opt /var /config
check_command check_snmp_storage_v1!"^/$|opt|config|var"!80!90!
}
* check_snmp_vrrp.pl
define command {
command_name check_snmp_vrrp_v1
command_line $USER1$/check_snmp_vrrp.pl -H $HOSTADDRESS$ $USER7$ -T
$ARG1$ -s $ARG2$
}
define command {
command_name check_snmp_vrrp_v3
command_line $USER1$/check_snmp_vrrp.pl -H $HOSTADDRESS$ $USER8$ -T
$ARG1$ -s $ARG2$
}
define service {
name Linkproof_check_vrrp_master
service_description Check vrrp in master state
check_command check_snmp_vrrp_v3!lp!master
}
define service {
name Linkproof_check_vrrp_backup
service_description Check vrrp in backup state
check_command check_snmp_vrrp_v3!lp!backup
}
define service {
name Nokia_clustering
check_command check_snmp_vrrp_v3!ipso!2,98%
}
* check_snmp_win.pl
define command {
command_name check_win
command_line $USER1$/check_snmp_win.pl -H $HOSTADDRESS$ $USER7$ -n
$ARG2$
# comment community service(s) name
}
define service {
name check_win_dhcp
service_description Check dhcp service
check_command check_win!dhcp
register 0
}
define service {
name check_win_reg_spool
service_description Verification acces au registre en spooleur
check_command check_win!"au registre",spouleur
register 0
}
-- Jan Wagner <waja@cyconet.org> Tue, 5 Dec 2006 11:52:19 +0100

5
debian/changelog vendored Normal file
View file

@ -0,0 +1,5 @@
nagios-snmp-plugins (1.1-1~unreleased.2) unstable; urgency=low
* Initial release (Closes: #401678).
-- Jan Wagner <waja@cyconet.org> Mon, 15 Jan 2007 20:34:19 +0100

1
debian/compat vendored Normal file
View file

@ -0,0 +1 @@
5

15
debian/control vendored Normal file
View file

@ -0,0 +1,15 @@
Source: nagios-snmp-plugins
Section: net
Priority: optional
Maintainer: Jan Wagner <waja@cyconet.org>
Build-Depends: debhelper (>= 5)
Standards-Version: 3.7.2
Package: nagios-snmp-plugins
Architecture: all
Depends: ${perl:Depends}, libnet-snmp-perl, perl-base (>= 5.8.4-8), ucf
Suggests: nagios-plugins-basic (>= 1.4.5-2)
Description: SNMP Plugins for nagios
A set of Nagios plugins to check hosts/devices using snmp protocol
.
Homepage: <http://www.manubulon.com/nagios/index_snmp.html>

30
debian/copyright vendored Normal file
View file

@ -0,0 +1,30 @@
This package was debianized by Jan Wagner <waja@cyconet.org> on
Tue, 5 Dec 2006 11:52:19 +0100.
It was downloaded from <http://www.manubulon.com/nagios>
Upstream Author: Patrick Proy (nagios at proy.org)
Copyright: (C) 2004-2007 Patrick Proy (nagios at proy.org)
License:
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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
On Debian systems, the complete text of the GNU General Public License
can be found in /usr/share/common-licenses/GPL file.
The Debian packaging is (C) 2006, 2007 Jan Wagner <waja@cyconet.org> and
is licensed under the GPL, see `/usr/share/common-licenses/GPL'.

1
debian/docs vendored Normal file
View file

@ -0,0 +1 @@
README

8
debian/pluginconfig/snmp_cpfw.cfg vendored Normal file
View file

@ -0,0 +1,8 @@
# check point firewall template, for more info see:
# http://www.manubulon.com/nagios/index_commands.html#cpfw
# 'check_snmp_cpfw_v3' command definition
define command {
command_name check_snmp_cpfw_v3
command_line $USER1$/check_snmp_cpfw.pl -H $HOSTADDRESS$ $USER9$ $ARG1$
}

20
debian/pluginconfig/snmp_env.cfg vendored Normal file
View file

@ -0,0 +1,20 @@
# system environment check template, for more see:
# http://www.manubulon.com/nagios/index_commands.html#env
# 'check_snmp_env_v1' command definition
define command {
command_name check_snmp_env_v1
command_line $USER1$/check_snmp_env.pl -H $HOSTADDRESS$ -C $ARG3$ -T $ARG1$ $ARG2$
}
# 'check_snmp_env_v2' command definition
define command {
command_name check_snmp_env_v2
command_line $USER1$/check_snmp_env.pl -H $HOSTADDRESS$ -C $ARG3$ -2 -T $ARG1$ $ARG2$
}
# 'check_snmp_env_v3' command definition
define command {
command_name check_snmp_env_v3
command_line $USER1$/check_snmp_env.pl -H $HOSTADDRESS$ $USER9$ -T $ARG1$ $ARG2$
}

20
debian/pluginconfig/snmp_int.cfg vendored Normal file
View file

@ -0,0 +1,20 @@
# (network-) interface check template, for more see:
# http://www.manubulon.com/nagios/index_commands.html#interface
# 'check_snmp_int_v1' command definition
define command {
command_name check_snmp_int_v1
command_line $USER1$/check_snmp_int.pl -H $HOSTADDRESS$ -C $ARG3$ -n $ARG1$ $ARG2$
}
# 'check_snmp_int_v2' command definition
define command {
command_name check_snmp_int_v2
command_line $USER1$/check_snmp_int.pl -H $HOSTADDRESS$ -C $ARG3$ -2 -n $ARG1$ $ARG2$
}
# 'check_snmp_int_v3' command definition
define command{
command_name check_snmp_int_v3
command_line $USER1$/check_snmp_int.pl -H $HOSTADDRESS$ $USER9$ -n $ARG1$ $ARG2$
}

20
debian/pluginconfig/snmp_load.cfg vendored Normal file
View file

@ -0,0 +1,20 @@
# system load check template, for more see:
# http://www.manubulon.com/nagios/index_commands.html#load
# 'check_snmp_load_v1' command definition
define command {
command_name check_snmp_load_v1
command_line $USER1$/check_snmp_load.pl -H $HOSTADDRESS$ -C $ARG5$ -T $ARG1$ -w $ARG2$ -c $ARG3$ $ARG4$
}
# 'check_snmp_load_v2' command definition
define command {
command_name check_snmp_load_v2
command_line $USER1$/check_snmp_load.pl -H $HOSTADDRESS$ -C $ARG5$ -2 -T $ARG1$ -w $ARG2$ -c $ARG3$ $ARG4$
}
# 'check_snmp_load_v3' command definition
define command {
command_name check_snmp_load_v3
command_line $USER1$/check_snmp_load.pl -H $HOSTADDRESS$ $USER9$ -T $ARG1$ -w $ARG2$ -c $ARG3$ $ARG4$
}

20
debian/pluginconfig/snmp_mem.cfg vendored Normal file
View file

@ -0,0 +1,20 @@
# system memory check template, for more see:
# http://www.manubulon.com/nagios/index_commands.html#mem
# 'check_snmp_mem_v1' command definition
define command {
command_name check_snmp_mem_v1
command_line $USER1$/check_snmp_mem.pl -H $HOSTADDRESS$ -C $ARG5$ $ARG1$ -w $ARG2$ -c $ARG3$ $ARG4$
}
# 'check_snmp_mem_v2' command definition
define command {
command_name check_snmp_mem_v2
command_line $USER1$/check_snmp_mem.pl -H $HOSTADDRESS$ -C $ARG5$ -2 $ARG1$ -w $ARG2$ -c $ARG3$ $ARG4$
}
# 'check_snmp_mem_v3' command definition
define command {
command_name check_snmp_mem_v3
command_line $USER1$/check_snmp_mem.pl -H $HOSTADDRESS$ $USER9$ $ARG1$ -w $ARG2$ -c $ARG3$ $ARG4$
}

15
debian/pluginconfig/snmp_process.cfg vendored Normal file
View file

@ -0,0 +1,15 @@
# system process check template, for more see:
# http://www.manubulon.com/nagios/index_commands.html#process
# 'check_snmp_process_v1' command definition
define command {
command_name check_snmp_process_v1
command_line $USER1$/check_snmp_process.pl -H $HOSTADDRESS$ -C $ARG5$ -n $ARG1$ -w $ARG2$ -c $ARG3$ $ARG4$
}
# 'check_snmp_process_v2' command definition
define command {
command_name check_snmp_process_v2
command_line $USER1$/check_snmp_process.pl -H $HOSTADDRESS$ -C $ARG5$ -2 -n $ARG1$ -w $ARG2$ -c $ARG3$ $ARG4$
}

20
debian/pluginconfig/snmp_storage.cfg vendored Normal file
View file

@ -0,0 +1,20 @@
# system storage check template, for more see:
# http://www.manubulon.com/nagios/index_commands.html#storage
# 'check_snmp_storage_v1' command definition
define command {
command_name check_snmp_storage_v1
command_line $USER1$/check_snmp_storage.pl -H $HOSTADDRESS$ -C $ARG5$ -m $ARG1$ -w $ARG2$ -c $ARG3$ $ARG4$
}
# 'check_snmp_storage_v2' command definition
define command {
command_name check_snmp_storage_v2
command_line $USER1$/check_snmp_storage.pl -H $HOSTADDRESS$ -C $ARG5$ -2 -m $ARG1$ -w $ARG2$ -c $ARG3$ $ARG4$
}
# 'check_snmp_storage_v3' command definition
define command {
command_name check_snmp_storage_v3
command_line $USER1$/check_snmp_storage.pl -H $HOSTADDRESS$ $USER9$ -m $ARG1$ -w $ARG2$ -c $ARG3$ $ARG4$
}

20
debian/pluginconfig/snmp_vrrp.cfg vendored Normal file
View file

@ -0,0 +1,20 @@
# vrrp check template, for more see:
# http://www.manubulon.com/nagios/index_commands.html#vrrp
# 'check_snmp_vrrp_v1' command definition
define command {
command_name check_snmp_vrrp_v1
command_line $USER1$/check_snmp_vrrp.pl -H $HOSTADDRESS$ -C $ARG3$ -T $ARG1$ -s $ARG2$
}
# 'check_snmp_vrrp_v2' command definition
define command {
command_name check_snmp_vrrp_v2
command_line $USER1$/check_snmp_vrrp.pl -H $HOSTADDRESS$ -C $ARG3$ -2 -T $ARG1$ -s $ARG2$
}
# 'check_snmp_vrrp_v3' command definition
define command {
command_name check_snmp_vrrp_v3
command_line $USER1$/check_snmp_vrrp.pl -H $HOSTADDRESS$ $USER9$ -T $ARG1$ -s $ARG2$
}

8
debian/pluginconfig/snmp_win.cfg vendored Normal file
View file

@ -0,0 +1,8 @@
# windows check template, for more see:
# http://www.manubulon.com/nagios/index_commands.html#windows
# 'check_win' command definition
define command {
command_name check_win
command_line $USER1$/check_snmp_win.pl -H $HOSTADDRESS$ -C $ARG3$ -n $ARG2$
}

21
debian/postinst vendored Normal file
View file

@ -0,0 +1,21 @@
#!/bin/sh -e
templdir=/usr/share/nagios-snmp-plugins/pluginconfig
if [ "$1" = "configure" ]; then
if [ -f /usr/share/nagios-plugins/dpkg/functions ]; then
# only working with nagios-plugins-basic (>= 1.4.5-2)
. /usr/share/nagios-plugins/dpkg/functions
register_cfgs $2
else
# to get working with etch
(
cd $templdir
for f in *cfg; do
ucf $f /etc/nagios-plugins/config/$f
done
);
fi
fi
#DEBHELPER#

17
debian/postrm.in vendored Normal file
View file

@ -0,0 +1,17 @@
#!/bin/sh -e
PLUGINS="@PLUGINS@"
if [ "$1" = "purge" ]; then
if which ucf >/dev/null 2>&1; then
have_ucf="yes"
fi
for f in $PLUGINS; do
rm -f /etc/nagios-plugins/config/${f}.cfg
if [ "$have_ucf" = "yes" ]; then
ucf --purge /etc/nagios-plugins/config/${f}.cfg
fi
done
fi
#DEBHELPER#

66
debian/rules vendored Executable file
View file

@ -0,0 +1,66 @@
#!/usr/bin/make -f
# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1
COMMANDDEFPATH:=/etc/nagios-plugins/config/
NP_DIR:=debian/nagios-snmp-plugins
NP_TEMPLATES:=$(NP_DIR)/usr/share/nagios-snmp-plugins/pluginconfig
NP_LIBEXEC:=/usr/lib/nagios/plugins
plugin_cfgs:=snmp_cpfw snmp_env snmp_int snmp_load snmp_mem snmp_process \
snmp_storage snmp_vrrp snmp_win
build:
clean:
dh_testdir
dh_testroot
dh_clean
-rm -f debian/postrm
install: build
dh_testdir
dh_testroot
dh_clean -k
dh_installdirs
# Add here commands to install the package into debian/nagios-snmp-plugins.
for PLUGINS in *.pl; \
do \
install -D -m 0755 $$PLUGINS $(NP_DIR)$(NP_LIBEXEC)/$$PLUGINS || exit 1; \
sed -i "s#/usr/local/nagios/libexec#$(NP_LIBEXEC)#" $(NP_DIR)$(NP_LIBEXEC)/$$PLUGINS || exit 1; \
done
# copying templates them into seperate "template" directories outside of
# /usr/share/doc for ucf to use.
install -d $(NP_DIR)/usr/share/nagios-snmp-plugins/pluginconfig
for c in ${plugin_cfgs}; do \
cp debian/pluginconfig/$${c}.cfg ${NP_TEMPLATES}; \
done
# here the list of config templates are writen to postrm
sed -e 's/@PLUGINS@/${plugin_cfgs}/' \
< debian/postrm.in \
> debian/postrm
# Build architecture-independent files here.
binary-indep: build install
dh_testdir
dh_testroot
dh_installchangelogs
dh_installdocs
dh_link
dh_compress
dh_fixperms
dh_perl
dh_installdeb
dh_gencontrol
dh_md5sums
dh_builddeb
# Build architecture-dependent files here.
binary-arch: build install
# We have nothing to do for now.
binary: binary-indep binary-arch
.PHONY: build clean binary-indep binary-arch binary install

2
debian/watch vendored Normal file
View file

@ -0,0 +1,2 @@
version=3
http://www.manubulon.com/nagios/nagios-snmp-plugins\.(.*)\.tgz debian uupdate