Skip to content
Snippets Groups Projects
Commit f7cf8021 authored by Hahn Axel (hahn)'s avatar Hahn Axel (hahn)
Browse files

Merge branch 'update-confighandler' into 'master'

director cli: fix json genration for mult.ports

See merge request !33
parents 82e56e27 3e474ad5
Branches
No related tags found
1 merge request!33director cli: fix json genration for mult.ports
...@@ -21,10 +21,11 @@ ...@@ -21,10 +21,11 @@
# 2023-02-17 v0.6 ah remove invalid line in cleanup # 2023-02-17 v0.6 ah remove invalid line in cleanup
# 2023-02-17 v0.7 ah check inc_getconfig.sh exists and hostname -f has a value # 2023-02-17 v0.7 ah check inc_getconfig.sh exists and hostname -f has a value
# 2023-10-25 v0.8 ah generate json with "jo"; optimze http requests on services; parallel service function call # 2023-10-25 v0.8 ah generate json with "jo"; optimze http requests on services; parallel service function call
# 2023-11-02 v0.9 ah fix json genration for multiple ports
# ====================================================================== # ======================================================================
_version="0.8" _version="0.9"
which curl >/dev/null || exit 1 which curl >/dev/null || exit 1
which jo >/dev/null || exit 1 which jo >/dev/null || exit 1
...@@ -118,14 +119,14 @@ hostDefaultgroups="groups[]=iml groups[]=iml-server" ...@@ -118,14 +119,14 @@ hostDefaultgroups="groups[]=iml groups[]=iml-server"
# check if host is in a private network: # check if host is in a private network:
if echo "$MY_IP" | grep -E "${regexPrivateNetworks}" >/dev/null if echo "$MY_IP" | grep -E "${regexPrivateNetworks}" >/dev/null
then then
JSONPARAMS+='imports[]="${hostImportPrivate}" ' JSONPARAMS+='imports[]="'${hostImportPrivate}'" '
else else
JSONPARAMS+='imports[]="${hostImportReachable}" ' JSONPARAMS+='imports[]="'${hostImportReachable}'" '
fi fi
# port checks initiated by icinga server to monitor client # port checks initiated by icinga server to monitor client
if [ -n "${host_vars_tcpport}" -a "${host_vars_tcpport}" != "[]" ]; then if [ -n "${host_vars_tcpport}" -a "${host_vars_tcpport}" != "[]" ]; then
JSONPARAMS+='vars.tcp_port=${host_vars_tcpport} ' JSONPARAMS+='vars.tcp_port="'${host_vars_tcpport}'" '
fi fi
# ----- host groups # ----- host groups
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment