]> arthur.barton.de Git - nagcollect.git/commitdiff
New make target "plugins" to generate active check scripts
authorAlexander Barton <alex@barton.de>
Tue, 15 Nov 2011 11:11:20 +0000 (12:11 +0100)
committerAlexander Barton <alex@barton.de>
Tue, 15 Nov 2011 11:11:20 +0000 (12:11 +0100)
The generated active service checks are Nagios-compatible and stored
in the client/lib/nagios/plugins directory.

Makefile

index ef19ad4bb63a68d53f99b8bf2673378e99a080d3..3256507564605fd167daa9f361c6fdb953b97a91 100644 (file)
--- 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
@@ -13,6 +13,7 @@ all:
 
 clean:
        find . -name .DS_Store -delete
+       rm -rf client/lib/nagios
 
 distclean: clean
 
@@ -70,6 +71,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) | \
+        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" \