I'm running Nagios 4.1.1 on a Raspberry Pi and when i just changed some config files and ran "service nagios restart" i'm now getting this error below. The resource.cfg file DOES exist so i'm not sure why nagios.cfg can't open it.
root@raspberrypi:/usr/local/nagios/etc/objects# service nagios status -l
● nagios.service - Nagios
Loaded: loaded (/etc/systemd/system/nagios.service; enabled)
Active: failed (Result: exit-code) since Mon 2017-03-13 03:53:37 UTC; 50s ago
Process: 20876 ExecStart=/usr/local/nagios/bin/nagios /usr/local/nagios/etc/nagios.cfg (code=exited, status=1/FAILURE)
Main PID: 20876 (code=exited, status=1/FAILURE)
Mar 13 03:53:37 raspberrypi nagios[20876]: Copyright (c) 2009-present Nagios Core Development Team and Community Contributors
Mar 13 03:53:37 raspberrypi nagios[20876]: Copyright (c) 1999-2009 Ethan Galstad
Mar 13 03:53:37 raspberrypi nagios[20876]: Last Modified: 08-19-2015
Mar 13 03:53:37 raspberrypi nagios[20876]: License: GPL
Mar 13 03:53:37 raspberrypi nagios[20876]: Website: https://www.nagios.org
Mar 13 03:53:37 raspberrypi nagios[20876]: Error: Cannot open resource file '/usr/local/nagios/etc/resource.cfg' for reading!
Mar 13 03:53:37 raspberrypi nagios[20876]: Error in configuration file '/usr/local/nagios/etc/nagios.cfg' - Line 1384 (NULL)
Mar 13 03:53:37 raspberrypi nagios[20876]: Error: Failed to process config file '/usr/local/nagios/etc/nagios.cfg'. Aborting
Mar 13 03:53:37 raspberrypi systemd[1]: nagios.service: main process exited, code=exited, status=1/FAILURE
Mar 13 03:53:37 raspberrypi systemd[1]: Unit nagios.service entered failed state.
I need ideas on how to fix it.
Cannot open resource file
Re: Cannot open resource file
It could be that the permissions for that file was changed and the Nagios process cannot read it.
Try running the following to reset the permissions and see if that fixes the issue.
Try running the following to reset the permissions and see if that fixes the issue.
Code: Select all
chown nagios.nagios /usr/local/nagios/etc/resource.cfg
chmod 664 /usr/local/nagios/etc/resource.cfg
Be sure to check out our Knowledgebase for helpful articles and solutions!
Re: Cannot open resource file
Thanks for the update. Are we okay closing the thread?
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.