Skip to content
Snippets Groups Projects
Commit 61bef0e8 authored by David Schmitz's avatar David Schmitz
Browse files

add sensu wrapper function in systemd/fod-status.sh

parent 7077a1c4
Branches
No related tags found
No related merge requests found
...@@ -66,7 +66,21 @@ print("access to NETCONF seems to be working"); ...@@ -66,7 +66,21 @@ print("access to NETCONF seems to be working");
' "$@" < /dev/null ' "$@" < /dev/null
;; ;;
*|-s|status) --sensu-status)
"$0" --status
statusx="$?"
echo "status=$statusx"
if [ "$statusx" = 0 ]; then
echo "all basic checks passed: OK"
exit 0
else
echo "something went wrong during basic checks: ERROR"
exit 2
fi
;;
-S|status-detailed)
#set -e #set -e
"$0" --process-status "$0" --process-status
...@@ -74,7 +88,7 @@ print("access to NETCONF seems to be working"); ...@@ -74,7 +88,7 @@ print("access to NETCONF seems to be working");
echo "process status=$pstatus" echo "process status=$pstatus"
echo echo
"$0" --database-access-status "$0" --database-access-status --with-passwords
dstatus="$?" dstatus="$?"
echo "database access status=$dstatus" echo "database access status=$dstatus"
echo echo
...@@ -84,7 +98,7 @@ print("access to NETCONF seems to be working"); ...@@ -84,7 +98,7 @@ print("access to NETCONF seems to be working");
echo "gunicorn http status=$hstatus" echo "gunicorn http status=$hstatus"
echo echo
"$0" --netconf-access-status "$0" --netconf-access-status --with-passwords
nstatus="$?" nstatus="$?"
echo "NETCONF access status=$nstatus" echo "NETCONF access status=$nstatus"
echo echo
...@@ -93,10 +107,9 @@ print("access to NETCONF seems to be working"); ...@@ -93,10 +107,9 @@ print("access to NETCONF seems to be working");
echo "all_status=$all_status" echo "all_status=$all_status"
exit "$all_status" exit "$all_status"
;;
;; *|-s|--status)
-S|status-detailed)
#set -e #set -e
"$0" --process-status "$0" --process-status
...@@ -104,7 +117,7 @@ print("access to NETCONF seems to be working"); ...@@ -104,7 +117,7 @@ print("access to NETCONF seems to be working");
echo "process status=$pstatus" echo "process status=$pstatus"
echo echo
"$0" --database-access-status --with-passwords "$0" --database-access-status
dstatus="$?" dstatus="$?"
echo "database access status=$dstatus" echo "database access status=$dstatus"
echo echo
...@@ -114,7 +127,7 @@ print("access to NETCONF seems to be working"); ...@@ -114,7 +127,7 @@ print("access to NETCONF seems to be working");
echo "gunicorn http status=$hstatus" echo "gunicorn http status=$hstatus"
echo echo
"$0" --netconf-access-status --with-passwords "$0" --netconf-access-status
nstatus="$?" nstatus="$?"
echo "NETCONF access status=$nstatus" echo "NETCONF access status=$nstatus"
echo echo
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment