Last active
December 23, 2015 10:29
-
-
Save MichinobuMaeda/6622161 to your computer and use it in GitHub Desktop.
Nagios: check all smtp servers. If one of them is ok, return ok. Usage: check_smtp_all.sh host1 [host2 [...]]
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 | |
for TRG in $@ | |
do | |
STT=`/usr/local/nagios/libexec/check_smtp -H $TRG` | |
if echo $STT | grep -q "SMTP OK" | |
then | |
echo $STT | |
exit 0 | |
fi | |
done | |
echo $STT | |
exit 2 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment