Friday, June 22, 2012

Nagios issues, duh.

I went to go pull up the Nagios web interface yesterday and to my surprise received a "Error: Could not read object configuration data!". Troubleshooting here we come!

First things first, check the process
 # /etc/init.d/nagios status  
 nagios is stopped  

Not running? Odd. ok, start it up
 # /etc/init.d/nagios start  
 nagios is stopped  
 Configuration validation failed              [FAILED]  

 # /usr/bin/nagios -v /etc/nagios/nagios.cfg  
  Total Warnings: 0  
 Total Errors:  0  
 Things look okay - No serious problems were detected during the pre-flight check  

So, I checked the log files and they are all from past dates, including nothing from the last day or so.
 # cat /var/log/nagios/nagios.log | perl -pe 's/(\d+)/localtime($1)/e' | less  

Nifty perl script there to fix the dates, but it's not mine, just a web snippet.

 I was stumped. Then I had a thought, SELinux errors...
 # getenforce  

 # setenforce permissive 

and give it another shot,
 # /etc/init.d/nagios start  
 nagios is stopped  
 Starting nagios:                      [ OK ]  

As they say on Afrotechmods,

A lot of folks disable SELinux in their environments as it can get rather complicated. However, for this issue I was able to dig up this post regarding setting up a new type definition for Nagios, but haven't yet tried it myself.

No comments:

Post a Comment