Created
August 12, 2013 13:48
-
-
Save mlutfy/6210965 to your computer and use it in GitHub Desktop.
nagios check to make sure ssh is not accessible
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
## | |
## Checks that ssh on a host is not accessible. | |
## | |
/usr/lib/nagios/plugins/check_ssh -t 5 $1 | |
FOO=$? | |
# a non-zero output means that it failed, which is what we want | |
if [ "$FOO" == "0" ]; then | |
echo "CRITICAL - ssh is accessible, it should not be." | |
exit 1 | |
else | |
echo "SSHDOWN OK - ssh seems down, yay." | |
exit 0 | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment