Created
March 20, 2012 09:50
-
-
Save hashimotor/2133578 to your computer and use it in GitHub Desktop.
NagiosでGmailへ通知を飛ばす
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
# 'notify-host-by-email' command definition | |
define command{ | |
command_name notify-host-by-email | |
command_line /usr/bin/printf "%b" "***** Nagios *****\n\nNotification Type: $NOTIFICATIONTYPE$\nHost: $HOSTNAME$\nState: $HOSTSTATE$\nAddress: $HOSTADDRESS$\nInfo: $HOSTOUTPUT$\n\nDate/Time: $LONGDATETIME$\n" | env MAILRC=/dev/null from=nagiosadmin@www2203.sakura.ne.jp smtp-use-starttls= smtp=smtp://smtp.gmail.com:587 smtp-auth-user=`cat mail-address` smtp-auth-password=`cat password` smtp-auth=login /usr/bin/mail -s "** $NOTIFICATIONTYPE$ Host Alert: $HOSTNAME$ is $HOSTSTATE$ **" $CONTACTEMAIL$ | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment