Score:0

What is needed for nagios to send emails?

ng flag

i have installed nagios4 from ubuntu repository packages in a kvm guest running ubuntu server 20.04. i am able to invoke sendmail manually and can send emails. However nagios isn't sending any emails. /var/log/mail.log only contains entries for my manual invocations. /var/log/nagios4/nagios.log contains numerous entries suggesting nagios is trying to send email:

[1627148632] SERVICE NOTIFICATION: me;localhost;/dev/shm;UNKNOWN;notify-service-by-email;DISK UNKNOWN - free space:
[1627148662] wproc: Core Worker 28377: job 11764 (pid=211002) timed out. Killing it
[1627148663] wproc: NOTIFY job 11764 from worker Core Worker 28377 timed out after 31.05s
[1627148663] wproc:   host=localhost; service=/dev/shm; contact=me
[1627148663] wproc:   early_timeout=1; exited_ok=0; wait_status=0; error_code=62;
[1627148663] Warning: Notifying contact 'me' of service '/dev/shm' on host 'localhost' by command '/usr/bin/printf "%b" "***** Nagios *****\n\nNotification Type: PROBLEM\n\nService: /dev/shm\nHost: localhost\nAddress: 127.0.0* .1\nState: UNKNOWN\n\nDate/Time: Sat Jul 24 12:43:52 CDT 2021\n\nAdditional Info:\n\nDISK UNKNOWN - free space:\n"|/usr/bin/mail -s"** localhost /dev/shm UNKNOWN **" [email protected]' timed out after 0.00 seconds

When i issue the command shown in the last line above the email gets sent. But what's up with nagios4? Why isn't it sending any emails?

Additional info: sendmail is apparently taking or waiting 60 seconds to send each email. And apparently nagios is timing out after 30 seconds. What's needed to fix either of these?

Score:0
ng flag

Tho the question looks fairly different the answer is the same as

http://digitalocean.com/community/questions/sendmail-is-slow-to-send-mail

in my case it's working fine after changing these lines in /etc/hosts:

127.0.0.1 localhost
127.0.1.1 myserver

to

127.0.0.1 myserver localhost localhost.localdomain
127.0.1.1 myserver localhost localhost.localdomain
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.