Nagios - It appears as though you do not have permission

I recently setup nagios on a rhel4 box. I read through the configuartion information and have the server running and monitoring 6 hosts (simple ping checks only.) When I access the web interface I am prompted to enter user name and password and it lets me login and view the pages.

The strange behavior happens occasionaly where I will navigate to a page and it will give me the:

It appears as though you do not have permission…

Error message however if I refresh the page the information will eventually display. It seems to be somewhat sporadic on whether or not it will display the host detail (or service detail, it really happens on every page.) On the Tactical Overview page when this is happening it will display the page but there wont be any hosts listed as up OR down.

Any ideas?

It sounds like you used the restart nagios command. Never use restart.
So, do this:
/etc/rc.d/init.d/nagios stop
ps -ef|grep nagios
kill all that remain
make sure they are all dead.
ps -ef|grep nagios
When you are sure, start nagios again.
/etc/rc.d/init.d/nagios start

In other words, you have more than one parent nagios process running.

I did stop nagios using the stop command. Thanks for the quick response. I killed off all of the nagios process and restarted, things look good now.

Thanks.

I’m having this same problem on a FreeBSD 6.2 machine where occasionally, I’d get the “It appears you do not have permission” message. Clicking refresh a few times gets rid of it.

Prior to redoing all my cfgs from scratch, a similar problem occurred where I could only see the localhost and no the 15 hosts that I had setup.

I’ve tried stop as well as rebooting the machine without success.

The output from a ps -ax | grep nagios only shows one instance unless any of the check_plugins are running, in which case there are two (parent and child?).

[root] /var/spool/nagios>ps -ax | grep nagios
88181 ?? SsJ 0:00.81 /usr/local/bin/nagios -d /usr/local/etc/nagios/nagios.cfg
90425 p3 R+J 0:00.00 grep nagios

Any help would be greatly appreciated.

Okay, figured it out. It’s a BSD Jail that I’m running nagios out of. Seems like somehow a nagios process escaped the confinds of the jail before or after the jail restart process.

Looks good now.

If you’re having this problem, also consider running /usr/local/nagios/bin/nagios -v <main_config_file> which will check for errors in your config files. In my case timeperiods.cfg was the problem, not cgi.cfg, as the error message suggests.