SNMP Trap values from vcenter
-
- Posts: 26
- Joined: Mon Aug 11, 2008 5:32 am
SNMP Trap values from vcenter
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
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
Then you need several test items.I want the email to read something like
Subject: Computername has changed from gray to red
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
-
- Posts: 26
- Joined: Mon Aug 11, 2008 5:32 am
-
- Posts: 26
- Joined: Mon Aug 11, 2008 5:32 am
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?
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?
-
- Posts: 2832
- Joined: Tue May 16, 2006 4:41 am
- Contact:
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)]
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)]
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
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
-
- Posts: 26
- Joined: Mon Aug 11, 2008 5:32 am
-
- Posts: 26
- Joined: Mon Aug 11, 2008 5:32 am
Options like the following will work in version 10.20 or 10.30 or 10.31we are using hostmon 10.20. if we upgrade and use the new then it will work?
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
-
- Posts: 26
- Joined: Mon Aug 11, 2008 5:32 am
-
- Posts: 2832
- Joined: Tue May 16, 2006 4:41 am
- Contact:
-
- Posts: 26
- Joined: Mon Aug 11, 2008 5:32 am
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
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
-
- Posts: 2832
- Joined: Tue May 16, 2006 4:41 am
- Contact:
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%')
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%')