centos6.5 nagios-4.0.8 system comes with sendmail mail alarm settings

Source: Internet
Author: User

1. Installation related set-up

Yum Install Mailx sendmail*

Chkconfig SendMail on

Service SendMail Start

2. Test mail

echo "Hello World" | Mail [email protected]

3. Edit Command.cfg

# ' notify-host-by-email ' command definition

Define Command{

Command_nameNotify-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/mail-s "* * $NOTIFICATIONTYPE $ Host Alert: $HOSTNAME $ is $HOSTSTATE $ * *" $CONTACTEMAIL $

}


# ' notify-service-by-email ' command definition

Define Command{

Command_nameNotify-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/mail-s "* * $NOTIFICATIONTYPE $ Service Alert: $HOSTALIAS $/$SERVICEDESC $ is $SERVICESTATE $ * *" $CONTACTEMAIL $

}

4. Restart Nagios

Service Nagios Restart

5. PostScript

About the alarm send interval and so on set not to do detailed introduction

This article is from the "Linux related sharing" blog, make sure to keep this source http://2860664.blog.51cto.com/2850664/1561778

centos6.5 nagios-4.0.8 system comes with sendmail mail alarm settings

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.