View previous topic :: View next topic |
Author |
Message |
cshenberger
Joined: 11 Aug 2008 Posts: 26
|
Posted: Wed Sep 21, 2016 10:35 am Post subject: 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 |
|
Back to top |
|
|
KS-Soft
Joined: 03 Apr 2002 Posts: 12795 Location: USA
|
Posted: Wed Sep 21, 2016 10:55 am Post subject: |
|
|
Quote: | 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 |
|
Back to top |
|
|
cshenberger
Joined: 11 Aug 2008 Posts: 26
|
Posted: Wed Sep 21, 2016 11:13 am Post subject: |
|
|
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 |
|
Back to top |
|
|
KS-Soft
Joined: 03 Apr 2002 Posts: 12795 Location: USA
|
Posted: Wed Sep 21, 2016 11:23 am Post subject: |
|
|
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 |
|
Back to top |
|
|
cshenberger
Joined: 11 Aug 2008 Posts: 26
|
Posted: Wed Sep 21, 2016 11:27 am Post subject: |
|
|
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? |
|
Back to top |
|
|
KS-Soft Europe
Joined: 16 May 2006 Posts: 2832
|
Posted: Wed Sep 21, 2016 12:51 pm Post subject: |
|
|
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)] |
|
Back to top |
|
|
KS-Soft
Joined: 03 Apr 2002 Posts: 12795 Location: USA
|
Posted: Wed Sep 21, 2016 2:25 pm Post subject: |
|
|
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 |
|
Back to top |
|
|
cshenberger
Joined: 11 Aug 2008 Posts: 26
|
Posted: Wed Sep 21, 2016 2:30 pm Post subject: |
|
|
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, |
|
Back to top |
|
|
cshenberger
Joined: 11 Aug 2008 Posts: 26
|
Posted: Wed Sep 21, 2016 2:33 pm Post subject: |
|
|
does 10.30 require new RMA version? We have several RMA servers so upgrade takes a little while |
|
Back to top |
|
|
KS-Soft
Joined: 03 Apr 2002 Posts: 12795 Location: USA
|
Posted: Wed Sep 21, 2016 4:31 pm Post subject: |
|
|
Quote: | 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 |
|
Back to top |
|
|
KS-Soft
Joined: 03 Apr 2002 Posts: 12795 Location: USA
|
Posted: Wed Sep 21, 2016 4:34 pm Post subject: |
|
|
Quote: | 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 |
|
Back to top |
|
|
cshenberger
Joined: 11 Aug 2008 Posts: 26
|
Posted: Thu Sep 22, 2016 6:34 am Post subject: |
|
|
I am still not sure where to set
"tune up reply value"
can you explain this? |
|
Back to top |
|
|
KS-Soft Europe
Joined: 16 May 2006 Posts: 2832
|
Posted: Thu Sep 22, 2016 7:10 am Post subject: |
|
|
"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. |
|
Back to top |
|
|
cshenberger
Joined: 11 Aug 2008 Posts: 26
|
Posted: Thu Sep 22, 2016 12:16 pm Post subject: |
|
|
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 |
|
Back to top |
|
|
KS-Soft Europe
Joined: 16 May 2006 Posts: 2832
|
Posted: Thu Sep 22, 2016 12:32 pm Post subject: |
|
|
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%') |
|
Back to top |
|
|
|