aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorU-AD\carlsoan <carlsoan@gophersjos7275.ad.uc.edu>2018-03-02 11:03:50 -0500
committerU-AD\carlsoan <carlsoan@gophersjos7275.ad.uc.edu>2018-03-02 11:03:50 -0500
commit95bf07c92652725cf138b6f8a21f973f6ac64f2d (patch)
tree67ffe47fe4640b091d3a4eb9b41bdf90ff1894dd
parent353c51c2e8237455c0941aadf42cf01b7b5d1539 (diff)
add edit
-rw-r--r--Makefile14
-rw-r--r--trigger.xml.m42
2 files changed, 13 insertions, 3 deletions
diff --git a/Makefile b/Makefile
index df9378e..504a607 100644
--- a/Makefile
+++ b/Makefile
@@ -1,3 +1,5 @@
+EDITOR = "vim"
+
define newlist
@echo "Enter \"SERVER-NAME<SPACE>SERVER-PORT\" (omit SERVER-PORT if it is 443). Enter a blank line when finished"
@while true; do read -p "$(1): " thisval ; [[ -z "$$thisval" ]] && break ; echo "$$thisval"; done > $(2)
@@ -11,7 +13,15 @@ define getsetting
$$(grep "^$(2)[ \t]*" $(1) | sed 's/^$(2)[ \t]*//g')
endef
-all: clean build/certcheck.xml
+all:
+ @echo "Options:"
+ @echo " 1) make edit -> edit list file"
+ @echo " 2) make create -> create template"
+
+create: clean build/certcheck.xml
+
+edit:
+ $(EDITOR) hostlist.txt
build/certcheck.xml: tmp/all-items.xml tmp/all-triggers.xml build
m4 -DHOSTGROUP="$(call getsetting,tmp/settings.txt,GROUP)" -DZBXHOST="$(call getsetting,tmp/settings.txt,HOST)" -DALLITEMS="$$(cat tmp/all-items.xml)" -DALLTRIGGERS="$$(cat tmp/all-triggers.xml)" host.xml.m4 > build/certcheck.xml
@@ -29,7 +39,7 @@ tmp/settings.txt: tmp
$(call newsetting,Enter check frequency in seconds,CHECKINT,3600,tmp/settings.txt)
tmp/checklist.txt: tmp
- $(call newlist,>,tmp/checklist.txt)
+ grep -v '^#' hostlist.txt tmp/checklist.txt
tmp:
mkdir tmp
diff --git a/trigger.xml.m4 b/trigger.xml.m4
index bade45c..e489164 100644
--- a/trigger.xml.m4
+++ b/trigger.xml.m4
@@ -2,7 +2,7 @@
ifelse(len(SITEPORT),0,`<expression>{ZBXHOST:certexpirecheck.sh[&quot;SITECN&quot;].last()}&lt;CERTEXPIREAGE</expression>',` <expression>{ZBXHOST:certexpirecheck.sh[&quot;SITECN&quot;,&quot;SITEPORT&quot;].last()&lt;CERTEXPIREAGE</expression>')
<recovery_mode>0</recovery_mode>
<recovery_expression/>
- <name>SITECN</name>
+ <name>SITECN SSL Certificate</name>
<correlation_mode>0</correlation_mode>
<correlation_tag/>
<url/>