summaryrefslogtreecommitdiff
path: root/build-nagios
diff options
context:
space:
mode:
authorPeter Palfrader <peter@palfrader.org>2009-03-26 13:52:31 +0000
committerweasel <weasel@bc3d92e2-beff-0310-a7cd-cc87d7ac0ede>2009-03-26 13:52:31 +0000
commit4f79e6ddffa8c988c4f651546131bcb5985b9721 (patch)
treecc788f285a7a9f7bb5c3f2123a754fb75f1c2df3 /build-nagios
parentc4beab1dff54ab194c2435ed73b1020fbfcd9077 (diff)
Also allow remote hostname replacement in remotechecks
git-svn-id: svn+ssh://asteria.noreply.org/svn/weaselutils/trunk@381 bc3d92e2-beff-0310-a7cd-cc87d7ac0ede
Diffstat (limited to 'build-nagios')
-rwxr-xr-xbuild-nagios5
1 files changed, 4 insertions, 1 deletions
diff --git a/build-nagios b/build-nagios
index 2d71d9c..415eabd 100755
--- a/build-nagios
+++ b/build-nagios
@@ -405,7 +405,10 @@ config['services'].each{ |service|
host_ip = config['servers'][host]['address']
throw "For some reason I do not have an address for #{host}. This shouldn't be." unless host_ip
- check = $nrpe.add("#{host}_#{hostservice['service_description']}", hostservice['remotecheck'].gsub(/\$HOSTADDRESS\$/, host_ip))
+ remotecheck = hostservice['remotecheck']
+ remotecheck.gsub!(/\$HOSTADDRESS\$/, host_ip)
+ remotecheck.gsub!(/\$HOSTNAME\$/, host)
+ check = $nrpe.add("#{host}_#{hostservice['service_description']}", remotecheck)
hostservice['check_command'] = "#{NRPE_CHECKNAME_HOST}!#{ config['servers'][ relay ]['address'] }!#{ check }"
# Make sure dependencies are an array. If there are none, create an empty array