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

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
jim@mbirr.com
Posts: 3
Joined: Fri Mar 08, 2013 9:12 am

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

Post by jim@mbirr.com »

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.
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

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

Post 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/
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
jim@mbirr.com
Posts: 3
Joined: Fri Mar 08, 2013 9:12 am

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

Post by jim@mbirr.com »

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
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

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

Post by abrist »

I assume www-data is your apache user?
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
jim@mbirr.com
Posts: 3
Joined: Fri Mar 08, 2013 9:12 am

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

Post by jim@mbirr.com »

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?
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

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

Post by abrist »

That looks alright. Could you post your cgi.ini and your nagios apache vhost file in code wraps?
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
grafton
Posts: 7
Joined: Wed Jun 12, 2013 8:33 pm

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

Post 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:password@nagios.mybiz.com/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!
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

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

Post by slansing »

Awesome, thank's for stopping by to add this in!
Locked