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

Merge branch '7617-update-rest-api-client' into 'master'

OP#7617 Icinga client - Zertifikatsprüfung bei Senden an Sattelit prüfen  https://projects.iml.unibe.ch/work_packages/7617

See merge request !45
parents 5c7bfc83 8db719c8
No related branches found
No related tags found
1 merge request!45OP#7617 Icinga client - Zertifikatsprüfung bei Senden an Sattelit prüfen https://projects.iml.unibe.ch/work_packages/7617
...@@ -25,10 +25,11 @@ ...@@ -25,10 +25,11 @@
# 2023-11-03 v0.10 ah fix json key for service link # 2023-11-03 v0.10 ah fix json key for service link
# 2024-03-26 v0.11 ah on service creation: use http status code instead of exitcode # 2024-03-26 v0.11 ah on service creation: use http status code instead of exitcode
# 2024-04-09 v0.12 ah add host_notes_url on host # 2024-04-09 v0.12 ah add host_notes_url on host
# 2024-11-20 v0.13 ah update rest api client; show --hs param in the help
# ====================================================================== # ======================================================================
_version="0.12" _version="0.13"
which curl >/dev/null || exit 1 which curl >/dev/null || exit 1
which jo >/dev/null || exit 1 which jo >/dev/null || exit 1
...@@ -664,6 +665,9 @@ Host actions ...@@ -664,6 +665,9 @@ Host actions
--hostdelete --hostdelete
Delete [$MY_NAME] in the icinga director Delete [$MY_NAME] in the icinga director
--hs
--hostshow
Show generated JSON for cur current host what should be sent
Check actions Check actions
...@@ -743,7 +747,7 @@ else ...@@ -743,7 +747,7 @@ else
. "$_cfg" . "$_cfg"
fi fi
. $(dirname $0)/inc_functions.sh . $(dirname $0)/inc_functions.sh
. $(dirname $0)/inc/rest-api-client.sh . $(dirname $0)/inc/http.class.sh
if [ $# -eq 0 ]; then if [ $# -eq 0 ]; then
......
...@@ -24,11 +24,12 @@ ...@@ -24,11 +24,12 @@
# 2023-11-02 v0.17 ah fix line breaks of sent output, shell check fixes # 2023-11-02 v0.17 ah fix line breaks of sent output, shell check fixes
# 2023-11-02 v0.18 ah fix quoting of perfdata in json # 2023-11-02 v0.18 ah fix quoting of perfdata in json
# 2023-11-02 v0.19 ah move _parseConfig # 2023-11-02 v0.19 ah move _parseConfig
# 2024-11-20 v0.20 ah update rest api client; use cert "${dir_cfg}/certs/ca.crt"
# ====================================================================== # ======================================================================
_product="ICINGA PASSIVE CLIENT" _product="ICINGA PASSIVE CLIENT"
_version="0.19" _version="0.20"
_license="GNU GPL 3.0" _license="GNU GPL 3.0"
_copyright='(c) Institute for Medical Education * University of Bern' _copyright='(c) Institute for Medical Education * University of Bern'
...@@ -72,6 +73,14 @@ function _initHttp(){ ...@@ -72,6 +73,14 @@ function _initHttp(){
if [ $debug -ne 0 ]; then if [ $debug -ne 0 ]; then
http.setDebug 1 http.setDebug 1
fi fi
local _cert="${dir_cfg}/certs/ca.crt"
if [ ! -f "$_cert" ]; then
echo
echo "ERROR: certificate was not found."
echo "Copy the Icinga master CA into $_cert"
exit 1
fi
http.setCA "$_cert"
} }
...@@ -553,7 +562,7 @@ else ...@@ -553,7 +562,7 @@ else
. "$( dirname $0 )/inc_getconfig.sh" . "$( dirname $0 )/inc_getconfig.sh"
fi fi
. "$( dirname $0 )/inc/rest-api-client.sh" . "$( dirname $0 )/inc/http.class.sh"
if [ $# -eq 0 ]; then if [ $# -eq 0 ]; then
showHelp showHelp
......
This diff is collapsed.
This diff is collapsed.
#!/bin/sh #!/bin/sh
wget -O rest-api-client.sh https://git-repo.iml.unibe.ch/iml-open-source/bash-rest-api-client/-/raw/master/rest-api-client.sh cd "$( dirname "$0" )"
myfile=http.class.sh
wget -O "$myfile" "https://git-repo.iml.unibe.ch/iml-open-source/bash-rest-api-client/-/raw/master/$myfile"
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment