Page 1 of 1

Fetchmail

Posted: Thu Dec 02, 2021 10:12 am
by vornado
CentOS Linux release 7.9.2009 (Core)

Linux c210enag01.vornadort.com 3.10.0-1160.49.1.el7.x86_64 #1 SMP Tue Nov 30 15:51:32 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux

Nagios verion 5.8.7

===

Good morning.

Our passive checks have not been updating, possibly since we updated to 5.8.7. With 'systemctl status nagios', I'm seeing this error:

Error: Got check result for service 'Cron <nagios@c210enag01> /bin/fetchmail -s' on host 'localhost'. Unable to find service

On this server, fetchmail is in /usr/bin, not /bin. I edited the crontab:

crontab -u nagios -e; add /usr/ to get:

*/5 * * * * /usr/bin/fetchmail -s

now I get the error with the new location:

Error: Got check result for service 'Cron <nagios@c210enag01> /usr/bin/fetchmail -s' on host 'localhost'. Unable to find service

How do I fix this? Any assistance would truly be appreciated.

ADDITIONAL INFO

When I run fetchmail manually, I get this:

fetchmail: Connection errors for this poll:
name 0: connection to localhost:imap [::1/143] failed: Connection refused.
name 1: connection to localhost:imap [127.0.0.1/143] failed: Connection refused.
IMAP connection to localhost failed: Connection refused
fetchmail: Connection errors for this poll:
name 0: connection to localhost:pop3 [::1/110] failed: Connection refused.
name 1: connection to localhost:pop3 [127.0.0.1/110] failed: Connection refused.
POP3 connection to localhost failed: Connection refused
fetchmail: Query status=2 (SOCKET)

Thanks and best regards, Steve

Re: Fetchmail

Posted: Thu Dec 02, 2021 10:27 am
by dchurch
The 'fetchmail' package isn't installed or used in Nagios XI.

Fetchmail is for downloading mail from remote IMAP and POP3 servers and storing it in a local mailbox. I'm not sure what function that would even have on a Nagios XI monitoring machine; Nagios XI sends emails, but fetchmail doesn't do that.

That crontab entry must have been added manually after the installation of Nagios XI. By default running crontab -u nagios -l after a default install shows no crontab for nagios.

I'd inquire who made that crontab entry and why, but in the mean time you can comment it out or remove it from the file:

1. Run "crontab -u nagios -e"
2. Find the line "*/5 * * * * /usr/bin/fetchmail -s" and replace it with

Code: Select all

#*/5 * * * * /usr/bin/fetchmail -s
3. Save and exit the file.

Re: Fetchmail

Posted: Thu Dec 02, 2021 10:43 am
by vornado
Thanks for your quick reply. Fetchmail is used in processing our passive service checks. I'll contact the person who set this up.

Steve

Re: Fetchmail

Posted: Fri Dec 03, 2021 10:56 am
by benjaminsmith
Thanks for your quick reply. Fetchmail is used in processing our passive service checks. I'll contact the person who set this up
Thanks, Steve. Let us know if you'd like us to close this topic out.

--Benjamin

Re: Fetchmail

Posted: Mon Dec 06, 2021 12:15 pm
by vornado
Hi Benjamin -- you may close the topic.