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

Macros on external program command line

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    KS-Soft Forum Index -> HostMonitor
View previous topic :: View next topic  
Author Message
jricha34



Joined: 07 Jul 2002
Posts: 59
Location: USA

PostPosted: Tue Oct 08, 2002 10:37 am    Post subject: Reply with quote

Is it possible to specify macros on the command line for external programs? I have tried it and they don't seem to be getting expanded.
Back to top
View user's profile Send private message Send e-mail
KS-Soft



Joined: 03 Apr 2002
Posts: 12807
Location: USA

PostPosted: Tue Oct 08, 2002 11:30 am    Post subject: Reply with quote

Yes, its possible. But it depends on how do you start external program. Do you use "Execute external program" action? And what is your command line?

Regards
Alex
Back to top
View user's profile Send private message Visit poster's website
jricha34



Joined: 07 Jul 2002
Posts: 59
Location: USA

PostPosted: Tue Oct 08, 2002 3:39 pm    Post subject: Reply with quote

Yes, I am using by external program.
Back to top
View user's profile Send private message Send e-mail
KS-Soft



Joined: 03 Apr 2002
Posts: 12807
Location: USA

PostPosted: Tue Oct 08, 2002 4:18 pm    Post subject: Reply with quote

External program action? Or External program test? What command line do you use? What version of HM do you use? I cannot say what's wrong because I do not see your configuration. Please, tell me as much as possible.

Regards
Alex
Back to top
View user's profile Send private message Visit poster's website
jricha34



Joined: 07 Jul 2002
Posts: 59
Location: USA

PostPosted: Wed Oct 09, 2002 11:14 am    Post subject: Reply with quote

o Select ADD to add a new test
o Select "by External Program" from dropdown
o I specify a little perl script with the command line

perl ..addontestsHM-LOGTEST.pl %HostName%

All of the HM-LOGTEST.pl script does is write a time stamp and the parameters it was initiated with to an external log file.

Here is what it writes

Wed Oct 9 13:13:10 2002 - %HostName%
--------------------------------------------------------------------------------
Wed Oct 9 13:13:55 2002 - %HostName%
--------------------------------------------------------------------------------
Wed Oct 9 13:13:58 2002 - %HostName%
--------------------------------------------------------------------------------
Wed Oct 9 13:14:00 2002 - %HostName%
--------------------------------------------------------------------------------
Wed Oct 9 13:14:02 2002 - %HostName%

Back to top
View user's profile Send private message Send e-mail
KS-Soft



Joined: 03 Apr 2002
Posts: 12807
Location: USA

PostPosted: Wed Oct 09, 2002 11:59 am    Post subject: Reply with quote

jricha34,

First my question was: Do you use "Execute external program" action? You said yes. Now you say you use External test. Its complette different modules. HM supports macro variables for actions execution because hundreds different tests can start the same action. HM does not support macros in configuration of the test because you already know test's parameters, you specify these parameters.

Regards
Alex

[ This Message was edited by: KS-Soft on 2002-10-09 12:00 ]

[ This Message was edited by: KS-Soft on 2002-10-09 12:01 ]
Back to top
View user's profile Send private message Visit poster's website
jricha34



Joined: 07 Jul 2002
Posts: 59
Location: USA

PostPosted: Wed Oct 09, 2002 2:41 pm    Post subject: Reply with quote

Actually I didn't say action the first time, I specified external program, then you asked which one and I was specific. Picks in the GUI are labeled the same, you only know the difference when in the different sections. I wasn't in the action section so wasn't aware that the label was identical.

That being said, the reason I was trying to use a macro in the parameter is so I can set this up as generically as possible so when I try to take advantage of the 20 million tests I don't have to customize multiple lines in each test import section. I can have the same line for the command line and then the differences would be in the host name and the comments, etc... Currently I would have to have a import setup of

Method = ExternalPrg
;--- Common properties ---
Title = OOR: server1.testdomain.com
Comment = server1.testdomain.com
RelatedURL =
ScheduleMode= Regular
Schedule =
Interval = 900
Alerts = REDC-EIG-EMAIL
ReverseAlert= No
UnknownIsBad= Yes
UseCommonLog= Yes
PrivLogMode = Default
SyncCounters= Yes
SyncAlerts = No
MasterTest-Alive = server1.testdomain.com
;--- Test specific properties ---
CommandLine = perl ..addontestshm-oor.pl server1.testdomain.com
Condition = DifferentFrom
ErrorLevel = 0
KillAfter = 60
WindowMode = hide


Which could be

Method = ExternalPrg
;--- Common properties ---
Title = OOR: server1.testdomain.com
Comment = server1.testdomain.com
RelatedURL =
ScheduleMode= Regular
Schedule =
Interval = 900
Alerts = REDC-EIG-EMAIL
ReverseAlert= No
UnknownIsBad= Yes
UseCommonLog= Yes
PrivLogMode = Default
SyncCounters= Yes
SyncAlerts = No
MasterTest-Alive = server1.testdomain.com
;--- Test specific properties ---
CommandLine = perl ..addontestshm-oor.pl %commentline1%
Condition = DifferentFrom
ErrorLevel = 0
KillAfter = 60
WindowMode = hide



Or something similar and when I write the documentation for people to make a change I can say, change the comment to this versus make the following changes in the following locations and make sure you get them all so that it works right.

On the automation side it simply makes the script easier to write to automate things as well.

I can go either way, just think it is more consistent to allow macros to be used there.

joe


Back to top
View user's profile Send private message Send e-mail
KS-Soft



Joined: 03 Apr 2002
Posts: 12807
Location: USA

PostPosted: Wed Oct 09, 2002 4:41 pm    Post subject: Reply with quote

Joe,
want to make a bet?

>Actually I didn't say action the first time
Correct, that's why I said "First MY question was: Do you use "Execute external program" action?"

Anyway, now I see your point. I have added your request into "to do" list with low priority

Regards
Alex
Back to top
View user's profile Send private message Visit poster's website
jricha34



Joined: 07 Jul 2002
Posts: 59
Location: USA

PostPosted: Wed Oct 09, 2002 4:52 pm    Post subject: Reply with quote

Hahaha. But I said

>"Yes, I am using by external program."

Not - External Program Action

Which prompted you to clarify

>"External program action? Or External program test?"

to which I clarified with

"o Select ADD to add a new test
o Select "by External Program" from dropdown "

So once you asked it in a clear way that showed there were two valid possible answers I gave step by step...

)

Thanks for adding to the to do. I was thinking how I would want to implement and possibly you may consider doing %%macro%% so you could also do %environment variable%?

Just thinking out loud.
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    KS-Soft Forum Index -> HostMonitor 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