Macro Variables

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
thomasschmeidl
Posts: 166
Joined: Sat Apr 15, 2006 2:14 pm
Location: Germany, Bavaria

Macro Variables

Post by thomasschmeidl »

Hi Alex,

my setting: HM6.51c on XP SP2 running as application (for testing)
The HM-Manual wrote:In the string that represents a value of a UDV you may use the name of another macro variable(s)
This is very helpful and works, but now there seems to be a problem with the following variables:

udv_nofallback: (('%Status%'=='Warning') or ('%SimpleStatus%'=='UP') or (%Recurrences%<3))

udv_warnbc1: (('%SuggestedReply%'<'100') and ('%SuggestedReply%'>'10')) and (('%Status%'=='Warning') or ('%SimpleStatus%'=='UP') or (%Recurrences%<3))

udv_warnbc2: (('%SuggestedReply%'<'100') and ('%SuggestedReply%'>'10')) and %udv_nofallback%

IMHO udv_warnbc1 and udv_warnbc2 should be equal, but if you you use them in the advanced status processing dialogue

[x] use Warning status if %udv_warnbc1%
is ok, whereas

[x] use Warning status if %udv_warnbc2%
produces reply "illegal expression"

The problem seems to be the (%Recurrences%<3) as there is no error when it is replaced by another expression.

Regards

Thomas
JuergenF
Posts: 331
Joined: Sun Jan 26, 2003 6:00 pm
Location: Germany, North Rhine-Westphalia

Re: Macro Variables

Post by JuergenF »

thomasschmeidl wrote:udv_nofallback: (('%Status%'=='Warning') or ('%SimpleStatus%'=='UP') or (%Recurrences%<3))
This works
udv_nofallback: (('%Status%'=='Warning') or ('%SimpleStatus%'=='UP') or ("%Recurrences%"<3))
this too
udv_nofallback: (('%Status%'=='Warning') or ('%SimpleStatus%'=='UP') or ("%Recurrences%"<"3"))

Maybe it can help analysing the problem

All the best for 2007

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

Post by KS-Soft »

udv_nofallback: (('%Status%'=='Warning') or ('%SimpleStatus%'=='UP') or (%Recurrences%<3))
udv_warnbc1: (('%SuggestedReply%'<'100') and ('%SuggestedReply%'>'10')) and (('%Status%'=='Warning') or ('%SimpleStatus%'=='UP') or (%Recurrences%<3))
udv_warnbc2: (('%SuggestedReply%'<'100') and ('%SuggestedReply%'>'10')) and %udv_nofallback%
IMHO udv_warnbc1 and udv_warnbc2 should be equal
udv_warnbc1 <> udv_warnbc2.
Why?
udv_warnbc1 uses variables that can be resolved in 1 step.
udv_warnbc2 uses variable (%udv_nofallback%) that points to another variable that uses more variables - 3 level recursion.

Regards
Alex
thomasschmeidl
Posts: 166
Joined: Sat Apr 15, 2006 2:14 pm
Location: Germany, Bavaria

Post by thomasschmeidl »

OK

So I understand that:
- you can use macro variables in an udv
- you can use udvs, which contain a string, in an udv
- you cannot use udvs that contain other macro variables or udvs in an udv

1. Is that correct?

2. Is there a reason for the fact that there is no error message with the following combination?
udv_nofallback: (('%Status%'=='Warning') or ('%SimpleStatus%'=='UP'))
udv_warnbc2: (('%SuggestedReply%'<'100') and ('%SuggestedReply%'>'10')) and %udv_nofallback%

3. Will the behaviour be changed to "more-level-recursion" (would be helpful :D )?

4. Could you add a sentence about it to the manual - or did I miss it?

Cheers

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

Post by KS-Soft »

- you can use macro variables in an udv
- you can use udvs, which contain a string, in an udv
- you cannot use udvs that contain other macro variables or udvs in an udv
1. Is that correct?
Almost. You may use UDV variable that refers to another UDV variable, but that 2nd variable cannot refer to test related macro variables.
Is there a reason for the fact that there is no error message with the following combination?
H'm... probably expression evaluator cannot catch all possible errors. Will check that
Will the behaviour be changed to "more-level-recursion"
Do you really need this? May be you are trying to use complicated configuration schemes without a reason?
Could you add a sentence about it to the manual - or did I miss it?
Officially recurrences are not supported

Regards
Alex
thomasschmeidl
Posts: 166
Joined: Sat Apr 15, 2006 2:14 pm
Location: Germany, Bavaria

Post by thomasschmeidl »

Thanx for your work and your explanations.
Alex wrote:Do you really need this? May be you are trying to use complicated configuration schemes without a reason?
I set up many udv_s which are absolutely helpful for the "normal" and "warning" expressions. 15 of them contain "%udv_nofallback%" which prevents status switching back to "warning" after it was "bad" three times (otherwise new actions would be triggered after every status change). To avoid redundancies and to facilitate changes in the future it would help to substitute this part of the expression. Now you may judge whether one really needs this.

But I understand, that it is more important now to release a final version of HM with new statuses.

Cheers

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

Post by KS-Soft »

May be we improve some code but not right now. We are testing 6.52 release, I hope it will be available for download next week

Regards
Alex
Post Reply