Shell Script Python Script Example

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
Gavin
Posts: 58
Joined: Thu Sep 24, 2009 8:44 am

Shell Script Python Script Example

Post by Gavin »

Hello,

I currently have a simple Python script that I want to output a result to hostmonitor. I have start cmd as

cmd /c cscript /B /E:Python %Script% %Params%

I've added an environment path variable for python so the exe can launch from anywhere.

Can you give me an example of what I need to output in the script to get host monitor to pickup the result? I currently get "Error: Script returns no results"

This is the end of the script

Code: Select all

   # We know there's only once instance, so we can skip looping for now
   print list[0]['Scriptres:ok:VersionString']
sys.stdout.write('ScriptRes:OK:Test')
Neither of those seem to output anything. Can you give me a one line example of an output in python that Hostmonitor will pick up?[/code]
KS-Soft
Posts: 13012
Joined: Wed Apr 03, 2002 6:00 pm
Location: USA
Contact:

Post by KS-Soft »

Should work...
Have you tried VB or Java script on this system (using HostMonitor)?

Can you try different command line?
cmd /c c:\path_to_python\python.exe %Script% %Params%

Regards
Alex
Post Reply