Page 1 of 1

Webpage hangs when executing quick action auditing script

Posted: Wed Sep 17, 2014 12:28 pm
by WillemDH
Hello,

I've been creating a Powershell script that will start a complete audit on a server passed as parameter with a quick action. This script will output all it's information to a webpage I'm placing on the Windows server it is running at the moment. The auditing script takes some time to run (20 - 30 secs at the moment) and I noticed the Nagios XI webpage hangs while the script is running.

Is there any way to prevent the webpage from hanging while my Powershell auditing script is running?

(hopefully I will be able to put the script on the Nagios Exchange soon, it just needs a litle more polishing)

Grtz

Willem

Re: Webpage hangs when executing quick action auditing scrip

Posted: Wed Sep 17, 2014 12:46 pm
by Box293
How is the script on the XI box being run? From within XI in a component or dashlet or just at the command line?

Re: Webpage hangs when executing quick action auditing scrip

Posted: Wed Sep 17, 2014 2:12 pm
by WillemDH
With the quick action component Troy.

Re: Webpage hangs when executing quick action auditing scrip

Posted: Wed Sep 17, 2014 2:38 pm
by Box293
I know what you mean. I assume the Action Type is Command.

I've had a look at the code and I thinking that the pause is due to how the ajax request is being performed. The ajax request might be waiting for the full response to return before it loads the page.

Does a blank page open first and hang while waiting for the script to run, or does XI just hang and then the page is displayed once the script completes?

Re: Webpage hangs when executing quick action auditing scrip

Posted: Thu Sep 18, 2014 6:16 am
by WillemDH
Troy,

Something was changed in my actions component by Andy Brist in order to prevent the popup window from appearing. See http://support.nagios.com/forum/viewtop ... n&start=30 for some details. I can't immeditately remember what he changed.
So when I initiate a quick action, I do not see a popup window appear, but the Nagios XI webpage just hangs, meaning I can't click on any link or got any other Nagios XI webpage. As the auditing script runs about 30 seconds this is kind of annoying. I think the action is executed byt the httpd process which waits for the quick acton to finish. it would be nice if the quick action would run in a seperate process or something like that, but without popup window.

Grtz

Willem

Re: Webpage hangs when executing quick action auditing scrip

Posted: Thu Sep 18, 2014 10:09 am
by Box293
I'll follow this up with Andy and get back to you.

Can you also please create a zip of all the files in /usr/local/nagiosxi/html/includes/components/actions/ and PM/email them to me.

Re: Webpage hangs when executing quick action auditing scrip

Posted: Tue Sep 23, 2014 3:08 am
by WillemDH
Sent you the pm with the zipped actions folder Troy.

Grtz

Willem

Re: Webpage hangs when executing quick action auditing scrip

Posted: Tue Sep 23, 2014 5:16 pm
by tmcdonald
Let's do this for now. Go to Admin -> Manage Components and save a copy of your current Actions component, then install a fresh copy of our latest one (attached). See if the page still hangs with the default behavior, and we can work from there.

Re: Webpage hangs when executing quick action auditing scrip

Posted: Fri Oct 10, 2014 2:49 am
by WillemDH
Trevor, Troy,

Updated the ations component to latest version. I think the hanging webpage was caused byt the edit done in the actions component to prevent the webpage from popping up. It seems in the updated version, a new window is opened in another tab. We decided for now to leave it like that, as it means we can output data from the script to the webpage.

So this thread can be closed.

Grtz

Willem