Hello support-team,
I want to create a test which runs a python script.
I installed newest python 3.12.4 (32bit) for windows on my hostmonitor-machine. (Hostmon-service also runs as 32bit instance, too! | Version 14.04)
Unfortunately, I can not select "Python" into language field of "Active script" test properties. Hostmon does not recognize the python interpreter.
Is there anywhere a config whichs shows hostmon the location of phyton interpreter?
Second question:
Does you have a example of phyton script? (similar as "hello world")?
I found nothing into forum.
Regards,
Stefan
Python script
Re: Python script
Active Script test method kept for compatibility, it can work only in 32bit mode and not supported by HostMonitor x64.
We recommend to use Shell Script test method
https://www.ks-soft.net/hostmon.eng/mfr ... m#chkShell
Regards
Alex
We recommend to use Shell Script test method
https://www.ks-soft.net/hostmon.eng/mfr ... m#chkShell
Never used Phyton but I will check...Does you have a example of phyton script? (similar as "hello world")?
Regards
Alex
Re: Python script
Sample for Shell Script test method
Example how to check if file/folder exists
Regards
Alex
Code: Select all
statusAlive = "scriptRes:Host is alive:"
statusDead = "scriptRes:No answer:"
statusUnknown = "scriptRes:Unknown:"
statusNotResolved = "scriptRes:Unknown host:"
statusOk = "scriptRes:Ok:"
statusBad = "scriptRes:Bad:"
statusBadContents = "scriptRes:Bad contents:"
if 5<10:
print(statusOk+'5 ms')
else:
print(statusDead)
Code: Select all
import os
PATH = 'c:\\path\\file'
if os.path.isfile(PATH):
print("scriptRes:Ok:")
else:
print("scriptRes:Bad:")
Alex