Open Source Monitoring solutions: ICINGA (Nagios) Email Notification

Source: Internet
Author: User
Tags icinga

[[email protected] ~]# tar jxvf msmtp-1.4.30.tar.bz2[[email protected] ~]#  cd msmtp-1.4.30cd msmtp-1.4.30[[email protected] msmtp-1.4.30]# ./configure  --prefix=/usr/local/msmtp[[email protected] msmtp-1.4.30]# make[[email protected]  msmtp-1.4.30]# make install[[email protected] ~]# mkdir /usr/local/msmtp/ log[[email protected] ~]# mkdir /usr/local/msmtp/etc[[email protected] ~]#  cd /usr/local/msmtp/etc[[email protected] etc]# vi msmtprcdefaultslogfile /usr/ local/msmtp/log/msmtp.logaccount 263host smtp.263.netfrom [email protected]auth  Loginuser [email protected]password abcd.1234account default:263[[email protected]  ~]# yum install -y mutt[[email protected] ~]# vi /etc/muttrcset  sendmail= "/usr/local/msMtp/bin/msmtp "set from=" [email protected] "set realname=" Nagios "set use_from=yesset  charset= "Utf-8" set send_charset= "Us-ascii:gb2312:utf-8" set locale= "ZH_CN" [[email protected]  ~]# echo  message content  | mutt -s  Message title  [email protected][[email  protected] ~]# cd /usr/local/msmtp/log[[email protected] log]# cat  msmtp.log aug 09 15:57:34 host=smtp.263.net tls=off auth=on [email  protected] [email protected] [email protected] mailsize=342 smtpstatus=250  smtpmsg= ' 250 2.0.0 ok: queued as 7b6d439f '  exitcode=ex_ok[[email protected]  ~]# cd /usr/local/icinga/etc/objects[[email protected] objects]# vi  commands.cfg define command{       command_name     notify-host-by-email       command_line    /usr/bin/printf  "%b"   "\nHost:   $HOSTNAME $\n\nstate:  $HOSTSTATE $\n\naddress:  $HOSTADDRESS $\n\ninfo:  $HOSTOUTPUT $\n "  | mutt -s  "host alert:  $HOSTNAME $ is  $HOSTSTATE $"   $CONTACTEMAIL $                }define command{         command_name    notify-service-by-email         command_line    /usr/bin/printf  "%b"   "\nservice:  $SERVICEDESC $\n\nhost:  $HOSTNAME $\n\nstate:  $SERVICESTATE $\n\naddress: $ hostaddress$\n\ninfo:  $SERVICEOUTPUT $\n "  | mutt -s " service alert: $ hostname$/$SERVICEDESC $ is  $SERVICESTATE $ "  $CONTACTEMAIL $               }               [[email protected] objects]# vi contacts.cfg define contact{         contact_name                     icingaadmin              ; Short name of user         use                              generic-contact          ; Inherit default values from  generic-contact template  (Defined above)         alias                             Icinga Admin            ;  Full name of user        email                             [email protected]       ;  <<***** CHANGE THIS TO YOUR EMAIL ADDRESS ******         }


Open Source Monitoring solutions: ICINGA (Nagios) Email Notification

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.