Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
I
icinga-passive-client
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Open Source
icinga-passive-client
Commits
0857f120
Commit
0857f120
authored
1 year ago
by
Hahn Axel (hahn)
Browse files
Options
Downloads
Patches
Plain Diff
director cli: fix json genration for mult.ports
parent
63889bac
No related branches found
No related tags found
1 merge request
!33
director cli: fix json genration for mult.ports
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
director-cli.sh
+6
-4
6 additions, 4 deletions
director-cli.sh
with
6 additions
and
4 deletions
director-cli.sh
+
6
−
4
View file @
0857f120
...
...
@@ -21,10 +21,11 @@
# 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-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 jo
>
/dev/null
||
exit
1
...
...
@@ -118,14 +119,14 @@ hostDefaultgroups="groups[]=iml groups[]=iml-server"
# check if host is in a private network:
if
echo
"
$MY_IP
"
|
grep
-E
"
${
regexPrivateNetworks
}
"
>
/dev/null
then
JSONPARAMS+
=
'imports[]="${hostImportPrivate}" '
JSONPARAMS+
=
'imports[]="
'
${
hostImportPrivate
}
'
" '
else
JSONPARAMS+
=
'imports[]="${hostImportReachable}" '
JSONPARAMS+
=
'imports[]="
'
${
hostImportReachable
}
'
" '
fi
# port checks initiated by icinga server to monitor client
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
# ----- host groups
...
...
@@ -324,6 +325,7 @@ hostDefaultgroups="groups[]=iml groups[]=iml-server"
# --- get json data of object
if
[
$_bSendData
=
true
]
;
then
echo
"
$_jsonparams
"
_jsondata
=
$(
eval
jo
-p
-d
.
$_jsonparams
)
fi
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment