[SOLVED] [nagios] send emails to gmail when services are down.
Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
[nagios] send emails to gmail when services are down.
Hello,
so as the title says.
these days i've been trying to send emails to my gmail account and it works now.
thanks to those who helped in my previous thread(: [http://www.linuxquestions.org/questi...ubuntu-823461/] much appreciated.
i'm now just short of one thing:
using postfix, how do i make nagios send notifications to my gmail account when any services go down?
these days i've been trying to send emails to my gmail account and it works now.
Great.
If you want to receive nagios notification just define your email id in contacts.cfg file
Code:
vi /usr/local/nagios/etc/object/contacts.cfg
define contact{
contact_name nagiosadmin
use generic-contact
alias Nagios Admin
email nagios@localhost <= enter your email id here
}
define contact{
contact_name nagiosadmin ; Short name of user
use generic-contact ; Inherit default values from generic-contact template (defined above)
alias Nagios Admin ; Full name of user
host_notifications_enabled 1
service_notifications_enabled 1
host_notification_period 24x7
service_notification_options w,u,c,r
host_notification_options d,u,r
service_notification_commands notify-service-by-email
host_notification_commands notify-host-by-email
email xanios@gmail.com ; email
}
[1280903305] Warning: Return code of 126 for check of service 'MYSQL' on host 'localhost' was out of bounds. Make sure the plugin you're trying to run actually exists.
[1280903305] Warning: Return code of 126 for check of service 'MYSQL' on host 'wins server 2003' was out of bounds. Make sure the plugin you're trying to run actually exists.
[1280903305] Warning: Return code of 127 for check of service 'SNMP' on host 'wins xp sp2' was out of bounds. Make sure the plugin you're trying to run actually exists.
[1280903305] SERVICE NOTIFICATION: nagiosadmin;wins server 2003;IMAP;CRITICAL;notify-service-by-email;Connection refused
[1280903318] Warning: The check of host 'ubuntu' looks like it was orphaned (results never came back). I'm scheduling an immediate check of the host...
[1280903318] Warning: Return code of 127 for check of service 'SNMP' on host 'ubuntu' was out of bounds. Make sure the plugin you're trying to run actually exists.
[1280903325] Warning: Return code of 127 for check of service 'SNMP' on host 'wins 7' was out of bounds. Make sure the plugin you're trying to run actually exists.
[1280903325] SERVICE ALERT: wins 7;SNMP;CRITICAL;SOFT;2;(Return code of 127 is out of bounds - plugin may be missing)
[1280903325] SERVICE ALERT: wins 7;IMAP;CRITICAL;SOFT;2;No route to host
[1280903325] SERVICE ALERT: wins 7;HTTP;CRITICAL;SOFT;2;No route to host
[1280903325] SERVICE ALERT: wins 7;FTP;CRITICAL;SOFT;2;No route to host
[1280903328] SERVICE ALERT: wins 7;HTTPS;WARNING;HARD;1;HTTP WARNING: HTTP/1.1 400 Bad Request - 513 bytes in 0.024 second response time
[1280903328] Warning: Return code of 127 for check of service 'SNMP' on host 'localhost' was out of bounds. Make sure the plugin you're trying to run actually exists.
[1280903335] Warning: Return code of 126 for check of service 'MYSQL' on host 'wins vista' was out of bounds. Make sure the plugin you're trying to run actually exists.
[1280903345] Warning: Return code of 126 for check of service 'MYSQL' on host 'wins xp sp2' was out of bounds. Make sure the plugin you're trying to run actually exists.
[1280903345] Warning: Return code of 127 for check of service 'SNMP' on host 'localhost' was out of bounds. Make sure the plugin you're trying to run actually exists.
[1280903345] Warning: Return code of 127 for check of service 'SNMP' on host 'wins server 2003' was out of bounds. Make sure the plugin you're trying to run actually exists.
[1280903345] Warning: Return code of 126 for check of service 'MYSQL' on host 'ubuntu' was out of bounds. Make sure the plugin you're trying to run actually exists.
[1280903345] Warning: Return code of 127 for check of service 'SNMP' on host 'wins vista' was out of bounds. Make sure the plugin you're trying to run actually exists.
[1280903348] Warning: Return code of 127 for check of service 'SNMP' on host 'wins xp sp2' was out of bounds. Make sure the plugin you're trying to run actually exists.
there isn't any log which "service-notification-sent via email"
it just basically shows the different services i'm monitoring for the different servers.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.