Use at your own risk... \"Installation\" Copy the send_gmail.py into Nagios\' libexec directory, and make the following changes to the commands.cfg file. Note, your installation may vary. See python script for a bit more documentation. I\'m interested in any comments or improvements that you have for this script. ---start of commands.cfg changes--- #old method # \'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\" | /usr/bin/mail -s \"** $NOTIFICATIONTYPE$ Host Alert: $HOSTNAME$ is $HOSTSTATE$ **\" $CONTACTEMAIL$ # } #old method # \'notify-service-by-email\' command definition #define command{ # command_name notify-service-by-email # command_line /usr/bin/printf \"%b\" \"***** Nagios *****\\n\\nNotification Type: $NOTIFICATIONTYPE$\\n\\nService: $SERVICEDESC$\\nHost: $HOSTALIAS$\\nAddress: $HOSTADDRESS$\\nState: $SERVICESTATE$\\n\\nDate/Time: $LONGDATETIME$\\n\\nAdditional Info:\\n\\n$SERVICEOUTPUT$\" | /usr/bin/mail -s \"** $NOTIFICATIONTYPE$ Service Alert: $HOSTALIAS$/$SERVICEDESC$ is $SERVICESTATE$ **\" $CONTACTEMAIL$ # } #notify host via gmail using python script. \\nnn will insert return, use for body of mssg define command{ command_name notify-host-by-email command_line /usr/bin/python /usr/local/nagios/libexec/send_gmail.py -a $CONTACTEMAIL$ -b \"***** Nagios *****\\nnn\\nnnNotification Type: $NOTIFICATIONTYPE$\\nnnHost: $HOSTNAME$\\nnnState: $HOSTSTATE$\\nnnAddress: $HOSTADDRESS$\\nnnInfo: $HOSTOUTPUT$\\nnnDate/Time: $LONGDATETIME$\" -s \"** $NOTIFICATIONTYPE$ Host Alert: $HOSTNAME$ is $HOSTSTATE$ **\" } #notify service via gmail using python script. \\nnn will insert return, use for body of mssg define command{ command_name notify-service-by-email command_line /usr/bin/python /usr/local/nagios/libexec/send_gmail.py -a $CONTACTEMAIL$ -b \"***** Nagios *****\\nnn\\nnnNotification Type: $NOTIFICATIONTYPE$\\nnnService: $SERVICEDESC$\\nnnHost: $HOSTALIAS$\\nnnAddress: $HOSTADDRESS$\\nnnState: $SERVICESTATE$\\nnnDate/Time: $LONGDATETIME$\\nnnAdditional Info: $SERVICEOUTPUT$\" -s \"** $NOTIFICATIONTYPE$ Service Alert: $HOSTALIAS$/$SERVICEDESC$ is $SERVICESTATE$ **\" } ---end of commands.cfg changes---