Skip to content

Instantly share code, notes, and snippets.

@mlutfy
Created August 12, 2013 13:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mlutfy/6210965 to your computer and use it in GitHub Desktop.
Save mlutfy/6210965 to your computer and use it in GitHub Desktop.
nagios check to make sure ssh is not accessible
#!/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