Home Directory Plugins Operating Systems Linux Nagios Alerts via gmail and python

Search Exchange

Search All Sites

Nagios Live Webinars

Let our experts show you how Nagios can help your organization.

Contact Us

Phone: 1-888-NAGIOS-1
Email: sales@nagios.com


Remember Me

Directory Tree

Nagios Alerts via gmail and python

2 votes
send_gmail.pyScript Updated 2008.04.09
installation_notes.txtInstallation notes/instructions
Network Monitoring Software - Download Nagios XI
Log Management Software - Nagios Log Server - Download
Netflow Analysis Software - Nagios Network Analyzer - Download
A simple replacement for the standard Nagios email command. It consists of a Python script to send Nagios Alert Notifications (email) with Gmail using TLS.
Use at your own risk... See (installation_notes.txt) for instructions.
Updated 2008.04.09, corrected issue where script would not send to multiple addresses.
Reviews (1)
byfrankhe, April 24, 2012
But the installation note needs some modification, otherwise, the email subject/body will not be correct.

Modified version:

command_line /usr/bin/python /usr/lib64/nagios/plugins/send_gmail.py -a $CONTACTEMAIL$ -b "***** Nagios *****\nnn\nnnNotification Type: $NOTIFICATIONTYPE$\nnnHost: $HOSTNAME$\nnnState: $HOSTSTATE$\nnnAddress: $HOSTADDRESS$\nnnInfo: $HOSTOUTPUT$\nnnDate/Time: $LONGDATETIME$" -s "** Nagios $NOTIFICATIONTYPE$ Host Alert: $HOSTNAME$ is $HOSTSTATE$ **"

*) notify-service-by-email

command_line /usr/bin/python /usr/lib64/nagios/plugins/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 "** Nagios $NOTIFICATIONTYPE$ Service Alert: $HOSTALIAS$/$SERVICEDESC$ is $SERVICESTATE$ **"