KS-Soft. Network Management Solutions
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister    ProfileProfile    Log inLog in 

Exec script from server

 
Post new topic   Reply to topic    KS-Soft Forum Index -> RMA for UNIX
View previous topic :: View next topic  
Author Message
Pomodoro



Joined: 31 Aug 2006
Posts: 16

PostPosted: Tue Sep 12, 2006 3:37 am    Post subject: Exec script from server Reply with quote

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
Back to top
View user's profile Send private message
KS-Soft Europe



Joined: 16 May 2006
Posts: 2832

PostPosted: Tue Sep 12, 2006 4:06 am    Post subject: Reply with quote

You may use Shell Script method.
http://www.ks-soft.net/hostmon.eng/mframe.htm#tests.htm#chkShell

Regards,
Max
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Pomodoro



Joined: 31 Aug 2006
Posts: 16

PostPosted: Tue Sep 12, 2006 4:09 am    Post subject: Reply with quote

I know
but in script method
the code are on HM server
i need that the code must remain on client side (where rma run)


I need to do a custom script that launch a server script?
Back to top
View user's profile Send private message
KS-Soft Europe



Joined: 16 May 2006
Posts: 2832

PostPosted: Tue Sep 12, 2006 4:36 am    Post subject: Reply with quote

Pomodoro wrote:
the code are on HM server
i need that the code must remain on client side (where rma run)

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:
I need to do a custom script that launch a server script?
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.

Regards,
Max
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Pomodoro



Joined: 31 Aug 2006
Posts: 16

PostPosted: Tue Sep 12, 2006 4:45 am    Post subject: Reply with quote

My customer check his application by run his /home/script/mychecj.sh
i can't put that script on HM schell scripting becase
it can change every day by customer

so i need capability to run script that are on server
(where rma run) and not on HM server



kind regards (sorry 4 my terrible english)
Back to top
View user's profile Send private message
KS-Soft Europe



Joined: 16 May 2006
Posts: 2832

PostPosted: Tue Sep 12, 2006 5:11 am    Post subject: Reply with quote

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/mframe.htm#tests.htm#shellmng)
2. Create new Schell Script test using foregoing script and select appropriate RM agent in "Test By" dropdown.

Thats all.

Regards,
Max
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Pomodoro



Joined: 31 Aug 2006
Posts: 16

PostPosted: Tue Sep 12, 2006 5:57 am    Post subject: Reply with quote

A little durty script that i put on HM are

#/bin/sh
COMMAND=$1
CHECK_COMMAND=`$1`
echo $CHECK_COMMAND


it works
Back to top
View user's profile Send private message
KS-Soft



Joined: 03 Apr 2002
Posts: 12795
Location: USA

PostPosted: Tue Sep 12, 2006 6:09 am    Post subject: Reply with quote

Actually you may keep "Script" field empty and use just "Start cmd" property of the script profile

Regards
Alex
Back to top
View user's profile Send private message Visit poster's website
KS-Soft Europe



Joined: 16 May 2006
Posts: 2832

PostPosted: Tue Sep 12, 2006 6:10 am    Post subject: Reply with quote

Glad to hear it.

Quote from manual:
The following rules must be obeyed when creating a script:
Quote:
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


Please, take a look on examples in Script Manager.

Regards,
Max
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Pomodoro



Joined: 31 Aug 2006
Posts: 16

PostPosted: Tue Sep 12, 2006 9:19 am    Post subject: Reply with quote

thaks!! all it works

Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    KS-Soft Forum Index -> RMA for UNIX All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group

KS-Soft Forum Index