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.