Build precise queries to find exactly what you need
Press ESC to close
First of all great script. I’m running RedHat 7.5 and had a problem with the $TRUST_EXIT_CODE. The check was allways ok, even when the checked service was not running. Because of line 255:
[ $TRUST_EXIT_CODE -eq 1 ] && [ $EXIT_CODE -eq 0 ] && echo “Trust $STATUS_MSG” && exit $OK
I changed in the if section for $OS == linux line 85 from $TRUST_EXIT_CODE=1 to $TRUST_EXIT_CODE=0 and script is working as expected.
determine_service_tool() { if [[ $OS == linux ]]; then if command -v systemctl >/dev/null 2>&1; then SERVICETOOL=”systemctl status $SERVICE | grep -i Active” LISTTOOL=”systemctl” if [ $USERNAME ]; then SERVICETOOL=”sudo -u $USERNAME systemctl status $SERVICE” LISTTOOL=”sudo -u $USERNAME systemctl” fi TRUST_EXIT_CODE=0 # changed from 1 to 0
Maybe this will help some one or you can fix it permenantly. Kind regards
We’ve completely redesigned the world’s largest repository of Nagios plugins and monitoring tools. Join thousands of users sharing monitoring solutions for servers, applications, and everything in between.
Due to our redesign, all existing accounts require a password reset to access your account again.
Ready to explore 6,100+ projects and contribute to the community?
Reset Password Create Account
Happy Monitoring!