Page 1 of 2
Nagios CORE commands failing from XI web interface
Posted: Mon Jul 08, 2024 7:56 pm
by BenCowan
RHEL9 w/Nagios XI version 2024R1.1.4
I upgraded last week but just noticed that I was unable to issue commands via the web interface. For example Home->Tactical Overview->Notifications I' receive errors attempting to ENABLE/DISABLE anything. The following error was prevalent in the logs so I commented out a block of code (lines 315 to 320) and now it's working, however, I have no idea what I may have broken by doing this.
Mon, 08 Jul 2024 17:32:01 -0700 PROCESSED 0 COMMANDS
PHP Warning: Undefined array key "REQUEST_METHOD" in /app/nagios/nagiosxi/html/includes/utils.inc.php on line 315
............................................................PHP Warning: Undefined array key "REQUEST_METHOD" in /app/nagios/nagiosxi/html/includes/utils.inc.php on line 315
Re: Nagios CORE commands failing from XI web interface
Posted: Tue Jul 09, 2024 9:18 am
by sgardil
BenCowan wrote: ↑Mon Jul 08, 2024 7:56 pm
RHEL9 w/Nagios XI version 2024R1.1.4
I upgraded last week but just noticed that I was unable to issue commands via the web interface. For example Home->Tactical Overview->Notifications I' receive errors attempting to ENABLE/DISABLE anything. The following error was prevalent in the logs so I commented out a block of code (lines 315 to 320) and now it's working, however, I have no idea what I may have broken by doing this.
Mon, 08 Jul 2024 17:32:01 -0700 PROCESSED 0 COMMANDS
PHP Warning: Undefined array key "REQUEST_METHOD" in /app/nagios/nagiosxi/html/includes/utils.inc.php on line 315
............................................................PHP Warning: Undefined array key "REQUEST_METHOD" in /app/nagios/nagiosxi/html/includes/utils.inc.php on line 315
We use grab_request_vars in many locations so its best to not comment out this code. I'm not sure what your line 315 looks like but it seems like there isn't a guard for if that array key exists. If you want to get rid of the warning you mentioned above and you feel fine updating the code you can change line 315 to this:
Code: Select all
if (array_key_exists('REQUEST_METHOD', $_SERVER) && $_SERVER['REQUEST_METHOD'] == "PUT") {
Let us know if this fixes your issue.
Re: Nagios CORE commands failing from XI web interface
Posted: Tue Jul 09, 2024 11:41 am
by BenCowan
That worked great. Thanks. Will that alternate code be in future upgrades?
Re: Nagios CORE commands failing from XI web interface
Posted: Wed Jul 10, 2024 12:02 pm
by bbahn
@BenCowan,
Yes, this change will be included in future updates.
Re: Nagios CORE commands failing from XI web interface
Posted: Wed Jul 10, 2024 12:50 pm
by BenCowan
Excellent.
Re: Nagios CORE commands failing from XI web interface
Posted: Tue Sep 17, 2024 10:01 pm
by rosydam
sgardil wrote: ↑Tue Jul 09, 2024 9:18 am
BenCowan wrote: ↑Mon Jul 08, 2024 7:56 pm
RHEL9 w/Nagios XI version 2024R1.1.4
Incredibox game
I upgraded last week but just noticed that I was unable to issue commands via the web interface. For example Home->Tactical Overview->Notifications I' receive errors attempting to ENABLE/DISABLE anything. The following error was prevalent in the logs so I commented out a block of code (lines 315 to 320) and now it's working, however, I have no idea what I may have broken by doing this.
Mon, 08 Jul 2024 17:32:01 -0700 PROCESSED 0 COMMANDS
PHP Warning: Undefined array key "REQUEST_METHOD" in /app/nagios/nagiosxi/html/includes/utils.inc.php on line 315
............................................................PHP Warning: Undefined array key "REQUEST_METHOD" in /app/nagios/nagiosxi/html/includes/utils.inc.php on line 315
We use grab_request_vars in a many locations so its best to not comment out this code. I'm not sure what your line 315 looks like but it seems like there isn't a guard for if that array key exists. If you want to get rid of the warning you mentioned above and you feel fine updating the code you can change line 315 to this:
Code: Select all
if (array_key_exists('REQUEST_METHOD', $_SERVER) && $_SERVER['REQUEST_METHOD'] == "PUT") {
Let us know if this fixes your issue.
Re: Nagios CORE commands failing from XI web interface
Posted: Wed Sep 18, 2024 9:16 am
by sgardil
Hey
@rosydam
I saw you quoted the response above. Are you still having similar issues?
Re: Nagios CORE commands failing from XI web interface
Posted: Tue Dec 17, 2024 3:31 am
by Andreaa23
If Nagios CORE commands are failing when executed through the Nagios XI web interface, but work via the command line, it’s often related to permissions, configuration issues, or web interface settings.
incredibox sprunki
Re: Nagios CORE commands failing from XI web interface
Posted: Tue Jul 08, 2025 11:07 am
by cenat
That fix using array_key_exists really helped smooth things out,
nulls brawl apk I had almost the same issue after the update. It’s a relief knowing the patch is coming in future releases. Saves a lot of time digging through code just to keep basic functions working.
Re: Nagios CORE commands failing from XI web interface
Posted: Wed Jul 09, 2025 12:26 am
by kg2857
When running commands via the CCM they run as the apache user. When run from the shell, they run as the current user. When run via x they're x user. Test using valid test criteria.