New make target "install-plugins"
authorAlexander Barton <alex@barton.de>
Tue, 15 Nov 2011 11:14:20 +0000 (12:14 +0100)
committerAlexander Barton <alex@barton.de>
Tue, 15 Nov 2011 11:14:20 +0000 (12:14 +0100)
The plugins are installed to /usr/local/lib/nagios/plugins/.

Makefile

index 264532e..ba9bd21 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -18,10 +18,10 @@ clean:
 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: server
        install -d -o nagios -g nagios -m 750 /var/lib/nagios3/collect
@@ -60,6 +60,14 @@ install-client: 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
@@ -107,6 +115,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-