how to run batch scripts

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
vidyagana
Posts: 106
Joined: Fri Mar 25, 2005 10:35 am

how to run batch scripts

Post by vidyagana »

Hi,

I have a batch file which contains Oracle database scripts. I want to run this batch file once a day and email the spool results of the file. How should I configure host monitor to run batch files?

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

Post by KS-Soft »

To run some test once a day you should create "Schedule" that allows test execution between 7:00 and 7:10 (for example) and set test interval longer than 10 min (7:10-7:00=10 min), e.g. 11 min.
http://www.ks-soft.net/hostmon.eng/mfra ... #Schedules
Then assign this schedule to the test

If you want to execute some script, use "External" or "Shell Script" test method

Regards
Alex
vidyagana
Posts: 106
Joined: Fri Mar 25, 2005 10:35 am

Post by vidyagana »

After receiving your reply I tried configuring my .bat file as a script by the following steps:
test->new->shell script test->script manager
scripts->new
entered name of script as dailychecks
start cmd: path\filename.bat
let's try -> tested and it worked fine
added this to a schedule for every 10 mins and i have setup the test to email me whether the results are good/bad and so i am expecting email every 10 mins. But I am not. Also when I check in the test list I see the following
testname status recurrences reply
dailychecks_shellscript Unknown 3 Error: Invalid result (c:\program files\hostmonitor4>exit
What does this mean and I also need some help with why I am not getting alerts every 10 mins as per my schedule.
Please help.
KS-Soft
Posts: 13012
Joined: Wed Apr 03, 2002 6:00 pm
Location: USA
Contact:

Post by KS-Soft »

Unknown 3 Error: Invalid result (c:\program files\hostmonitor4>exit
What information is returned by script?
There are special rules that must be obeyed when creating a shell script.
www.ks-soft.net/hostmon.eng/mframe.htm# ... m#shellres

If script returned correct result when you have used "Test" button (Script Manager dialog) but doesn't work now, probably you have used different parameters for the test?

If you script returns result using exit code, setup "External" test method instead of "Shell Script".
and I also need some help with why I am not getting alerts every 10 mins as per my schedule
What parameters do you use for this action?
- Start when?
- Repeat?
- Time restriction?

Regards
Alex
vidyagana
Posts: 106
Joined: Fri Mar 25, 2005 10:35 am

Post by vidyagana »

How should I check what information is returned by script?
KS-Soft
Posts: 13012
Joined: Wed Apr 03, 2002 6:00 pm
Location: USA
Contact:

Post by KS-Soft »

I assume you have source codes?
Also you may start script from command line and check what script shows on screen.

Regards
Alex
vidyagana
Posts: 106
Joined: Fri Mar 25, 2005 10:35 am

Post by vidyagana »

When I run from the command prompt, the screen shows the results that should be displayed.
vidyagana
Posts: 106
Joined: Fri Mar 25, 2005 10:35 am

Post by vidyagana »

I have executed the command and I want to send you an attachement. How do I do that?

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

Post by KS-Soft »

results that should be displayed
Could you please provide example of the result?
I have executed the command and I want to send you an attachement. How do I do that
You may send a file to support@ks-soft.net
On the other hand I need just several text lines, you may copy&paste result right here

Regards
Alex
vidyagana
Posts: 106
Joined: Fri Mar 25, 2005 10:35 am

Post by vidyagana »

Hi,

I just emailed you an attachment.

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

Post by KS-Soft »

Vidyagana,

2 months ago I refereed you to the manual.
There are special rules that must be obeyed when creating a shell script.
www.ks-soft.net/hostmon.eng/mframe.htm# ... m#shellres
My today's answer the same
There are special rules that must be obeyed when you create a shell script.
www.ks-soft.net/hostmon.eng/mframe.htm# ... m#shellres

Your script does not follow these rules.
"JServer Release 9.2.0.1.0 – Production" is not valid result if you want to use Shell Script test method.
It means you should modify your script or use some other test method. E.g. External
http://www.ks-soft.net/hostmon.eng/mfra ... m#execheck

Regards
Alex
vidyagana
Posts: 106
Joined: Fri Mar 25, 2005 10:35 am

Post by vidyagana »

Thanks a lot for your response. If that is the case, I am probably going to go with External test.

Thanks.
Post Reply