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

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.
mguthrie
Posts: 4380
Joined: Mon Jun 14, 2010 10:21 am

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

Post by mguthrie »

Can you verify that "check_external_commands"is enabled in the main nagios.cfg file?

Also, try restarting nagios so it recreates the command pipe. That'll make sure it didn't get messed up somehow.
ians
Posts: 7
Joined: Wed Jan 18, 2012 1:27 pm

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

Post by ians »

OK, I've been digging through the source code a bit to see if I can get any more ideas. I searched for the error string I was seeing and found this snippet in cmd.c, line 1833:

Code: Select all

else if(authorized == FALSE) {
		if(content_type == WML_CONTENT)
			printf("<p>Error: You're not authorized to commit that command!</p>\n");
		else {
			printf("<P><DIV CLASS='errorMessage'>Sorry, but you are not authorized to commit the specified command.</DIV></P>\n");
			printf("<P><DIV CLASS='errorDescription'>Read the section of the documentation that deals with authentication and authorization in the CGIs for more information.<BR><BR>\n");
			printf("<A HREF='javascript:window.history.go(-2)'>Return from whence you came</A></DIV></P>\n");
			}
		}
Authentication for the command I was trying to execute (in this case, scheduling host downtime) is referenced here in line 1673:

Code: Select all

temp_host = find_host(host_name);
			if(is_authorized_for_host_commands(temp_host, &current_authdata) == TRUE)
				authorized = TRUE;
It appears that the current_authdata struct is recognized correctly, as the spot on the web form to schedule host downtime correctly populates the Author field with the appropriate username (nagiosadmin).

I have tried changing cgi.cfg to use * in place of nagiosadmin in all of the authorized_for_* statements, and I still saw the permissions error.

I'm not sure how authorized is getting set to FALSE, but that seems to be the core of my problem.
mguthrie
Posts: 4380
Joined: Mon Jun 14, 2010 10:21 am

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

Post by mguthrie »

When you access the web interface, does it say you're logged in as 'nagiosadmin', or logged in as '?????'
ians
Posts: 7
Joined: Wed Jan 18, 2012 1:27 pm

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

Post by ians »

It says:
Current Network Status
Last Updated: Tue Jan 24 10:26:30 PST 2012
Updated every 90 seconds
Nagios® Core™ 3.2.3 - http://www.nagios.org
Logged in as nagiosadmin
Locked