--- /dev/null
+client/lib/nagios/
NagCollect: Nagios Data Collector for Passive Checks
- Copyright (c)2009-2010 Alexander Barton, alex@barton.de
+ Copyright (c)2009-2011 Alexander Barton, alex@barton.de
NagCollect is free software and published under the
terms of the GNU General Public License.
ChangeLog
+NagCollect Release 3 (2011-11-21)
+
+ - RAID.tst: only check RAID on Linux when /proc/md is readable
+ - Uptime.tst: uptime "<n> hrs" is critical, because <1 day!
+ - Set /usr/local/lib/nagcollect to "world readable" after update
+ - Uptime.tst: handle "<n> mins", "1 hr", and "* secs"
+ - RAID.tst: fix wrong variable name in status text output
+ - Disks.tst: Only check read-write volumes
+ - Don't exclude "." when extracting test scripts
+ - RAID.tst: Add support for Apple hardware RAID cards
+ - DiskErrors.tst: exclude false positive I/O error of mdworker
+ - Rename de.barton.nagcollect to de.barton.nagcollect.plist
+ - HardwareInfo.tst: new test to display Apple hardware serial numbers
+ - DiskErrors.tst: dont't assume "encoder error" as disk I/O error
+ - Add CRON configuration file
+ - Add Makefile for installing the client on Linux
+ - HardwareInfo.tst: New test to display DMI/SMBIOS hardware information
+ - RAID.tst: suppress warning and error messages
+ - Add "nagcollecttest" script
+ - Add wrapper script for calling test scripts as active service checks
+ - Use new make targets "server", "client", "plugins", "install-plugins"
+
NagCollect Release 2.1 (2010-09-01)
- Uptime.tst: detect new uptime string "<n> hrs"
NagCollect: Nagios Data Collector for Passive Checks
- Copyright (c)2009-2010 Alexander Barton, alex@barton.de
+ Copyright (c)2009-2011 Alexander Barton, alex@barton.de
NagCollect is free software and published under the
terms of the GNU General Public License.
- Start: sudo launchctl load -w /Library/LaunchDaemons/de.barton.nagcollect
- Stop: sudo launchctl unload -w /Library/LaunchDaemons/de.barton.nagcollect
+
+
+Plugins (active checks)
+~~~~~~~~~~~~~~~~~~~~~~~
+
+1. Run "make install-plugins".
+
+The plugins will be build (generated using the passive service checks and
+a wrapper script) and installed into /usr/local/lib/nagios/plugins/.
#
# NagCollect -- Nagios Data Collector for Passive Checks
-# Copyright (c)2009-2010 Alexander Barton, alex@barton.de
+# Copyright (c)2009-2011 Alexander Barton, alex@barton.de
#
# 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
# Please read the file COPYING, README and AUTHORS for more information.
#
-all:
+all: server client plugins
clean:
find . -name .DS_Store -delete
+ rm -rf client/lib/nagios
distclean: clean
install:
- @echo " ** Use make targets 'install-client', 'install-server' and 'install-all'"
- @echo " ** to install client and/or server components!"
+ @echo " ** Use make targets 'install-client', 'install-server', 'install-plugins'
+ @echo " ** or 'install-all' to install client, server and or plugin components!"
-install-all: install-server install-client
+install-all: install-server install-client install-plugins
-install-server:
+install-server: server
install -d -o nagios -g nagios -m 750 /var/lib/nagios3/collect
[ -r /etc/nagios3/system.cfg ] || \
install -D -o nagios -g root -m 640 -p \
[ -r contrib/Makefile.`uname` ] \
&& make -f contrib/Makefile.`uname` "install-server" || true
-install-client:
+install-client: client
install -d -o 0 -g 0 -m 755 /usr/local/sbin
install -c -o 0 -g 0 -m 755 -p \
client/bin/nagcollect /usr/local/sbin/nagcollect
[ -r contrib/Makefile.`uname` ] \
&& make -f contrib/Makefile.`uname` "install-client" || true
+install-plugins: plugins
+ install -d -o 0 -g 0 -m 755 /usr/local/lib/nagios/plugins
+ (cd client/lib/nagios/plugins; find . -name 'check_nc_*' | \
+ while read x; do \
+ install -o 0 -g 0 -m 755 "$$x" "/usr/local/lib/nagios/plugins/$$x"; \
+ done \
+ )
+
check:
dist: distclean
distcheck: check dist
+server:
+
+client:
+
+plugins:
+ mkdir -p client/lib/nagios/plugins
+ (cd client/lib/tests; (ls -1 *.tst; ls -1 `uname`/*.tst) | \
+ while read x; do \
+ name="check_nc_`basename "$$x" | cut -d'.' -f1 | tr '[A-Z]' '[a-z]'`"; \
+ dest="../nagios/plugins/$$name"; \
+ echo " * $$x -> $$name"; \
+ cat "../wrapper/wrapper-top.sh" >"$$dest"; \
+ cat "$$x" >>"$$dest"; \
+ cat "../wrapper/wrapper-bottom.sh" >>"$$dest"; \
+ chmod 755 "$$dest"; \
+ done \
+ )
+
osxpkg:
rel=`grep "^NagCollect " ChangeLog|awk "{print \\\$$3 }"|head -n 1`; \
rm -rf "../NagCollect-R$${rel}.mpkg" \
-C client/lib/tests .
.PHONY: all install install-all install-server install-client \
- clean distclean check dist distcheck nagcollecttestscripts
+ install-plugins clean distclean check dist distcheck server client \
+ plugins osxpkg osxdmg nagcollecttestscripts
# -eof-
NagCollect: Nagios Data Collector for Passive Checks
- Copyright (c)2009 Alexander Barton, alex@barton.de
+ Copyright (c)2009-2011 Alexander Barton, alex@barton.de
NagCollect is free software and published under the
terms of the GNU General Public License.
handle passive host and service checks. It consists of some scripts that must
be installed on the server and others that must run on the clients.
+In addition, the passive service checks can be used as active check scripts
+using a wrapper script included in this distribution.
+
See the file INSTALL for details.
--- /dev/null
+#!/bin/bash
+#
+# NagCollect -- Nagios Data Collector for Passive Checks
+# Copyright (c)2009-2011 Alexander Barton, alex@barton.de
+#
+# 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.
+# Please read the file COPYING, README and AUTHORS for more information.
+#
+
+NAME=`basename "$0"`
+MAXTIME=300
+
+if [ $# -ne 1 ]; then
+ echo "Usage: $NAME <scriptname>"
+ exit 2
+fi
+if [ `id -u` -ne 0 ]; then
+ echo "$NAME must be run as root!"
+ exit 2
+fi
+
+if [ -r /usr/local/lib/nagcollect/"$1.tst" ]; then
+ tst=/usr/local/lib/nagcollect/"$1.tst"
+elif [ -r /usr/local/lib/nagcollect/`uname`/"$1.tst" ]; then
+ tst=/usr/local/lib/nagcollect/`uname`/"$1.tst"
+else
+ echo "$NAME: script \"$1\" not found!"
+ exit 2
+fi
+
+SERVICE=""; STATUS=""; TEXT=""
+echo "Checking \"$tst\" ..."
+. "$tst"
+echo "RESULT: $SERVICE=$STATUS \"$TEXT\""
+
+# -eof-
if [ `uname` = "Darwin" ]; then
tmp=`mktemp "/tmp/$$.XXXX"`
- LC_ALL=C diskutil checkRAID >"$tmp"
+ LC_ALL=C diskutil checkRAID >"$tmp" 2>/dev/null
if [ $? -eq 0 ]; then
# Apple Software-RAID detected
statusString1=`grep "^Status:" "$tmp" | uniq`
TEXT="OK - RAID status is good."
fi
fi
- LC_ALL=C raidutil list status | grep "RAID " >"$tmp"
+ LC_ALL=C raidutil list status 2>/dev/null | grep "RAID " >"$tmp"
if [ $? -eq 0 ]; then
# Apple Hardware-RAID detected
declare -i good=0
--- /dev/null
+
+# BEGIN: wrapper-bottom.sh
+
+if [ -z "$TEXT" -o -z "$STATUS" ]; then
+ echo "Test script failed! Check not supported on this system?"
+ exit 3
+fi
+
+echo "$TEXT"
+exit "$STATUS"
+
+# -eof-
--- /dev/null
+#!/bin/bash
+#
+# NagCollect -- Nagios Data Collector for Passive Checks
+# Copyright (c)2009-2011 Alexander Barton, alex@barton.de
+#
+# 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.
+# Please read the file COPYING, README and AUTHORS for more information.
+#
+# Wrapper script for active service checks :-)
+#
+
+SERVICE=""; STATUS=""; TEXT=""
+
+# END: wrapper-top.sh
+