diff options
-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 @@ +PREFIX = /usr/local +BINDIR = $(PREFIX)/bin + +all: + @go build -o certmon certmon.go + +clean: + @go clean + +install: + @GOBIN=$$(if test -n "$(NAGIOS_CONF)" && \ + test -f "$(NAGIOS_CONF)/resource.cfg"; \ + then \ + sed -n '/^\$$USER1\$$=/s///p' $$NAGIOS_CONF; \ + else \ + echo $(BINDIR); \ + fi) \ + go install . @@ -152,7 +152,12 @@ func (res CertResult) FormatPerfData() { } func (rl CertResultList) Format() { - //'label'=value[UOM];[warn];[crit];[min];[max] + // For details about Nagios plugin output format, refer to: + // https://assets.nagios.com/downloads/nagioscore/docs/nagioscore/4/en/pluginapi.html + // and + // https://nagios-plugins.org/doc/guidelines.html + // In particular, performance data format is: + // 'label'=value[UOM];[warn];[crit];[min];[max] fmt.Printf("%s - %s ", statusString[rl.Status], rl.Address) rl.Result[0].FormatHR() fmt.Printf(" | ") |