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
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Open Source
icinga-passive-client
Commits
4ccadbc1
Commit
4ccadbc1
authored
2 years ago
by
Hahn Axel (hahn)
Browse files
Options
Downloads
Patches
Plain Diff
add hostnamme into CFGSTORAGE
parent
7b067b74
No related branches found
No related tags found
1 merge request
!25
add hostnamme into CFGSTORAGE
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
director-cli.sh
+6
-5
6 additions, 5 deletions
director-cli.sh
icinga-cli.sh
+3
-2
3 additions, 2 deletions
icinga-cli.sh
with
9 additions
and
7 deletions
director-cli.sh
+
6
−
5
View file @
4ccadbc1
...
...
@@ -14,10 +14,11 @@
# - UniBe network and group names - see hostCreate()
#
# ----------------------------------------------------------------------
# ah = axel.hahn@
iml.
unibe.ch
# ah = axel.hahn@unibe.ch
# 2022-02-16 v0.2 ah add --cfg param
# 2022-03-04 v0.3 ah abort on http 5xx error
# 2023-01-22 v0.4 ah fix _bStopOnError; some shellfixes
# 2023-02-17 v0.5 ah add hostnamme into CFGSTORAGE
# ======================================================================
tmpfile
=
/tmp/outcurl.tmp
...
...
@@ -91,7 +92,7 @@ typeset cfg_dryrun=false
local
MY_OSMajorVersion
=
$(
ph.getOSMajor
)
fi
export
CFGSTORAGE
=
"directorhost"
export
CFGSTORAGE
=
"
${
MY_NAME
}
-
directorhost"
(
$ch
--flush
$ch
--set
object_name
\"
$MY_NAME
\"
...
...
@@ -170,7 +171,7 @@ typeset cfg_dryrun=false
# ............................................................
# set $ch to store all object vars
function
_generateJsonForServicetemplate
(){
export
CFGSTORAGE
=
"service-
${
IDC_service__obj_name
}
"
export
CFGSTORAGE
=
"
${
MY_NAME
}
-
service-
${
IDC_service__obj_name
}
"
(
$ch
--flush
$ch
--set
object_name
"
\"
${
IDC_service__obj_name
}
\"
"
...
...
@@ -202,7 +203,7 @@ typeset cfg_dryrun=false
# ............................................................
# set $ch to store all object vars
function
_generateJsonForSvclink
(){
export
CFGSTORAGE
=
"servicelink-
${
IDC_svcathost__obj_name
}
"
export
CFGSTORAGE
=
"
${
MY_NAME
}
-
servicelink-
${
IDC_svcathost__obj_name
}
"
(
$ch
--flush
$ch
--set
object_name
"
\"
${
IDC_svcathost__obj_name
}
\"
"
...
...
@@ -427,7 +428,7 @@ typeset cfg_dryrun=false
# helper to create a base config for the current host
# UNUSED
function
UNUSED_initHostdata
(){
export
CFGSTORAGE
=
"directorhost"
export
CFGSTORAGE
=
"
${
MY_NAME
}
-
directorhost"
(
$ch
--flush
$ch
--set
object_name
\"
$MY_NAME
\"
...
...
This diff is collapsed.
Click to expand it.
icinga-cli.sh
+
3
−
2
View file @
4ccadbc1
...
...
@@ -18,11 +18,12 @@
# 2022-07-08 v0.11 ah check pipes in output and performance data
# 2023-01-30 v0.12 ah remove pipes with sed remove the pipe before performancedata
# 2023-02-13 v0.13 ah rename myHost to MY_NAME (like in director_cli)
# 2023-02-17 v0.14 ah add hostnamme into CFGSTORAGE
# ======================================================================
_product
=
"ICINGA PASSIVE CLIENT"
_version
=
"0.1
2
"
_version
=
"0.1
4
"
_license
=
"GNU GPL 3.0"
_copyright
=
'(c) 2020 Institute for Medical Education * University of Bern'
...
...
@@ -387,7 +388,7 @@ function processCheck(){
# --- send check result to Icinga
# fields of the object
# https://icinga.com/docs/icinga2/latest/doc/12-icinga2-api/#process-check-result
export
CFGSTORAGE
=
"
${
checkName
}
output"
export
CFGSTORAGE
=
"
${
MY_NAME
}
-
${
checkName
}
output"
outputAsText
=
"
$(
cat
$_outfile
)
"
# outputAsJson="$(jq -nR --arg data """${outputAsText}""" '$data')"
...
...
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