X-Git-Url: https://arthur.barton.de/cgi-bin/gitweb.cgi?p=nagcollect.git;a=blobdiff_plain;f=Makefile;h=5c783c938f0ac69aea90df4b0645104f7872b01d;hp=ef19ad4bb63a68d53f99b8bf2673378e99a080d3;hb=6d47f0ea45dd85a336c88728094c19292c866c0d;hpb=281cb8c8a6c3f9eb01d46ea8dc95d93948b7a924 diff --git a/Makefile b/Makefile index ef19ad4..5c783c9 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,6 @@ # # 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 @@ -9,20 +9,21 @@ # 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 \ @@ -39,12 +40,14 @@ install-server: [ -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 install -c -o 0 -g 0 -m 755 -p \ client/bin/nagcollectreset /usr/local/sbin/nagcollectreset + install -c -o 0 -g 0 -m 755 -p \ + client/bin/nagcollecttest /usr/local/sbin/nagcollecttest install -d -o 0 -g 0 -m 755 /usr/local/etc [ -r /usr/local/etc/nagcollect.conf ] || \ install -o 0 -g 0 -m 600 -p \ @@ -59,6 +62,14 @@ install-client: [ -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 @@ -70,6 +81,24 @@ 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 2>/dev/null) | \ + 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" \ @@ -88,6 +117,7 @@ nagcollecttestscripts: -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-