Nagios - NagWin - Send notification with gmail

Posted by Attila Bujáki on Server Fault See other posts from Server Fault or by Attila Bujáki
Published on 2013-11-04T20:58:38Z Indexed on 2013/11/04 21:56 UTC
Read the original article Hit count: 450

I would like to send Nagios notifications using my gmail account.

I have already set up my hosts I want to monitor and services also.

What is the most simple way to accomplish this using NagWin on a Windows Server 2012 installation?

As far as I know I must change some of these configuration settings:

# '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" | /bin/blat - -to $CONTACTEMAIL$ -f nagios@localhost -subject "** $NOTIFICATIONTYPE$ Host Alert: $HOSTNAME$ is $HOSTSTATE$ **" -server ???
    }

# '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$\n" | /bin/blat - -to $CONTACTEMAIL$ -f nagios@localhost -subject "** $NOTIFICATIONTYPE$ Service Alert: $HOSTALIAS$/$SERVICEDESC$ is $SERVICESTATE$ **" -server ???
    }

What should I use for smtp server? Is it possible to directly send my notifications to the Gmail server?

© Server Fault or respective owner

Related posts about monitoring

Related posts about smtp