1
0
Fork 0
mirror of https://github.com/munin-monitoring/contrib.git synced 2025-07-22 02:51:03 +00:00

Fix checking curl

This commit is contained in:
Sebastian Liechti 2020-04-03 23:17:59 +02:00 committed by Lars Kruse
parent 70b2815de9
commit e54c4474fa

View file

@ -45,25 +45,17 @@ GPLv2
COLIBRI_URL=${url:-"http://127.0.0.1:8080/colibri/stats"} COLIBRI_URL=${url:-"http://127.0.0.1:8080/colibri/stats"}
get_json_data() {
echo $(curl -s -f -m 2 "$COLIBRI_URL")
}
case $1 in case $1 in
autoconf) autoconf)
if [ -x /usr/bin/curl ]; then if [ -x /usr/bin/curl ]; then
if [ -x /usr/bin/jq ]; then if [ -x /usr/bin/jq ]; then
get_json_data || echo "no (no valid env.url)" && exit 0 curl -s -f -m 2 -I "$COLIBRI_URL" > /dev/null && echo "yes" && exit 0 || echo "no (no valid env.url)" && exit 0
echo "yes"
exit 0
else else
echo "no (jq not found)" echo "no (jq not found)" && exit 0
exit 0
fi fi
else else
echo "no (/usr/bin/curl not found)" echo "no (/usr/bin/curl not found)" && exit 0
exit 0
fi fi
;; ;;
@ -120,7 +112,7 @@ case $1 in
esac esac
JSONSTATS=$(get_json_data) JSONSTATS=$(curl -s -f -m 2 "$COLIBRI_URL")
echo "multigraph jitsi_videobridge_sessions" echo "multigraph jitsi_videobridge_sessions"
for KEY in videochannels audiochannels videostreams conferences participants; do for KEY in videochannels audiochannels videostreams conferences participants; do