How to handle Sendmail service configuration in Nagios alarm mail (1)

Source: Internet
Author: User

NagiosIt is a monitoring system and network application running in linux and unix environments. Since it is monitored, of course there is a warning event to be solved.SendmailFor more information about service configuration, see the following.

1. Check commands. cfg

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

Define command {

Command_name sort y-host-by-email

Command_line/usr/bin/printf "% B" "****** Nagios ***** \ n \ nNotification

Type: $ icationicationtype $ \ nHost: $ HOSTNAME $ \ nState: $ HOSTSTATE $ \ nAddress: $ HOSTA

DDRESS $ \ nInfo: $ HOSTOUTPUT $ \ n \ nDate/Time: $ LONGDATETIME $ \ n "|/bin/mail-s" ** $

Icationicationtype $ Host Alert: $ HOSTNAME $ is $ HOSTSTATE $ ** "$ CONTACTEMAIL $

}

# 'Your y-service-by-email 'command definition

Define command {

Command_name sort y-service-by-email

Command_line/usr/bin/printf "% B" "****** Nagios ***** \ n \ nNotification

Type: $ icationicationtype $ \ n \ nService: $ SERVICEDESC $ \ nHost: $ HOSTALIAS $ \ nAddress:

$ HOSTADDRESS $ \ nState: $ SERVICESTATE $ \ n \ nDate/Time: $ LONGDATETIME $ \ n \ nAdditional

Info: \ n $ SERVICEOUTPUT $ "|/bin/mail-s" ** $ icationicationtype $ Service Alert:

$ HOSTALIAS $/$ SERVICEDESC $ is $ SERVICESTATE $ ** "$ CONTACTEMAIL $

}

This is the correct command configuration, the most important of which is the command configuration after/bin/mail.

2. mqueue

[Root @ localhost mqueue] # pwd

/Var/spool/mqueue

[Root @ localhost mqueue] # ll

Total 8

-Rw ------- 1 root smmsp 8 Nov 18 20:54 dfmAICsFQj009878

-Rw ------- 1 root smmsp 901 Nov 18 running maicsfqj009878

[Root @ localhost mqueue] #

This directory stores the mail sending queue. If it is full, it will not only affect the running of the program, but sendmail is easy to die, so delete it if necessary.


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.