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
c1d2a7af
Commit
c1d2a7af
authored
1 year ago
by
Hahn Axel (hahn)
Browse files
Options
Downloads
Patches
Plain Diff
check inc_getconfig.sh exists and hostname -f
parent
6434a539
Branches
Branches containing commit
No related tags found
1 merge request
!27
check inc_getconfig.sh exists and hostname -f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
director-cli.sh
+14
-2
14 additions, 2 deletions
director-cli.sh
icinga-cli.sh
+15
-6
15 additions, 6 deletions
icinga-cli.sh
with
29 additions
and
8 deletions
director-cli.sh
+
14
−
2
View file @
c1d2a7af
...
@@ -20,8 +20,11 @@
...
@@ -20,8 +20,11 @@
# 2023-01-22 v0.4 ah fix _bStopOnError; some shellfixes
# 2023-01-22 v0.4 ah fix _bStopOnError; some shellfixes
# 2023-02-17 v0.5 ah add hostnamme into CFGSTORAGE
# 2023-02-17 v0.5 ah add hostnamme into CFGSTORAGE
# 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
# ======================================================================
# ======================================================================
_version
=
"0.7"
tmpfile
=
/tmp/outcurl.tmp
tmpfile
=
/tmp/outcurl.tmp
tmpfile2
=
/tmp/outcurl2.tmp
tmpfile2
=
/tmp/outcurl2.tmp
...
@@ -768,7 +771,7 @@ ENDOFHELP
...
@@ -768,7 +771,7 @@ ENDOFHELP
# ------------------------------------------------------------
# ------------------------------------------------------------
echo
echo
echo
"##### DIRECTOR HELPER
$MY_NAME
-
$MY_IP
"
echo
"##### DIRECTOR HELPER
v
$_version
#####
$MY_NAME
$MY_IP
"
echo
echo
if
[
"
$1
"
=
"--cfg"
]
&&
[
-n
"
$2
"
]
;
then
if
[
"
$1
"
=
"--cfg"
]
&&
[
-n
"
$2
"
]
;
then
...
@@ -776,7 +779,12 @@ if [ "$1" = "--cfg" ] && [ -n "$2" ]; then
...
@@ -776,7 +779,12 @@ if [ "$1" = "--cfg" ] && [ -n "$2" ]; then
.
"
${
2
}
"
.
"
${
2
}
"
shift
2
shift
2
else
else
.
"
$(
dirname
$0
)
/inc_getconfig.sh"
_cfg
=
"
$(
dirname
$0
)
/inc_getconfig.sh"
if
[
!
-f
"
$_cfg
"
]
;
then
echo
"ERROR: The configuration file
$_cfg
was not created yet."
exit
1
fi
.
"
$_cfg
"
fi
fi
.
$(
dirname
$0
)
/inc_functions.sh
.
$(
dirname
$0
)
/inc_functions.sh
.
$(
dirname
$0
)
/inc/rest-api-client.sh
.
$(
dirname
$0
)
/inc/rest-api-client.sh
...
@@ -791,6 +799,10 @@ cd $(dirname $0) || exit
...
@@ -791,6 +799,10 @@ cd $(dirname $0) || exit
ls
./
$(
basename
$0
)
>
/dev/null
||
exit
1
ls
./
$(
basename
$0
)
>
/dev/null
||
exit
1
_initVars
_initVars
if
[
-z
"
$MY_NAME
"
]
;
then
echo
"ERROR: hostname is empty. Ensure that the command 'hostname -f' returns a fqdn."
exit
1
fi
# ensure that ./inc_getconfig.sh was loaded
# ensure that ./inc_getconfig.sh was loaded
if
[
-z
"
${
dir_cfg
}
"
]
;
then
if
[
-z
"
${
dir_cfg
}
"
]
;
then
...
...
This diff is collapsed.
Click to expand it.
icinga-cli.sh
+
15
−
6
View file @
c1d2a7af
...
@@ -9,7 +9,7 @@
...
@@ -9,7 +9,7 @@
# - curl
# - curl
# - jq
# - jq
# ----------------------------------------------------------------------
# ----------------------------------------------------------------------
# ah = axel.hahn@
iml.
unibe.ch
# ah = axel.hahn@unibe.ch
# 2021-03-.. init
# 2021-03-.. init
# 2022-01-11 v0.7 ah shellcheck
# 2022-01-11 v0.7 ah shellcheck
# 2022-02-16 v0.8 ah add --cfg param
# 2022-02-16 v0.8 ah add --cfg param
...
@@ -18,20 +18,25 @@
...
@@ -18,20 +18,25 @@
# 2022-07-08 v0.11 ah check pipes in output and performance data
# 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-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-13 v0.13 ah rename myHost to MY_NAME (like in director_cli)
# 2023-02-17 v0.14 ah add hostnamme into CFGSTORAGE
# 2023-02-17 v0.14 ah add hostnamme into CFGSTORAGE
# 2023-02-17 v0.15 ah check inc_getconfig.sh exists and hostname -f has a value
# ======================================================================
# ======================================================================
_product
=
"ICINGA PASSIVE CLIENT"
_product
=
"ICINGA PASSIVE CLIENT"
_version
=
"0.1
4
"
_version
=
"0.1
5
"
_license
=
"GNU GPL 3.0"
_license
=
"GNU GPL 3.0"
_copyright
=
'(c)
2020
Institute for Medical Education * University of Bern'
_copyright
=
'(c) Institute for Medical Education * University of Bern'
typeset
-i
debug
=
0
typeset
-i
debug
=
0
# source config ...
# source config ...
.
"
$(
dirname
$0
)
/inc_getconfig.sh"
_cfg
=
"
$(
dirname
$0
)
/inc_getconfig.sh"
if
[
!
-f
"
$_cfg
"
]
;
then
echo
"ERROR: The configuration file
$_cfg
was not created yet."
exit
1
fi
.
"
$_cfg
"
# where to find check scripts ... first directory wins
# where to find check scripts ... first directory wins
...
@@ -43,6 +48,10 @@ logfile="${dir_logs}/execution.log"
...
@@ -43,6 +48,10 @@ logfile="${dir_logs}/execution.log"
ch
=
"
$(
dirname
$0
)
/inc/confighandler.sh"
ch
=
"
$(
dirname
$0
)
/inc/confighandler.sh"
MY_NAME
=
$(
hostname
-f
)
MY_NAME
=
$(
hostname
-f
)
if
[
-z
"
$MY_NAME
"
]
;
then
echo
"ERROR: hostname is empty. Ensure that the command 'hostname -f' returns a fqdn."
exit
1
fi
# for loop mode only: max. random sleep time
# for loop mode only: max. random sleep time
typeset
-i
sleeptime
=
30
typeset
-i
sleeptime
=
30
...
...
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