Hi all
I have a server script where rma run
like
/home/script/mycustomcheck.sh
it return a OK if chesk work or KO if checK fault
How can i use that test thought HS and RMA?
thanks a lot
Exec script from server
-
- Posts: 2832
- Joined: Tue May 16, 2006 4:41 am
- Contact:
You may use Shell Script method.
http://www.ks-soft.net/hostmon.eng/mfra ... m#chkShell
Regards,
Max
http://www.ks-soft.net/hostmon.eng/mfra ... m#chkShell
Regards,
Max
-
- Posts: 2832
- Joined: Tue May 16, 2006 4:41 am
- Contact:
But you may select certain RMA in "Test by" property and test will be performed by RMA on machine, where RMA is running.Pomodoro wrote:the code are on HM server
i need that the code must remain on client side (where rma run)
Could you provide more information. I could not understand the problem. If you want to execute script on the server, where RMA is running, you just should create Schell Script test, create script in Script manager and select that RMA in Test By dropdown using Test Properties window. Of course, also you may create wrapper, that would execute particular sh script , located on server.Pomodoro wrote:I need to do a custom script that launch a server script?
Regards,
Max
-
- Posts: 2832
- Joined: Tue May 16, 2006 4:41 am
- Contact:
So, you should do the folowing:
1. Invoke script manager, and create script, that executes /home/script/mychecj.sh, parses output and according to output (OK or KO), returns value to HostMonitor. See. Requirements to the script section (http://www.ks-soft.net/hostmon.eng/mfra ... m#shellmng)
2. Create new Schell Script test using foregoing script and select appropriate RM agent in "Test By" dropdown.
Thats all.
Regards,
Max
1. Invoke script manager, and create script, that executes /home/script/mychecj.sh, parses output and according to output (OK or KO), returns value to HostMonitor. See. Requirements to the script section (http://www.ks-soft.net/hostmon.eng/mfra ... m#shellmng)
2. Create new Schell Script test using foregoing script and select appropriate RM agent in "Test By" dropdown.
Thats all.
Regards,
Max
-
- Posts: 2832
- Joined: Tue May 16, 2006 4:41 am
- Contact:
Glad to hear it.
Quote from manual:
The following rules must be obeyed when creating a script:
Regards,
Max
Quote from manual:
The following rules must be obeyed when creating a script:
Please, take a look on examples in Script Manager.The script or external program must write to stdout (standard output stream) single result string. This string should contain 3 parts separated by colon ':'.
1. First obligatory part - marker "scriptres" tells to HostMonitor or RMA that this string is the result string.
2. Second obligatory part represents the test status, it can take one of the following values (case insensitive):
Status string Comment
Host is alive status means " script executed successfully, target system correctly responds"
No answer script executed successfully, target system does not respond
Unknown status means "test cannot be performed for some reason"
Unknown host use this status when script cannot resolve target host name into IP address
Ok script executed, result satisfies (some) requirements
Bad script executed, result does not satisfy (some) requirements
Bad contents use this status if script found some error in monitored file, web page, etc
3. Third optional part contains Reply value, HostMonitor displays this value in Reply field, writes to log files, uses to displays charts (Log Analyzer), etc. If you want Log Analyzer to process Reply values correctly and display charts, use one of the following formats for Reply value:
* decimal_number (like "123", "0", "6456.45". as decimal separator use symbol that is specified on your system, usually a dot (.) or a comma (,))
* decimal_number + space + "Kb" (like "512 Kb", "64 Kb")
* decimal_number + space + "Mb" (like "1024 Mb", "5 Mb")
* decimal_number + space + "Gb" (like "12 Gb", "4 Gb")
* decimal_number + space + "%" (like "50 %", "99 %")
* decimal_number + space + "ms" (like "100 ms", "5400 ms")
Several examples:
String printed by script "Status" of the test "Reply" field of the test
scriptres:Host is alive:1000 ms Host is alive 1000 ms
scriptres:Unknown host: Unknown host
scriptres:Ok:300 Kb Ok 300 Kb
scriptres:Bad:90 % Bad 90 %
That's it. Everything else is entirely up to you
Regards,
Max