We're getting the below error when trying to submit a command via the CGI interface. This worked at one point, but since it's not used a lot I'm not sure when it stopped working.
curl -u nagiosadmin:xxxxx -d "cmd_typ=68&cmd_mod=2&host=abc123&btnSubmit=Commit" http://123.45.67.89/nagios/cgi-bin/cmd.cgi
<P><DIV CLASS='errorMessage'>Sorry, but you are not authorized to commit the specified command.</DIV></P>
<P><DIV CLASS='errorDescription'>Read the section of the documentation that deals with authentication and authorization in the CGIs for more information.<BR><BR>
<A HREF='javascript:window.history.go(-2)'>Return from whence you came</A></DIV></P>
Moderator's Note: The profile has been removed from the public forum.
CGI access via command line stopped working
Re: CGI access via command line stopped working
Command 68 is used to disable active checks of all services in a hostgroup. In your command you have a host specified instead... Your command should look something like this:
curl -u nagiosadmin:xxxxx -d "cmd_typ=68&cmd_mod=2&hostgroup=<hostgroup name>&btnSubmit=Commit" http://123.45.67.89/nagios/cgi-bin/cmd.cgi
Be sure to check out our Knowledgebase for helpful articles and solutions!
Re: CGI access via command line stopped working
I copied the wrong command (thanks for the correction), but the same error occurs for a hostgroup.
curl -u nagiosadmin:xxxxxx -d "cmd_typ=68&cmd_mod=2&hostgroup=all-hosts&btnSubmit=Commit" http://12.345.67.89/nagios/cgi-bin/cmd.cgi
<P><DIV CLASS='errorMessage'>Sorry, but you are not authorized to commit the specified command.</DIV></P>
<P><DIV CLASS='errorDescription'>Read the section of the documentation that deals with authentication and authorization in the CGIs for more information.<BR><BR>
<A HREF='javascript:window.history.go(-2)'>Return from whence you came</A></DIV></P>
curl -u nagiosadmin:xxxxxx -d "cmd_typ=68&cmd_mod=2&hostgroup=all-hosts&btnSubmit=Commit" http://12.345.67.89/nagios/cgi-bin/cmd.cgi
<P><DIV CLASS='errorMessage'>Sorry, but you are not authorized to commit the specified command.</DIV></P>
<P><DIV CLASS='errorDescription'>Read the section of the documentation that deals with authentication and authorization in the CGIs for more information.<BR><BR>
<A HREF='javascript:window.history.go(-2)'>Return from whence you came</A></DIV></P>
Re: CGI access via command line stopped working
Is "all-hosts" a valid hostgroup? Is it activated? I have tested the command a numerous times, and it worked for me just fine.
Be sure to check out our Knowledgebase for helpful articles and solutions!
Re: CGI access via command line stopped working
Yes, all-hosts is a valid hostgroup and it's active. This is just one example as nothing is working via the CGI command interface.
Re: CGI access via command line stopped working
This can be closed as we're going to open a ticket for the issue. Thanks!!
Re: CGI access via command line stopped working
This is strange. What is the curl version that you are currently using?...nothing is working via the CGI command interface
Code: Select all
curl -VCode: Select all
curl --basic -u nagiosadmin:xxxxx -d "cmd_typ=68&cmd_mod=2&hostgroup=all-hosts&btnSubmit=Commit" http://123.45.67.89/nagios/cgi-bin/cmd.cgiCode: Select all
sestatusBe sure to check out our Knowledgebase for helpful articles and solutions!