aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org.ua>2019-10-09 17:43:35 +0300
committerSergey Poznyakoff <gray@gnu.org.ua>2019-10-09 17:43:35 +0300
commit11bdce3bc880f7b21c2aff6945673f9bfa7409db (patch)
tree3df5069080285718a13b47e023f9419f67843e9b
parent79b0eb417b0431e316964e003a9efe6b6725b94a (diff)
downloadcertmon-11bdce3bc880f7b21c2aff6945673f9bfa7409db.tar.gz
certmon-11bdce3bc880f7b21c2aff6945673f9bfa7409db.tar.bz2
Add Makefile
-rw-r--r--Makefile18
-rw-r--r--certmon.go7
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 @@
1PREFIX = /usr/local
2BINDIR = $(PREFIX)/bin
3
4all:
5 @go build -o certmon certmon.go
6
7clean:
8 @go clean
9
10install:
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 .
diff --git a/certmon.go b/certmon.go
index 155ff0f..36a520d 100644
--- a/certmon.go
+++ b/certmon.go
@@ -152,7 +152,12 @@ func (res CertResult) FormatPerfData() {
152} 152}
153 153
154func (rl CertResultList) Format() { 154func (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(" | ")

Return to:

Send suggestions and report system problems to the System administrator.