Every hour I get an email from the server with the following cron error:

DBI connect('database=runtime;host=localhost','nagios',...) failed:  
 Access denied for user 'nagios'@'localhost' (using password: YES) at
  /usr/local/nagios/perl/lib/Ima/DBI.pm line 329

We do not actually use nagios on that server, so it is okay if it is not working. I would like to stop this cron job but I cannot find the cron file where it is rooted.

/etc/cron.hourly does not have it.
crontab -l does not show it.

The only place I could find this command was this file:


I'm not sure if I should manipulate this file however.

  • Did you take a look at /var/spool/cron? – quanta Oct 16 '11 at 14:29
  • @quanta , I checked it now and there is a file named nagios. I can see the relevant line within that file. I've commented it out. Let's see what happens. Would you like to write an answer to this question, so I can mark it in case it resolves the problem? – Haluk Oct 16 '11 at 15:34

I suspect that you have a cron job running as nagios user. So, take at look at /var/spool/cron or use crontab -l -u nagios command to check. If it exists and you don't want to use, just comment out or execute crontab -r -u nagios to remove.


Have you checked /etc/cron.d?

If you do not run Nagios on that host, editing the script is safe - as it would only affect Nagios.

  • Yes I've checked /etc/cron.d – Haluk Oct 16 '11 at 15:32
  • You should check all the files in /etc/cron.d/, you should check /etc/cron.hourly for symlinks, you should check /etc/crontab, and /var/spool/cron ... crontab -l lists /var/spool/cron/-contents for the current user ... it may be the nagios-user. – Kvisle Oct 16 '11 at 15:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.