From fe47a13d8f88739eaf60979e82cef5c78ec3fb98 Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Fri, 16 Jun 2017 11:33:52 +1200 Subject: Semi-sensible default for NSCA_SERVER --- README.markdown | 4 +++- nscaw | 2 +- 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 -- cgit v1.2.3