From cf53e28a0e46668ec488ad079ef9bf5e07bc9b13 Mon Sep 17 00:00:00 2001 From: Alexander Barton Date: Tue, 15 Nov 2011 12:11:20 +0100 Subject: [PATCH] New make target "plugins" to generate active check scripts The generated active service checks are Nagios-compatible and stored in the client/lib/nagios/plugins directory. --- Makefile | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index ef19ad4..3256507 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 @@ -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" \ -- 2.39.2