Your SlideShare is downloading. ×

Notifications using isp smtp server with authentication

383

Published on

Notifications using isp smtp server with authentication in nagios

Notifications using isp smtp server with authentication in nagios

Published in: Education
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
383
On Slideshare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
1
Comments
0
Likes
0
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

  • 1. Notifications using ISP SMTP server with Authentication Download from http://caspian.dotconf.net/menu/Software/SendEmail. Extract the file and copy the sendEmail into /usr/local/bin. cp /root/sendEmail-v1.56/sendEmail /usr/local/bin/ chmod +x /usr/local/bin/sendEmail. Now the setup and customization of Nagios. #vim /usr/local/nagios/etc/resource.cfg $USER5$=192.168.0.1 $USER6$=pawan@prg.net $USER7$=mail@1234 #vim /usr/local/nagios/etc/objects/commands.cfg define command{ command_name notify-host-by-email command_line /usr/bin/printf "%b" "***** Nagios *****nnNotification Type: $NOTIFICATIONTYPE$nHost: $HOSTNAME$nState: $HOSTSTATE$nAddress: $HOSTADDRESS$nInfo: $HOSTOUTPUT$nnDate/Time: $LONGDATETIME$n" | /usr/local/bin/sendEmail -s $USER7$ -xu $USER9$ -xp $USER10$ -t $CONTACTEMAIL$ -f $USER5$ -l /var/log/sendEmail -u "** $NOTIFICATIONTYPE$ Host Alert: $HOSTNAME$ is $HOSTSTATE$ **" -m "***** Nagios *****nnNotification Type: $NOTIFICATIONTYPE$nHost: $HOSTNAME$nState: $HOSTSTATE$nAddress: $HOSTADDRESS$nInfo: $HOSTOUTPUT$nnDate/Time: $LONGDATETIME$n" } } define command{ command_name notify-service-by-email command_line /usr/bin/printf "%b" "***** Nagios *****nnNotification Type: $NOTIFICATIONTYPE$nnService: $SERVICEDESC$nHost: $HOSTALIAS$nAddress: $HOSTADDRESS$nState: $SERVICESTATE$nnDate/Time: $LONGDATETIME$nnAdditional Info:nn$SERVICEOUTPUT$" | /usr/local/bin/sendEmail -s $USER7$ -xu $USER9$ -xp $USER10$ -t $CONTACTEMAIL$ -f $USER5$ -l /var/log/sendEmail -u "** $NOTIFICATIONTYPE$ Service Alert: $HOSTALIAS$/$SERVICEDESC$ is $SERVICESTATE$ **" -m "***** Nagios *****nnNotification Type: $NOTIFICATIONTYPE$nnService: $SERVICEDESC$nHost: $HOSTALIAS$nAddress: $HOSTADDRESS$nState: $SERVICESTATE$nnDate/Time: $LONGDATETIME$nnAdditional Info:nn$SERVICEOUTPUT$" } } #touch /var/log/sendEmail #chown nagios:nagios /var/log/sendEmail #chmod 666 /var/log/sendEmail # tail -f /var/log/sendEmail Feb 25 16:13:56 monitoring sendEmail[17711]: Email was sent successfully! From: <pkumar2@saigun.com> To: <test@prg.net> <ayadav@prg.net> <pkumar2@prg.net> Subject: [** RECOVERY Service Alert: CentOS 6/HTTP is OK **] Server: [192.168.0.1:25] P@W@n Kumar

×