diverse nagios plugins
This commit is contained in:
18
net-analyzer/nagios-core/files/2.x-series-nsca.patch
Normal file
18
net-analyzer/nagios-core/files/2.x-series-nsca.patch
Normal file
@@ -0,0 +1,18 @@
|
||||
--- contrib/eventhandlers/distributed-monitoring/submit_check_result_via_nsca.orig 2005-01-28 12:57:11.537852344 +0930
|
||||
+++ contrib/eventhandlers/distributed-monitoring/submit_check_result_via_nsca 2005-01-28 12:57:45.877631904 +0930
|
||||
@@ -28,9 +28,12 @@
|
||||
|
||||
printfcmd="/bin/printf"
|
||||
|
||||
-NscaBin="/usr/local/nagios/libexec/send_nsca"
|
||||
-NscaCfg="/usr/local/nagios/etc/send_nsca.cfg"
|
||||
-NagiosHost="nagioshost"
|
||||
+NscaBin="/usr/nagios/libexec/send_nsca"
|
||||
+NscaCfg="/etc/nagios/send_nsca.cfg"
|
||||
+
|
||||
+# Gentoo Linux Users: configure the hostname in /etc/conf.d/nagios
|
||||
+source /etc/conf.d/nagios
|
||||
+NagiosHost="${NAGIOS_NSCA_HOST}"
|
||||
|
||||
# Fire the data off to the NSCA daemon using the send_nsca script
|
||||
$printfcmd "%s\t%s\t%s\t%s\n" "$1" "$2" "$3" "$4" | $NscaBin $NagiosHost -c $NscaCfg
|
15
net-analyzer/nagios-core/files/99_nagios.conf
Normal file
15
net-analyzer/nagios-core/files/99_nagios.conf
Normal file
@@ -0,0 +1,15 @@
|
||||
<IfDefine NAGIOS>
|
||||
ScriptAlias /nagios/cgi-bin/ /usr/nagios/sbin/
|
||||
<Directory "/usr/nagios/sbin/">
|
||||
AllowOverride AuthConfig
|
||||
Options ExecCGI
|
||||
Order allow,deny
|
||||
Allow from all
|
||||
</Directory>
|
||||
Alias /nagios /usr/nagios/share/
|
||||
<Directory "/usr/nagios/share">
|
||||
AllowOverride AuthConfig
|
||||
Order allow,deny
|
||||
Allow from all
|
||||
</Directory>
|
||||
</IfDefine>
|
10
net-analyzer/nagios-core/files/conf.d
Normal file
10
net-analyzer/nagios-core/files/conf.d
Normal file
@@ -0,0 +1,10 @@
|
||||
# Copyright 1999-2004 Gentoo Foundation
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
# $Header: /var/cvsroot/gentoo-x86/net-analyzer/nagios-core/files/conf.d,v 1.1 2004/08/20 13:38:13 eldad Exp $
|
||||
|
||||
# Distributed monitoring users will want to configure here the ip/hostname of the central server.
|
||||
# It will be used by submit_check_result_via_nsca.
|
||||
NAGIOS_NSCA_HOST="localhost"
|
||||
|
||||
|
||||
|
3
net-analyzer/nagios-core/files/digest-nagios-core-2.7
Normal file
3
net-analyzer/nagios-core/files/digest-nagios-core-2.7
Normal file
@@ -0,0 +1,3 @@
|
||||
MD5 d664d2785cdca3c5c8a3e84c033e8e6e nagios-2.7.tar.gz 1737308
|
||||
RMD160 6412149c37cd82d731b807f3e43fd5afbe528f14 nagios-2.7.tar.gz 1737308
|
||||
SHA256 defb4062f077f999d1da2bcfcb87786c5d7fbca7d1346c7e6a19084b5629b2c1 nagios-2.7.tar.gz 1737308
|
56
net-analyzer/nagios-core/files/nagios
Normal file
56
net-analyzer/nagios-core/files/nagios
Normal file
@@ -0,0 +1,56 @@
|
||||
#!/sbin/runscript
|
||||
# Copyright 1999-2004 Gentoo Foundation
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
# $Header: /var/cvsroot/gentoo-x86/net-analyzer/nagios-core/files/nagios,v 1.9 2007/02/03 07:04:42 mjolnir Exp $
|
||||
|
||||
opts="${opts} reload checkconfig"
|
||||
|
||||
depend() {
|
||||
need net
|
||||
use dns logger firewall
|
||||
after mysql postgresql
|
||||
}
|
||||
|
||||
reload()
|
||||
{
|
||||
checkconfig || return 1
|
||||
ebegin "Reloading configuration"
|
||||
killall -HUP nagios &>/dev/null
|
||||
eend $?
|
||||
}
|
||||
|
||||
checkconfig() {
|
||||
# Silent Check
|
||||
/usr/nagios/bin/nagios -v /etc/nagios/nagios.cfg &>/dev/null && return 0
|
||||
|
||||
# Now we know there's problem - run again and display errors
|
||||
/usr/nagios/bin/nagios -v /etc/nagios/nagios.cfg
|
||||
eend $? "Configuration Error. Please fix your configfile"
|
||||
}
|
||||
|
||||
start() {
|
||||
checkconfig || return 1
|
||||
ebegin "Starting nagios"
|
||||
touch /var/nagios/nagios.log /var/nagios/status.sav
|
||||
chown nagios:nagios /var/nagios/nagios.log /var/nagios/status.sav
|
||||
rm -f /var/nagios/rw/nagios.cmd
|
||||
start-stop-daemon --quiet --start --startas /usr/nagios/bin/nagios \
|
||||
--pidfile /var/nagios/nagios.lock -- -d /etc/nagios/nagios.cfg
|
||||
eend $?
|
||||
}
|
||||
|
||||
stop() {
|
||||
ebegin "Stopping nagios"
|
||||
start-stop-daemon --quiet --stop --pidfile /var/nagios/nagios.lock
|
||||
rm -f /var/nagios/status.log /var/nagios/nagios.tmp /var/nagios/nagios.lock /var/nagios/rw/nagios.cmd
|
||||
eend $?
|
||||
}
|
||||
|
||||
svc_restart() {
|
||||
checkconfig || return 1
|
||||
ebegin "Restarting nagios"
|
||||
svc_stop
|
||||
svc_start
|
||||
eend $?
|
||||
}
|
||||
|
110
net-analyzer/nagios-core/files/nagios-1.x-Makefile-asneeded.diff
Normal file
110
net-analyzer/nagios-core/files/nagios-1.x-Makefile-asneeded.diff
Normal file
@@ -0,0 +1,110 @@
|
||||
--- nagios-1.3/base/Makefile.in.orig 2006-04-30 00:22:59.000000000 +0300
|
||||
+++ nagios-1.3/base/Makefile.in 2006-04-30 00:23:01.000000000 +0300
|
||||
@@ -12,7 +12,8 @@
|
||||
CC=@CC@
|
||||
CFLAGS=@CFLAGS@ @DEFS@ -DNSCORE
|
||||
#CFLAGS=-O3 -Wall -Wshadow -Wpointer-arith -Wcast-qual -Wcast-align -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs -DHAVE_CONFIG_H -DNSCORE
|
||||
-LDFLAGS=@LDFLAGS@ @LIBS@
|
||||
+LDFLAGS=@LDFLAGS@
|
||||
+LDADD=@LIBS@
|
||||
|
||||
prefix=@prefix@
|
||||
exec_prefix=@exec_prefix@
|
||||
@@ -88,7 +89,7 @@
|
||||
OBJS=checks.o config.o commands.o flapping.o logging.o notifications.o sehandlers.o utils.o $(RDATALIBS) $(CDATALIBS) $(ODATALIBS) $(SDATALIBS) $(PDATALIBS) $(DDATALIBS) $(BASEEXTRALIBS) $(SNPRINTF_O)
|
||||
|
||||
nagios: nagios.c $(OBJS) nagios.h $(SRC_COMMON)/locations.h
|
||||
- $(CC) $(CFLAGS) $(LDFLAGS) nagios.c $(OBJS) $(PERLLIBS) $(MATHLIBS) -o $@
|
||||
+ $(CC) $(CFLAGS) $(LDFLAGS) nagios.c $(OBJS) $(PERLLIBS) $(MATHLIBS) $(LDADD) -o $@
|
||||
|
||||
#$(SRC_COMMON)/locations.h: $(SRC_COMMON)/locations.sub
|
||||
# perl -pe 's|\$${prefix}|${prefix}|g;s|\$${exec_prefix}|${exec_prefix}|g;s|\$${htmurl}|$(HTMURL)|g;s|\$${cgiurl}|$(CGIURL)|g;' $(SRC_COMMON)/locations.sub > $(SRC_COMMON)/locations.h
|
||||
--- nagios-1.3/cgi/Makefile.in.orig 2006-04-30 00:37:36.000000000 +0300
|
||||
+++ nagios-1.3/cgi/Makefile.in 2006-04-30 00:38:56.000000000 +0300
|
||||
@@ -27,7 +27,8 @@
|
||||
CC=@CC@
|
||||
CFLAGS=@CFLAGS@ @DEFS@ -DNSCGI
|
||||
#CFLAGS=-O3 -Wall -Wshadow -Wpointer-arith -Wcast-qual -Wcast-align -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs -DHAVE_CONFIG_H -DNSCGI
|
||||
-LDFLAGS=@LDFLAGS@ @LIBS@
|
||||
+LDFLAGS=@LDFLAGS@
|
||||
+LDADD=@LIBS@
|
||||
|
||||
CGIS=avail.cgi cmd.cgi config.cgi extinfo.cgi history.cgi notifications.cgi outages.cgi showlog.cgi status.cgi statuswml.cgi summary.cgi tac.cgi $(CGIEXTRAS)
|
||||
|
||||
@@ -95,58 +96,58 @@
|
||||
$(COMMENTLIBS): $(COMMENTHDRS)
|
||||
|
||||
avail.cgi: avail.c $(CGIDEPS)
|
||||
- $(CC) $(CFLAGS) $(LDFLAGS) avail.c $(CGILIBS) -o $@
|
||||
+ $(CC) $(CFLAGS) $(LDFLAGS) avail.c $(CGILIBS) $(LDADD) -o $@
|
||||
|
||||
checksanity.cgi: checksanity.c $(CGIDEPS) $(CDATADEPS) $(EDATADEPS) $(DDATADEPS)
|
||||
- $(CC) $(CFLAGS) $(LDFLAGS) checksanity.c $(CGILIBS) $(CDATALIBS) $(EDATALIBS) $(DDATALIBS) -o $@
|
||||
+ $(CC) $(CFLAGS) $(LDFLAGS) checksanity.c $(CGILIBS) $(CDATALIBS) $(EDATALIBS) $(DDATALIBS) $(LDADD) -o $@
|
||||
|
||||
cmd.cgi: cmd.c $(CGIDEPS) $(CDATADEPS)
|
||||
- $(CC) $(CFLAGS) $(LDFLAGS) cmd.c $(CGILIBS) $(CDATALIBS) $(DDATALIBS) -o $@
|
||||
+ $(CC) $(CFLAGS) $(LDFLAGS) cmd.c $(CGILIBS) $(CDATALIBS) $(DDATALIBS) $(LDADD) -o $@
|
||||
|
||||
config.cgi: config.c $(CGIDEPS)
|
||||
- $(CC) $(CFLAGS) $(LDFLAGS) config.c $(CGILIBS) -o $@
|
||||
+ $(CC) $(CFLAGS) $(LDFLAGS) config.c $(CGILIBS) $(LDADD) -o $@
|
||||
|
||||
extinfo.cgi: extinfo.c $(CGIDEPS) $(CDATADEPS) $(EDATADEPS) $(DDATADEPS)
|
||||
- $(CC) $(CFLAGS) $(LDFLAGS) extinfo.c $(CGILIBS) $(CDATALIBS) $(EDATALIBS) $(DDATALIBS) -o $@
|
||||
+ $(CC) $(CFLAGS) $(LDFLAGS) extinfo.c $(CGILIBS) $(CDATALIBS) $(EDATALIBS) $(DDATALIBS) $(LDADD) -o $@
|
||||
|
||||
history.cgi: history.c $(CGIDEPS) $(LIFODEPS)
|
||||
- $(CC) $(CFLAGS) $(LDFLAGS) history.c $(CGILIBS) $(LIFOLIBS) -o $@
|
||||
+ $(CC) $(CFLAGS) $(LDFLAGS) history.c $(CGILIBS) $(LIFOLIBS) $(LDADD) -o $@
|
||||
|
||||
ministatus.cgi: ministatus.c $(CGIDEPS)
|
||||
- $(CC) $(CFLAGS) $(LDFLAGS) ministatus.c $(CGILIBS) -o $@
|
||||
+ $(CC) $(CFLAGS) $(LDFLAGS) ministatus.c $(CGILIBS) $(LDADD) -o $@
|
||||
|
||||
notifications.cgi: notifications.c $(CGIDEPS) $(LIFODEPS)
|
||||
- $(CC) $(CFLAGS) $(LDFLAGS) notifications.c $(CGILIBS) $(LIFOLIBS) -o $@
|
||||
+ $(CC) $(CFLAGS) $(LDFLAGS) notifications.c $(CGILIBS) $(LIFOLIBS) $(LDADD) -o $@
|
||||
|
||||
outages.cgi: outages.c $(CGIDEPS) $(CDATADEPS)
|
||||
- $(CC) $(CFLAGS) $(LDFLAGS) outages.c $(CGILIBS) $(CDATALIBS) -o $@
|
||||
+ $(CC) $(CFLAGS) $(LDFLAGS) outages.c $(CGILIBS) $(CDATALIBS) $(LDADD) -o $@
|
||||
|
||||
showlog.cgi: showlog.c $(CGIDEPS) $(LIFODEPS)
|
||||
- $(CC) $(CFLAGS) $(LDFLAGS) showlog.c $(CGILIBS) $(LIFOLIBS) -o $@
|
||||
+ $(CC) $(CFLAGS) $(LDFLAGS) showlog.c $(CGILIBS) $(LIFOLIBS) $(LDADD) -o $@
|
||||
|
||||
status.cgi: status.c $(CGIDEPS) $(CDATADEPS) $(EDATADEPS)
|
||||
- $(CC) $(CFLAGS) $(LDFLAGS) status.c $(CGILIBS) $(CDATALIBS) $(EDATALIBS) -o $@
|
||||
+ $(CC) $(CFLAGS) $(LDFLAGS) status.c $(CGILIBS) $(CDATALIBS) $(EDATALIBS) $(LDADD) -o $@
|
||||
|
||||
statuswml.cgi: statuswml.c $(CGIDEPS)
|
||||
- $(CC) $(CFLAGS) $(LDFLAGS) statuswml.c $(CGILIBS) -o $@
|
||||
+ $(CC) $(CFLAGS) $(LDFLAGS) statuswml.c $(CGILIBS) $(LDADD) -o $@
|
||||
|
||||
statusmap.cgi: statusmap.c $(CGIDEPS) $(EDATADEPS)
|
||||
- $(CC) $(CFLAGS) $(LDFLAGS) statusmap.c $(CGILIBS) $(GDLIBS) $(EDATALIBS) -o $@
|
||||
+ $(CC) $(CFLAGS) $(LDFLAGS) statusmap.c $(CGILIBS) $(GDLIBS) $(EDATALIBS) $(LDADD) -o $@
|
||||
|
||||
statuswrl.cgi: statuswrl.c $(CGIDEPS) $(EDATADEPS)
|
||||
- $(CC) $(CFLAGS) $(LDFLAGS) statuswrl.c $(CGILIBS) $(MATHLIBS) $(EDATALIBS) -o $@
|
||||
+ $(CC) $(CFLAGS) $(LDFLAGS) statuswrl.c $(CGILIBS) $(MATHLIBS) $(EDATALIBS) $(LDADD) -o $@
|
||||
|
||||
summary.cgi: summary.c $(CGIDEPS)
|
||||
- $(CC) $(CFLAGS) $(LDFLAGS) summary.c $(CGILIBS) -o $@
|
||||
+ $(CC) $(CFLAGS) $(LDFLAGS) summary.c $(CGILIBS) $(LDADD) -o $@
|
||||
|
||||
tac.cgi: tac.c $(CGIDEPS) $(CDATADEPS) $(EDATADEPS)
|
||||
- $(CC) $(CFLAGS) $(LDFLAGS) tac.c $(CGILIBS) $(CDATALIBS) $(EDATALIBS) -o $@
|
||||
+ $(CC) $(CFLAGS) $(LDFLAGS) tac.c $(CGILIBS) $(CDATALIBS) $(EDATALIBS) $(LDADD) -o $@
|
||||
|
||||
trends.cgi: trends.c $(CGIDEPS)
|
||||
- $(CC) $(CFLAGS) $(LDFLAGS) trends.c $(CGILIBS) $(GDLIBS) -o $@
|
||||
+ $(CC) $(CFLAGS) $(LDFLAGS) trends.c $(CGILIBS) $(GDLIBS) $(LDADD) -o $@
|
||||
|
||||
histogram.cgi: histogram.c $(CGIDEPS)
|
||||
- $(CC) $(CFLAGS) $(LDFLAGS) histogram.c $(CGILIBS) $(GDLIBS) -o $@
|
||||
+ $(CC) $(CFLAGS) $(LDFLAGS) histogram.c $(CGILIBS) $(GDLIBS) $(LDADD) -o $@
|
||||
|
||||
clean:
|
||||
rm -f $(CGIS) *.o *.cfg *.sub core
|
19
net-analyzer/nagios-core/files/nagios.conf
Normal file
19
net-analyzer/nagios-core/files/nagios.conf
Normal file
@@ -0,0 +1,19 @@
|
||||
<IfDefine NAGIOS>
|
||||
|
||||
ScriptAlias /nagios/cgi-bin/ /usr/nagios/sbin/
|
||||
<Directory "/usr/nagios/sbin/">
|
||||
AllowOverride AuthConfig
|
||||
Options ExecCGI
|
||||
Order allow,deny
|
||||
Allow from all
|
||||
</Directory>
|
||||
|
||||
|
||||
Alias /nagios /usr/nagios/share/
|
||||
<Directory "/usr/nagios/share">
|
||||
AllowOverride AuthConfig
|
||||
Order allow,deny
|
||||
Allow from all
|
||||
</Directory>
|
||||
|
||||
</IfDefine>
|
@@ -0,0 +1,14 @@
|
||||
--- contrib/eventhandlers/distributed-monitoring/submit_check_result_via_nsca.orig 2004-08-20 14:57:38.462260008 +0300
|
||||
+++ contrib/eventhandlers/distributed-monitoring/submit_check_result_via_nsca 2004-08-20 15:06:46.647923120 +0300
|
||||
@@ -32,7 +32,10 @@
|
||||
|
||||
NscaBin="/usr/local/nagios/libexec/send_nsca"
|
||||
NscaCfg="/usr/local/nagios/etc/send_nsca.cfg"
|
||||
-NagiosHost="nagioshost"
|
||||
+
|
||||
+# Gentoo Linux Users: configure the hostname in /etc/conf.d/nagios
|
||||
+source /etc/conf.d/nagios
|
||||
+NagiosHost="${NAGIOS_NSCA_HOST}"
|
||||
|
||||
# create the command line to add to the command file
|
||||
cmdline="$1;$2;$3;$4"
|
Reference in New Issue
Block a user