diff options
author | Sergey Poznyakoff <gray@gnu.org.ua> | 2019-10-09 17:43:35 +0300 |
---|---|---|
committer | Sergey Poznyakoff <gray@gnu.org.ua> | 2019-10-09 17:43:35 +0300 |
commit | 11bdce3bc880f7b21c2aff6945673f9bfa7409db (patch) | |
tree | 3df5069080285718a13b47e023f9419f67843e9b | |
parent | 79b0eb417b0431e316964e003a9efe6b6725b94a (diff) | |
download | certmon-11bdce3bc880f7b21c2aff6945673f9bfa7409db.tar.gz certmon-11bdce3bc880f7b21c2aff6945673f9bfa7409db.tar.bz2 |
Add Makefile
-rw-r--r-- | Makefile | 18 | ||||
-rw-r--r-- | certmon.go | 7 |
2 files changed, 24 insertions, 1 deletions
diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..0daf0c1 --- /dev/null +++ b/Makefile | |||
@@ -0,0 +1,18 @@ | |||
1 | PREFIX = /usr/local | ||
2 | BINDIR = $(PREFIX)/bin | ||
3 | |||
4 | all: | ||
5 | @go build -o certmon certmon.go | ||
6 | |||
7 | clean: | ||
8 | @go clean | ||
9 | |||
10 | install: | ||
11 | @GOBIN=$$(if test -n "$(NAGIOS_CONF)" && \ | ||
12 | test -f "$(NAGIOS_CONF)/resource.cfg"; \ | ||
13 | then \ | ||
14 | sed -n '/^\$$USER1\$$=/s///p' $$NAGIOS_CONF; \ | ||
15 | else \ | ||
16 | echo $(BINDIR); \ | ||
17 | fi) \ | ||
18 | go install . | ||
@@ -152,7 +152,12 @@ func (res CertResult) FormatPerfData() { | |||
152 | } | 152 | } |
153 | 153 | ||
154 | func (rl CertResultList) Format() { | 154 | func (rl CertResultList) Format() { |
155 | //'label'=value[UOM];[warn];[crit];[min];[max] | 155 | // For details about Nagios plugin output format, refer to: |
156 | // https://assets.nagios.com/downloads/nagioscore/docs/nagioscore/4/en/pluginapi.html | ||
157 | // and | ||
158 | // https://nagios-plugins.org/doc/guidelines.html | ||
159 | // In particular, performance data format is: | ||
160 | // 'label'=value[UOM];[warn];[crit];[min];[max] | ||
156 | fmt.Printf("%s - %s ", statusString[rl.Status], rl.Address) | 161 | fmt.Printf("%s - %s ", statusString[rl.Status], rl.Address) |
157 | rl.Result[0].FormatHR() | 162 | rl.Result[0].FormatHR() |
158 | fmt.Printf(" | ") | 163 | fmt.Printf(" | ") |