about snmp expression problem

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
nieaicai
Posts: 73
Joined: Fri Aug 03, 2012 9:05 pm

about snmp expression problem

Post by nieaicai »

I meet NEW problem

(%fvar_oid4%-%fvar_oid5%) such snmp expression work ok

but the expression with AND confuesd me.

for example :

I have two oid

oid5: 1.3.6.1.2.1.2.2.1.4.10
Value: 1514


oid4: 1.3.6.1.2.1.2.2.1.4.11
Value: 1500

my snmp expression is
(%fvar_oid4%-%fvar_oid5%)and(%fvar_oid4%-1504)

my alert condition is

is < than -9


IN FACT

%fvar_oid4%-%fvar_oid5% result is -14

(%fvar_oid4%-1504) result is -4

one < -9

one > -9

but from hostmonitor the reply is -16

why the result is -16?

the status is bad


is it a wrong result????



details below :


; ------- Test #01 -------


Method = SNMP
;--- Common properties ---
;DestFolder = Root\
Title = test
Comment = SNMP Get oid4 from 61.153.142.178
RelatedURL =
CmntPattern = SNMP Get %mibnameshort% from %host%
ScheduleMode= Regular
Schedule =
Interval = 600
Alerts =
Alerts2 =
ReverseAlert= No
UnknownIsBad= Yes
WarningIsBad= Yes
UseCommonLog= Yes
PrivLogMode = Default
CommLogMode = Default
;--- Test specific properties ---
Agent = 61.153.142.178
Profile = public
Timeout = 2000
Retries = 1
OID = (%fvar_oid4%-%fvar_oid5%) AND (%fvar_oid4%-1504)
Condition = LessThan
Value = -9




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

Post by KS-Soft »

Quote from the manual
==================
Also you may use round brackets (to change common rules of precedence) and the following operators:
div - integer division, the value of (x div y) is the value of x divided by y and then rounded in the direction of zero to the nearest integer
mod - remainder
* - multiplication
+ - addition
- -subtraction
or - bitwise OR operation
and - bitwise AND operation
xor - bitwise XOR operation
==================
BITWISE 'AND' means
1 and 0 = 0
1 and 1 = 1
1001 and 0111 = 1

In other words - such expression is not logical expression, this is number.
What exactly result do you need from these 2 OIDs?
What exactly do you want to check?


Also, you should use just 1 folder variable for the test. May be current version accepts several variables but this can be changed in future versions...
This means you should specify just 1 variable: e.g.
%fvar_expr1% [1.3.6.1.2.1.2.2.1.4.10] - [1.3.6.1.2.1.2.2.1.4.11]

Regards
Alex
nieaicai
Posts: 73
Joined: Fri Aug 03, 2012 9:05 pm

Post by nieaicai »

BITWISE 'AND' means
1 and 0 = 0
1 and 1 = 1
1001 and 0111 = 1

just
-14 and -4 =?



What exactly result do you need from these 2 OIDs?
What exactly do you want to check?

reply:

we have 2 servers they are PLAY loadbalance,
the oid1 means amount of client connect to server1
the oid2 means amount of client connect to server2

when the client connect to server of amount of any server is zero and the other clients connect to server of amount of server is more than 10, shows a serious problem .

this kinds of problem ,
how to write the snmp expression?


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

Post by KS-Soft »

-14 and -4 = 0xFFFFFFF2 and 0xFFFFFFFC = 0xFFFFFFF0 = -16
when the client connect to server of amount of any server is zero and the other clients connect to server of amount of server is more than 10, shows a serious problem .
this kinds of problem ,
how to write the snmp expression?
I think you should create 3 test items
1) SNMP Get test to check oid1 (TestA)
2) SNMP Get test to check oid2 (TestB)
3) Ping test with the following options
- Address: localhost
- This test depends on: expression
- Perform test if (('%::TestB::Reply%'<>0) or ('%::TestA::Reply%'<11)) and (('%::TestA::Reply%'<>0) or ('%::TestB::Reply%'<11))
- Otherwise status: Bad

Then assign all actions to test #3

Regards
Alex
nieaicai
Posts: 73
Joined: Fri Aug 03, 2012 9:05 pm

Post by nieaicai »

(('%::TestB::Reply%'<>0) or ('%::TestA::Reply%'<11)) and (('%::TestA::Reply%'<>0) or ('%::TestB::Reply%'<11))


such way, so interesting

i will try tomorrow when in company


so powerful it is
Post Reply