aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2017-06-16 11:33:52 +1200
committerTom Ryder <tom@sanctum.geek.nz>2017-06-16 11:33:52 +1200
commitfe47a13d8f88739eaf60979e82cef5c78ec3fb98 (patch)
tree09e73fb0e14e764a0299c1e1b46fae56226694f9
parent23ae1c7a42a321261a3cb9999255df49791a7c2b (diff)
downloadnscaw-fe47a13d8f88739eaf60979e82cef5c78ec3fb98.tar.gz
Semi-sensible default for NSCA_SERVER
-rw-r--r--README.markdown4
-rwxr-xr-xnscaw2
2 files changed, 4 insertions, 2 deletions
diff --git a/README.markdown b/README.markdown
index e294eec..ebb1849 100644
--- a/README.markdown
+++ b/README.markdown
@@ -4,7 +4,9 @@ nscaw
Command wrapper that sends an appropriate passive check to an NSCA server using
`send_nsca`, depending on the command's outcome.
-Make sure `send_nsca` is in `$PATH` and that `NSCAW_SERVER` is set.
+Make sure `send_nsca` is in `$PATH`. You'll almost certainly want to set
+`NSCA_SERVER` in `/etc/default/nscaw` as well, but it makes an effort in
+defaulting to `nsca`.
$ nscaw IMPORTANT_JOB -- important-job -o options args ...
diff --git a/nscaw b/nscaw
index 3e30b4c..de8364f 100755
--- a/nscaw
+++ b/nscaw
@@ -77,5 +77,5 @@ esac
# stdout of send_nsca as it's just a diagnostic message
printf '%s\t%s\t%u\t%s\n' \
"$hostname" "$service" "$code" "$message" |
- send_nsca -H "${NSCAW_SERVER:?}" \
+ send_nsca -H "${NSCAW_SERVER:-nsca}" \
-c "${NSCAW_CONFIG:-/etc/send_nsca.cfg}" >/dev/null