Shell script - Error: Script returns no result

All questions related to installations, configurations and maintenance of Advanced Host Monitor (including additional tools such as RMA for Windows, RMA Manager, Web Servie, RCC).
Post Reply
jbarrellon
Posts: 23
Joined: Wed Oct 08, 2008 2:13 am

Shell script - Error: Script returns no result

Post by jbarrellon »

Hi,

I've got the following problem :

When running a shell script test, sometimes it works fine and sometimes it doesn't work and it displays this error : "Error: Script returns no result" (the error appears about once over two)

The very weird thing is that when I try running the script using the "Let's try" tab in script manager (with same RMA and parameters of course), it always works (I've tried many times).

The test is executed on a Windows Server 2003 R2 SP2 64 bits by a passive RMA v3.68
HostMonitor v8.54 is running on Windows Server 2003 R2 SP2

Timeout of the test is 15s (I tried with more but it didn't work either, anyway I don't think this is the problem since the result always appears quickly).
Timeout for the active agent is 120s

Below is the test model :

Method = ShellScript
;--- Common properties ---
;DestFolder = ROOT\Infogérance\HALLMARK-BRADFORD\oracle\LMPROD\
RMAgent = HALLMARK-BRADFORD.HMKDLMORE01
Title = LMPROD detect lock radio new
Comment = 884
RelatedURL =
ScheduleMode= Regular
Schedule = infogerance
Interval = 15
Alerts = mail test
ReverseAlert= No
UnknownIsBad= Yes
WarningIsBad= No
UseCommonLog= Yes
PrivLogMode = Default
CommLogMode = Default
;--- Test specific properties ---
Script = Scripts Oracle||Windows
Params = "C:\Program Files (x86)\RMA-Win\Scripts\LMPROD.detect_lock_radio_new.pl"
Timeout = 15
UseMacros = No

The alert profile "mail test" does nothing else than sending an email if status is Warning (which is not the case most of the time, and even if it's the case, this action works for other tests).

The shell script "Scripts Oracle||Windows" just launches an external perl script with the command (in field "Start cmd") "cmd /c perl %Params%", there is no script body. And like I said higher, it works any time when testing in script manager with same RMA and parameters.

If you want, I can provide the external script, however it is a perl script which is very specific to our application and database, and I don't think the problem comes from here since a local execution (on remote sever) always works (result is "Scriptres:ok:....") in about 0.2ms.

I hope I was clear enough (by the way, sorry for my bad english) and I didn't forget any useful information.

Thanks for your help
KS-Soft
Posts: 13012
Joined: Wed Apr 03, 2002 6:00 pm
Location: USA
Contact:

Post by KS-Soft »

I would suggest to add some exception handling to the script so HostMonitor will get result even if script execution fails. E.g. you may set Unknown status and show error description as test reply.
The very weird thing is that when I try running the script using the "Let's try" tab in script manager (with same RMA and parameters of course), it always works (I've tried many times)
May be you setup several test items using this script while script does not work correctly when several instances running at the same time?
The test is executed on a Windows Server 2003 R2 SP2 64 bits by a passive RMA v3.68
HostMonitor v8.54 is running on Windows Server 2003 R2 SP2
Its bad idea to use new HostMonitor and pretty old RMA, some tests may work incorrectly.
Please use all components from the same package (HostMonitor, RMA, RCC, Web Service, etc).

Regards
Alex
jbarrellon
Posts: 23
Joined: Wed Oct 08, 2008 2:13 am

Post by jbarrellon »

This morning I changed the script frequency so it now runs every 1 minute instead of 15s and I don't have the problem any more.
I'm going to let it run that way, even if it's just a workaround.
Its bad idea to use new HostMonitor and pretty old RMA, some tests may work incorrectly.
Please use all components from the same package (HostMonitor, RMA, RCC, Web Service, etc).
Thank you for the advice, I will update RMAs as soon as possible.

Regards
Julien
KS-Soft
Posts: 13012
Joined: Wed Apr 03, 2002 6:00 pm
Location: USA
Contact:

Post by KS-Soft »

This morning I changed the script frequency so it now runs every 1 minute instead of 15s and I don't have the problem any more
If you setup several test items using this script and script does not work correctly when several instances running at the same time (e.g. your script need exclusive access to some file or resource), you may put all test items related on this script into single folder and mark "Non-simultaneously test execution" option for the folder. Option located on Special page in Folder Properties dialog

Regards
Alex
jbarrellon
Posts: 23
Joined: Wed Oct 08, 2008 2:13 am

Post by jbarrellon »

Hello,

Unfortunately, the problem didn't completely disappear, it still occurs intermittently.
If you setup several test items using this script and script does not work correctly when several instances running at the same time (e.g. your script need exclusive access to some file or resource)
This is the only test item that is calling this script.


After several checkings and tests, I think that the problem comes from the remote server configuration. I tried several other shell script test items and each of them gives the same error from time to time but they are working with no error on other servers (same RMA/test configuration).


I'll let you know if I can figure out what's going wrong in the remote server configuration.

Regards
Julien
Post Reply