Problem Description:
1, the/nagioshome/var/nagios.log file shows that the message has been sent
2. The root user performs echo "Hello" |mutt-s "test" [email protected] to send normally
Su-nagios-c ' echo ' hello ' |mutt-s ' test ' [email protected]' can also be sent normally
3. Messages sent by Nagios runtime are not received
Solution Ideas:
The above can be explained that the MUTT+MSMTP program itself is not a problem, perhaps the reason or in Nagios, the specific reason can only be analyzed by the log, and Nagios.log and system
There is not much useful information in the log, so try to print out the relevant information yourself.
The MSMTP command parameter has a "-D" parameter, which can be used to output the debug information of the entire process.
Resolution process:
Modifying the/etc/mutt configuration file
Also modify the Nagios configuration file/nagioshome/etc/objects/commands.cfg and restart the Nagios service.
At this point, open the Nagios interface, send a custom message, and open/tmp/nagios.log to see the information. Here are the errors I encountered
The problem here is basically clear. Is the file does not write permission, the simplest way is of course to change the permissions, but, this is the root directory, in order to security does not recommend the root of the default permissions 550 to change to other, so, to start from the source of sent.
Modify the/etc/mutt configuration file and manually create the Sent.log file under/var/log/, give it 777 permissions or change the person to the Nagios user.
The problem has been resolved.
Finally, restore all the places that were modified for the test to complete the mail delivery.
Nagios MUTT+MSMTP received no alarm messages