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

using %::<testname>::<macrovariable>% in ActiveS

 
Post new topic   Reply to topic    KS-Soft Forum Index -> Library
View previous topic :: View next topic  
Author Message
Madman



Joined: 04 Nov 2002
Posts: 12
Location: Poland

PostPosted: Thu Sep 18, 2008 12:10 am    Post subject: using %::<testname>::<macrovariable>% in ActiveS Reply with quote

Hi,

I'm trying to create agregation test which become Bad when 3 other tests are Bad at the same time.
I couldn't find any other method so I'm trying vbscript.
I'm using
Code:
%::<testid>::<macrovariable>%
to read current status of selected tests, example:
Code:
%::<1119>::Status%

But in spite of selecting "Translate macros" I can't read the value. Any help please ?
My Script looks like this:

Code:

const statusAlive       = "Host is alive:"
const statusDead        = "No answer:"
const statusUnknown     = "Unknown:"
const statusNotResolved = "Unknown host:"
const statusOk          = "Ok:"
const statusBad         = "Bad:"
const statusBadContents = "Bad contents:"
dim IDTestowElements


'Tests to check
IDTests = "1139,1138,1140"


IDTestsElements = Split(IDTests, ",")



BadTestsSum = 0
FUNCTION PerformTest()
 For each element in IDTestsElements
   currentstatus = Chr(37)&Chr(58)&Chr(58)&element&Chr(58)&Chr(58)&"Status"&Chr(37)
   If  currentstatus = "Bad" then BadTestsSum = BadTestsSum + 1
 Next

PerformTest = StatusOK&BadTestsSum

END FUNCTION
Back to top
View user's profile Send private message Visit poster's website
KS-Soft



Joined: 03 Apr 2002
Posts: 11934
Location: USA

PostPosted: Thu Sep 18, 2008 10:58 am    Post subject: Reply with quote

Macros are resolved by HostMonitor before script processing.
"Chr(37)&Chr(58 )&Chr(58 )&element&Chr(58 )&Chr(58 )&"Status"&Chr(37)" does not look like macro variable to HostMonitor.
You should write %::1119::Status% in the script.

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



Joined: 04 Nov 2002
Posts: 12
Location: Poland

PostPosted: Thu Sep 18, 2008 12:14 pm    Post subject: Reply with quote

thank you for answer, I've just figured that out... had to make separate conditions for those 3 tests...
doesn't "look" nice, but works fine
thanx again
Back to top
View user's profile Send private message Visit poster's website
KS-Soft



Joined: 03 Apr 2002
Posts: 11934
Location: USA

PostPosted: Thu Sep 18, 2008 12:38 pm    Post subject: Reply with quote

You are welcome

Regards
Alex
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    KS-Soft Forum Index -> Library 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