SNMP Trap values from vcenter

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).
cshenberger
Posts: 26
Joined: Mon Aug 11, 2008 5:32 am

SNMP Trap values from vcenter

Post by cshenberger »

I am trying to configure tests to receive traps from vmware and report the values from the test.


I don't want to use %TrapAllValues_Name% because i get them all but I want the subject of the email to be the trap value of the third variable.

How can i setup my trap receiver to email on all but my email to break out the variables


So here are the current results


%TrapAllValues% ==
1.3.6.1.4.1.6876.4.3.308.0 = 3
1.3.6.1.4.1.6876.4.3.304.0 = Gray
1.3.6.1.4.1.6876.4.3.305.0 = Red
1.3.6.1.4.1.6876.4.3.306.0 = TrapTestAlarm - State = Powered off
1.3.6.1.4.1.6876.4.3.307.0 = computername


%TrapAllValues_Name% ==
iso.org.dod.internet.private.enterprises.vmware.vmwProductSpecific.vmwVC.vmwVpxdTargetObjType = 3 iso.org.dod.internet.private.enterprises.vmware.vmwProductSpecific.vmwVC.vmwVpxdOldStatus = Gray iso.org.dod.internet.private.enterprises.vmware.vmwProductSpecific.vmwVC.vmwVpxdNewStatus = Red iso.org.dod.internet.private.enterprises.vmware.vmwProductSpecific.vmwVC.vmwVpxdObjValue = TrapTestAlarm - State = Powered off iso.org.dod.internet.private.enterprises.vmware.vmwProductSpecific.vmwVC.vmwVpxdTargetObj = computername


I want the email to read something like

Subject: Computername has changed from gray to red
Body:

Test traptestalarm - state = Powered off, the old status was gray and the new status is red
KS-Soft
Posts: 13012
Joined: Wed Apr 03, 2002 6:00 pm
Location: USA
Contact:

Post by KS-Soft »

I want the email to read something like
Subject: Computername has changed from gray to red
Then you need several test items.
E.g.
set the following option for "TestRed" Counters fit expression ('%1.3.6.1.4.1.6876.4.3.304.0%' == 'Gray') and ('%1.3.6.1.4.1.6876.4.3.305.0%' == 'Red')

set the following option for "TestGray" Counters fit expression ('%1.3.6.1.4.1.6876.4.3.304.0%' == 'Red') and ('%1.3.6.1.4.1.6876.4.3.305.0%' == 'Gray')"

Regards
Alex
cshenberger
Posts: 26
Joined: Mon Aug 11, 2008 5:32 am

Post by cshenberger »

Can i put the value of the oid in the email though?



Also can I make so when goes from Yellow to Green is the clear
KS-Soft
Posts: 13012
Joined: Wed Apr 03, 2002 6:00 pm
Location: USA
Contact:

Post by KS-Soft »

If you setup test using "message contains OID" option, then yes.
E.g. you setup single test item with the following option
message contains OID 1.3.6.1.4.1.6876.4.3.305.0 <> ''

Then you may use %MibValue% variable in e-mail subject:
has changed to %MibValue%

Regards
Alex
cshenberger
Posts: 26
Joined: Mon Aug 11, 2008 5:32 am

Post by cshenberger »

so for these tests I would setup 2 tests for each type of monitor for vmware. is there a better way to monitor for vmware snmp?

I am looking to get information like vshield agent lost connection, bootbank errors....

they all send same traps but the values change depending on the tests

and can i verify they clear based on the same expression?
KS-Soft Europe
Posts: 2832
Joined: Tue May 16, 2006 4:41 am
Contact:

Post by KS-Soft Europe »

1. You may setup only 1 test items that will send e-mail with subject like:
Test traptestalarm - state = Powered off STATUS: Gray -> Red
Set the following options:
Message contains OID 1.3.6.1.4.1.6876.4.3.306.0 That is <> from !
Enable "Tune up Reply value" option with expression like the following:
%MibValue% STATUS: [('%TrapAllValues%' getword 6)] -> [('%TrapAllValues%' getword 9)]

This SNMP Trap test item will catch all events.

Just use %Reply% variable in e-mail subject.

2. If you need to see current state of some parameter, use separate test item for each counter:
Counters fit expression: ('Power' in '%1.3.6.1.4.1.6876.4.3.306.0%') and ('%1.3.6.1.4.1.6876.4.3.305.0%' <> 'Green')

Set "Ok" status if received message satisfies:
Counters fit expression: ('Power' in '%1.3.6.1.4.1.6876.4.3.306.0%') and ('%1.3.6.1.4.1.6876.4.3.305.0%' == 'Green')

"Tune up Reply value" expression can be the same as for previous config:
%MibValue% STATUS: [('%TrapAllValues%' getword 6)] -> [('%TrapAllValues%' getword 9)]
KS-Soft
Posts: 13012
Joined: Wed Apr 03, 2002 6:00 pm
Location: USA
Contact:

Post by KS-Soft »

If you are using HostMonitor 10.30, there is update for you
www.ks-soft.net/download/hm1031.zip
unzip and replace hostmon.exe module

Then you will be able to use variables like
%OidVal.1.3.6.1.4.1.6876.4.3.304.0%
%OidVal.1.3.6.1.4.1.6876.4.3.305.0%
%OidVal.1.3.6.1.4.1.6876.4.3.307.0%

Subject: %OidVal.1.3.6.1.4.1.6876.4.3.307.0% has changed from %OidVal.1.3.6.1.4.1.6876.4.3.304.0% to %OidVal.1.3.6.1.4.1.6876.4.3.305.0%

Regards
Alex
cshenberger
Posts: 26
Joined: Mon Aug 11, 2008 5:32 am

Post by cshenberger »

Alex,

I will work on this but I am not sure where "tune up reply value is"

we are using hostmon 10.20. if we upgrade and use the new then it will work?


Thank you,
cshenberger
Posts: 26
Joined: Mon Aug 11, 2008 5:32 am

Post by cshenberger »

does 10.30 require new RMA version? We have several RMA servers so upgrade takes a little while
KS-Soft
Posts: 13012
Joined: Wed Apr 03, 2002 6:00 pm
Location: USA
Contact:

Post by KS-Soft »

does 10.30 require new RMA version? We have several RMA servers so upgrade takes a little while
Probably everything will work but we do not test such configs. Please use all components from the same package.
RMA Manager allows you to update agents in minutes

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

Post by KS-Soft »

we are using hostmon 10.20. if we upgrade and use the new then it will work?
Options like the following will work in version 10.20 or 10.30 or 10.31
Counters fit expression: ('Power' in '%1.3.6.1.4.1.6876.4.3.306.0%') and ('%1.3.6.1.4.1.6876.4.3.305.0%' <> 'Green')

Variables like %OidVal.1.3.6.1.4.1.6876.4.3.304.0% supported by version 10.31 only

Regards
Alex
cshenberger
Posts: 26
Joined: Mon Aug 11, 2008 5:32 am

Post by cshenberger »

I am still not sure where to set

"tune up reply value"

can you explain this?
KS-Soft Europe
Posts: 2832
Joined: Tue May 16, 2006 4:41 am
Contact:

Post by KS-Soft Europe »

"Tune up Reply value" option is located on "Test properties" dialog and can be hidden.
Just press small [+] icon above "Help" button to show "Optional status processing" section.
cshenberger
Posts: 26
Joined: Mon Aug 11, 2008 5:32 am

Post by cshenberger »

Alex,

If I use counters fit expression

('vShield' in '%1.3.6.1.4.1.6876.4.3.306.0%') and ('%1.3.6.1.4.1.6876.4.3.305.0%' <> 'Green')

The trap doesn't set an alarm, however these are the results if I leave it at "any"

Trap Values: 1.3.6.1.4.1.6876.4.3.308.0 = 3
1.3.6.1.4.1.6876.4.3.304.0 = Red
1.3.6.1.4.1.6876.4.3.305.0 = Green
1.3.6.1.4.1.6876.4.3.306.0 = vShield VirtualMachine Alarm - vim.event.EventEx (com.vmware.vshield.zones.dvfilterSettingsChanged) OR vim.event.VmReconfiguredEvent
1.3.6.1.4.1.6876.4.3.307.0 = vmname
KS-Soft Europe
Posts: 2832
Joined: Tue May 16, 2006 4:41 am
Contact:

Post by KS-Soft Europe »

This is correct behaviour.
Expression
('vShield' in '%1.3.6.1.4.1.6876.4.3.306.0%') and ('%1.3.6.1.4.1.6876.4.3.305.0%' <> 'Green')
Will detect items if 1.3.6.1.4.1.6876.4.3.305.0 is not equal to Green
If you need alet for any vmwVpxdNewStatus value just leave only first part of the expression:
('vShield' in '%1.3.6.1.4.1.6876.4.3.306.0%')
Post Reply