Page 1 of 1

Sorry, but you are not authorized to commit the specified co

Posted: Fri Mar 08, 2013 10:02 am
I've setup and installed the Nagios Server. Its up and running and monitoring the localhost.

I have a server that requires monitoring but is behind a firewall so I've setup the Nagios Passive Agent.

The agent is submitting various updates to the Nagios server, but not successfully.

I've cut and pasted the (get) URL it is attempting and pasted it directly into a browser - which looks something:

Code: Select all

http://myserver.com/nagios/cgi-bin/cmd.cgi?cmd_typ=30&cmd_mod=2&host=serverBehindFirewall&service=chk_disk_free_mb&plugin_state=2&plugin_output=+%2F+238829.28+MB+free+%2Fdev+8008.6914+MB+free+%2Fboot+191.20312+MB+free&performance_data=+%2F%3D238829.28MB%3B5000.0%3B1000.0%3B%3B+%2Fdev%3D8008.6914MB%3B5000.0%3B1000.0%3B%3B+%2Fboot%3D191.20312MB%3B5000.0%3B1000.0%3B%3B&btnSubmit=Commit
The web page response is

Code: Select all

External Command Interface
Last Updated: Fri Mar 8 14:28:44 UTC 2013
NagiosĀ® Coreā„¢ 3.5.0rc1 - www.nagios.org
Logged in as nagiosadmin
		
Sorry, but you are not authorized to commit the specified command.

Read the section of the documentation that deals with authentication and authorization in the CGIs for more information.

Return from whence you came
Tail'ing the /usr/local/nagios/var/nagios.log log file shows up nothing, which leaves me to believe the requests are not getting as far as the nagios server.

I've tried following various forums/threads to get to the bottom of this. All the defaults in the installation have been used

As I try to get to the bottom of this, I'm wondering am I looking in the wrong log files - is there someplace else I should be looking to try and idenfity the problem.

Any help appreciated.

Re: Sorry, but you are not authorized to commit the specifie

Posted: Fri Mar 08, 2013 11:50 am
by abrist
What are the permissions on the following files/directories?

Code: Select all

ls -la /usr/local/nagios/var/rw/nagios.cmd
ls -la /usr/local/nagios/var/rw/

Re: Sorry, but you are not authorized to commit the specifie

Posted: Fri Mar 08, 2013 11:57 am
The permissions are as follows

Code: Select all

# ls -la /usr/local/nagios/var/rw/nagios.cmd
prw-rw---- 1 nagios nagcmd 0 2013-03-08 14:21 /usr/local/nagios/var/rw/nagios.cmd
# ls -la /usr/local/nagios/var/rw/
total 8
drwxrwsr-x 2 nagios nagcmd 4096 2013-03-08 14:21 .
drwxrwxr-x 5 nagios nagios 4096 2013-03-08 16:52 ..
prw-rw---- 1 nagios nagcmd    0 2013-03-08 14:21 nagios.cmd
Also in /etc/group I have

Code: Select all

nagcmd:x:1008:www-data,nagios

Re: Sorry, but you are not authorized to commit the specifie

Posted: Fri Mar 08, 2013 12:51 pm
by abrist
I assume www-data is your apache user?

Re: Sorry, but you are not authorized to commit the specifie

Posted: Sat Mar 09, 2013 7:13 am
Yep, indeed

Code: Select all

www-data 12153  1409  0 Mar08 ?        00:00:00 /usr/sbin/apache2 -k start
www-data 13016  1409  0 Mar08 ?        00:00:00 /usr/sbin/apache2 -k start
www-data 17127  1409  0 Mar08 ?        00:00:00 /usr/sbin/apache2 -k start
www-data 17129  1409  0 Mar08 ?        00:00:00 /usr/sbin/apache2 -k start
www-data 17686  1409  0 Mar07 ?        00:00:00 /usr/sbin/apache2 -k start
www-data 19243  1409  0 Mar08 ?        00:00:00 /usr/sbin/apache2 -k start
www-data 20482  1409  0 Mar07 ?        00:00:00 /usr/sbin/apache2 -k start
I'm well used to debugging software. Is it possible to enable log file debugging to see if I can trace the problem?

Re: Sorry, but you are not authorized to commit the specifie

Posted: Mon Mar 11, 2013 10:33 am
by abrist
That looks alright. Could you post your cgi.ini and your nagios apache vhost file in code wraps?

Re: Sorry, but you are not authorized to commit the specifie

Posted: Wed Jul 02, 2014 2:33 pm
by grafton
Sorry to necro, but recently ran into this issue.

I was fortunate enough to keep backups of my nagios/etc folder every time I pushed a configuration change to the nagios servers (we have many...) and found that the host name IS case sensitive and will throw this silly Permissions error if the desired host isn't found. EG

Code: Select all

http://nagiosadmin:[email protected]/nagios/cgi-bin/cmd.cgi?cmd_typ=55&cmd_mod=2&host=SERVERNAME.DOMAIN.COM&com_author=nagiosadmin&com_data=Scheduled%20Maintenance%20requested%20by%20joel&trigger=N/A&start_time=07-02-2014%2008:57:13&end_time=07-02-2014%2010:57:13&fixed=1&hours=2&minutes=0&childoptions=0
Where SERVERNAME.DOMAIN.COM is definitely case sensitive. This was an oversight on my part that resulted in that same permissions error. Hope this helps future Nagiosers!

Re: Sorry, but you are not authorized to commit the specifie

Posted: Thu Jul 03, 2014 11:11 am
by slansing
Awesome, thank's for stopping by to add this in!