Loading

×Sorry to interrupt
Uncaught ReferenceError: addCTracking is not defined
throws at https://kb.vmware.com/resource/KM_TealiumTrackingJS?v=0.5:100:1

Refresh

Cookie Preference Center

General Information on cookies

When you visit our website, we use cookies to ensure that we give you the best experience. This information does not usually directly identify you, but it can give you a more personalized web experience. Because we respect your right to privacy, you can choose not to allow some types of cookies by clicking on the different category headings to find out more and change your settings. However, blocking some types of cookies may impact your experience on the site and the services we are able to offer. Further information can be found in our

Cookie Policy.

Strictly Necessary

Strictly Necessary

Always Active

Strictly Necessary

Strictly necessary cookies are always enabled since they are essential for our website to function. They enable core functionality such as security, network management, and website accessibility. You can set your browser to block or alert you about these cookies, but this may affect how the website functions. For more information please visit www.aboutcookies.org or www.allaboutcookies.org.

Cookie Details‎

Performance

Performance

Performance

Performance cookies are used to analyze the user experience to improve our website by collecting and reporting information on how you use it. They allow us to know which pages are the most and least popular, see how visitors move around the site, optimize our website and make it easier to navigate.

Cookie Details‎

Please confirm your settings by refreshing the page.

Functional

Functional

Functional

Functional cookies help us keep track of your past browsing choices so we can improve usability and customize your experience. These cookies enable the website to remember your preferred settings, language preferences, location and other customizable elements such as font or text size. If you do not allow these cookies, then some or all of these services may not function properly.

Cookie Details‎

Advertising

Advertising

Advertising

Advertising cookies are used to send you relevant advertising and promotional information. They may be set through our site by third parties to build a profile of your interests and show you relevant advertisements on other sites. These cookies do not directly store personal information, but their function is based on uniquely identifying your browser and internet device.

Cookie Details‎

Advertising Cookies

Consent Leg.Interest

Select All Vendors

Select All Vendors

Select All Hosts

Select All

Clear Filters

Information storage and access

Apply

Confirm My Choices Reject All Allow All

My Subscriptions

Loading

Knowledge Base

Smarts Notif adapter: How do you parse a trap using Smarts API: $extract : (334551)

Last Updated: 12/17/2018Categories: TroubleshootingTotal Views: 4467Language:
English

Subscribe to get an email
newsletter with new updates

Please provide article feedback:

Symptoms

This article shows us how you could use the $extract  function in the Smarts SAM Notif adapter.

We need to be able to parse e-mail text for specific content:

How do you extra this text from a SMTP email? This would be the text extracted between these two words. " mexxx.com.mail> " And " uplink." on the following SMTP trap/text.

NOTE:( the below has been edited for privacy)

extra==__mimepart__56448f009eceb__5e2a453b3f4275219d5_20Date_:_20Thu,_2012_ 20Nov_202015_2005_:07_:12_20-0800_20Content-Type_:_20text/plain;_20charsetUTF-8_20_20Content-Transfer-Encoding_:_207bit_20Content-Disposition_:_20inline_20Content-ID_:_20<56448f00a10bb__5e2a453b3f4275220ee@sdg169 EmailSubject:Alert for HFD-MX60W-01 - Uplink status changed -- Email Body:----==_mimepart_56448f009eceb_5e2a453b3f4275219d5 Date: Thu, 12 Nov 2015 05:07:12 -0800 Content-Type: text/plain; charsetUTF-8 Content-Transfer-Encoding: 7bit Content-Disposition: inline Content-ID: <[email-masked]> The security appliance in the HFD-xxx-01 network switched to using its primary uplink, configured to be uplink Internet 1, after a period in which the link was unavailable. There has been a total of 1 failover event detected: At 08:06 AM EST on Nov 12, the security appliance switched to using Internet 1 as its uplink. See the alerting security appliance at https://n74.mexxx.com/HFD-MX60W-01/...age/nodes/show- Cisco Meraki This email was automatically generated; please do not reply. You can change your alert delivery settings athttps://n74.meraki.com/HFD-MX60W-01/...nfigure/alerts ----==_mimepart_56448f009eceb_5e2a453b3f4275219d5 Date: Thu, 12 Nov 2015 05:07:12 -0800 Content-Type: text/html; charsetUTF-8 Content-Transfer-Encoding: 7bit Content-Disposition: inline Content-ID: <[email-masked]> <meta http-equivContent-Type contenttext/html; charset=utf-8 ><img srchttps://dashboard.mexxx.com/images/cisco-meraki.png border0 stylewidth:175px altCisco Systems, Inc. ><!-- </img> --><br><br> <p> The security appliance in the <a stylecolor: #1d770b; hrefhttps://n74.mexxx.com/HFD-MX60W-01/n/Tiu40ckb/manage/nodes/list >HFD-MX60W-01</a> network switched to using its primary uplink, configured to be uplink Internet 1, after a period in which the link was unavailable. </p> There has been 1 failover event detected:<br><br> At 08:06 AM EST on Nov 12, the security appliance switched to using Internet 1 as its uplink. <br> <br> <p> - Cisco Mexxx </p> <br> <br> <br> <p> This email was automatically generated; please do not reply.<br> You can change the <a stylecolor: #1d770b; hrefhttps://n74.mexxx.com/HFD-MX60W-01/n/Tiu40ckb/manage/configure/alerts >alert delivery settings</a> for this network. </p> ----==_mimepart_56448f009eceb_5e2a453b3f4275219d5-

Cause

How do you use a nested variable to parse a SMTP trap.

The nested Variable we used was, and we used the Variables "message" and  not the variable "V1":
$substr(text, pos, length)$

NOTE: for more complete instructions see the bottom of page 99 of the below guide:
https://support.emc.com/docu9371_Ion...language=en_US

Resolution

In the Smarts user interface, set the EventText  as below:
EventText = $extract(extract(message,"meraki.com.mail> ", 2),"its uplink." ,1)$

Note: To test this, you can send this command:
Then using sm_snmp command I sent the below trap with varbind V1 having the string that cutsomer wants to extract.

./sm_snmp --dest=localhost --port=8130 trap 192.168.1.4 .1.3.6.1.4.1.555 6 888 1450338233 .1.3.6.1.4.1.555.2.2.2 s "<[email-masked]> The security appliance in the HFD-MX60W-01 network switched to using its primary uplink, configured to be uplink Internet 1, after a period in which the link was unavailable. There has been a total of 1 failover event detected: At 08:06 AM EST on Nov 12, the security appliance switched to using Internet 1 as its uplink."

Detectable by VMware SkylineTM

Actions

Copy

link to clipboard
copied!

Print

Language:
English

Attachments

Additional Resources

KB
•
End Of General Availability of the Free vSphere Hypervisor (ESXi 7.x and 8.x) (2107518)

Result 1 of 1

Ask The Community

Get answers quickly from VMware experts in the community

Post Subject

CONTINUE IN COMMUNITIES

Related Products:

Related Versions:

VMware Smart Assurance - SMARTS

Take Our Survey

Support Assistant