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 SAM OI: How to parse oid from a trap's varbind (319334)

Last Updated: 3/22/2024Categories: How toTotal Views: 1754Language:
English

Subscribe to get an email
newsletter with new updates

Please provide article feedback:

Resolution

How to parse OID from a trap's varbind

To parse the OID from a trap's varbind, do the following:

Open the trap_mgr.conf configuration file as follows:

<BASEDIR>/SAM/smarts/bin/sm_edit conf/icoi/trap_mgr.conf

# ciscoSlbRealStateChange
BEGIN_TRAP .1.3.6.1.4.1.9.9.161.2 6 2
ClassName:      SNMPTrap
InstanceName:   $SYS$
EventName:      ciscoSlbRealStateChange
Severity:       3
EventText:      The 1 Varibles are - slbRealState= $V1$
Expiration:     100
State:          NOTIFY
ASL:  my_trap_rules.asl
LogFile:        CSM_Trap.log

END_TRAP

Customize the my_trap_rules.asl file according to your requirements and put it into the following directory:

<BASEDIR>/SAM/smarts/local/rules/icoi-trapd/

See the Note statement for the contents of this file.

Restart trap adapter for the changes to take effect. The Event Text for the example will be:

CSM Slot:6 SHAREPOINT IP:10.1.51.127 SlbRealServerState:probeFailed

Related Information

Contents of the my_trap_rules.asl file

/*
* my_trap_rules.asl - Hook adapter for any trap related customizations.
*
* Copyright (C) 2002, System Management ARTS (SMARTS)
* All Rights Reserved
*
* RCS $Id: my_trap_rules.asl,v 1.9.10.1 2005/05/02 14:16:23 ku1 Exp $
*/

debug = TRUE;

// Input/Output variables.

CLASSNAME = "";
INSTANCENAME = "";
EVENTNAME = "";
SEVERITY = "";
EVENTTEXT = "";
CATEGORY = "";
EXPIRATION = "";
STATE = "";
INMAINTENANCE = "";
CLEARONACKNOWLEDGE = "";
EVENTTYPE = "";
ELEMENTCLASSNAME = "";
ELEMENTNAME = "";
USERDEFINED1 = "";
USERDEFINED2 = "";
USERDEFINED3 = "";
USERDEFINED4 = "";
USERDEFINED5 = "";
USERDEFINED6 = "";
USERDEFINED7 = "";
USERDEFINED8 = "";
USERDEFINED9 = "";
USERDEFINED10 = "";

// Input Variables

TIMESTAMP = "0";
IPADDRESS = "";
SYSNAMEORADDR = "";
ENTERPRISE = "";
GENERIC = "9999";
SPECIFIC = "9999";

// Varbind and OID values
V1 = "";
V2 = "";
V3 = "";
V4 = "";
V5 = "";
V6 = "";
V7 = "";
V8 = "";
V9 = "";
V10 = "";
V11 = "";
V12 = "";
V13 = "";
V14 = "";
V15 = "";
V16 = "";
V17 = "";
V18 = "";
V19 = "";
V20 = "";

OID1 = "";
OID2 = "";
OID3 = "";
OID4 = "";
OID5 = "";
OID6 = "";
OID7 = "";
OID8 = "";
OID9 = "";
OID10 = "";
OID11 = "";
OID12 = "";
OID13 = "";
OID14 = "";
OID15 = "";
OID16 = "";
OID17 = "";
OID18 = "";
OID19 = "";
OID20 = "";

// Flag to discard the trap, when set to TRUE.
DISCARD_TRAP = "FALSE";

// Flag to update the UserDefined[1-10] fields and EventText, upon CLEAR
// when set to TRUE.
UPDATE_USERDEF_FIELDS = "FALSE";

// Set this to TRUE, if you want to overwrite the ElementClass and ElementName
// NOTE: i.e Modifying the 'OccurredOn' Object.
// The object(ELEMENTCLASSNAME, ELEMENTNAME) should exist, otherwise
//       the trap will default to having Agent's Name, if it exisits in toplogy.
// ----------------------------------------------------------------------------
FORCE_OCCURREDON = "FALSE";

if (debug) { print("Running my_trap_rules.asl "); }

asciiTable = table();
asciiTable[32] = " ";
asciiTable[33] = "!";
asciiTable[34] = """;
asciiTable[35] = "#";
asciiTable[36] = "$";
asciiTable[37] = "%";
asciiTable[38] = "&";
asciiTable[39] = "'";
asciiTable[40] = "(";
asciiTable[41] = ")";
asciiTable[42] = "*";
asciiTable[43] = "+";
asciiTable[44] = ",";
asciiTable[45] = "-";
asciiTable[46] = ".";
asciiTable[47] = "/";
asciiTable[48] = "0";
asciiTable[49] = "1";
asciiTable[50] = "2";
asciiTable[51] = "3";
asciiTable[52] = "4";
asciiTable[53] = "5";
asciiTable[54] = "6";
asciiTable[55] = "7";
asciiTable[56] = "8";
asciiTable[57] = "9";
asciiTable[58] = ":";
asciiTable[59] = ";";
asciiTable[60] = "<";
asciiTable[61] = "=";
asciiTable[62] = ">";
asciiTable[63] = "?";
asciiTable[64] = "@";
asciiTable[65] = "A";
asciiTable[66] = "B";
asciiTable[67] = "C";
asciiTable[68] = "D";
asciiTable[69] = "E";
asciiTable[70] = "F";
asciiTable[71] = "G";
asciiTable[72] = "H";
asciiTable[73] = "I";
asciiTable[74] = "J";
asciiTable[75] = "K";
asciiTable[76] = "L";
asciiTable[77] = "M";
asciiTable[78] = "N";
asciiTable[79] = "O";
asciiTable[80] = "P";
asciiTable[81] = "Q";
asciiTable[82] = "R";
asciiTable[83] = "S";
asciiTable[84] = "T";
asciiTable[85] = "U";
asciiTable[86] = "V";
asciiTable[87] = "W";
asciiTable[88] = "X";
asciiTable[89] = "Y";
asciiTable[90] = "Z";
asciiTable[91] = "[";
asciiTable[92] = "";
asciiTable[93] = "]";
asciiTable[94] = "^";
asciiTable[95] = "_";
asciiTable[96] = "`";
asciiTable[97] = "a";
asciiTable[98] = "b";
asciiTable[99] = "c";
asciiTable[100] = "d";
asciiTable[101] = "e";
asciiTable[102] = "f";
asciiTable[103] = "g";
asciiTable[104] = "h";
asciiTable[105] = "i";
asciiTable[106] = "j";
asciiTable[107] = "k";
asciiTable[108] = "l";
asciiTable[109] = "m";
asciiTable[110] = "n";
asciiTable[111] = "o";
asciiTable[112] = "p";
asciiTable[113] = "q";
asciiTable[114] = "r";
asciiTable[115] = "s";
asciiTable[116] = "t";
asciiTable[117] = "u";
asciiTable[118] = "v";
asciiTable[119] = "w";
asciiTable[120] = "x";
asciiTable[121] = "y";
asciiTable[122] = "z";
asciiTable[123] = "{";
asciiTable[124] = """;
asciiTable[125] = "}";
asciiTable[126] = "~";

serverStateTable = table();
serverStateTable[1] = "outOfService";
serverStateTable[2] = "inService";
serverStateTable[3] = "failed";
serverStateTable[4] = "readyToTest";
serverStateTable[5] = "testing";
serverStateTable[6] = "maxConnsThrottle";
serverStateTable[7] = "maxClientsThrottle";
serverStateTable[8] = "dfpThrottle";
serverStateTable[9] = "probeFailed";
serverStateTable[10] = "probeTesting";
serverStateTable[11] = "operWait";
serverStateTable[12] = "testWait";
serverStateTable[13] = "inbandProbeFailed";
serverStateTable[14] = "returnCodeFailed";

intToChar(int)
do {
return asciiTable[int];
}

intToServerState(oidval)
do {
return serverStateTable[oidval];
}

START {
.. eol
} do {

// Default output is the same as input.

// Set attributes in ICS_Notification.  Add any more customizations here ...

PARSEOID(OID1);

if (debug) { print("Done with my_trap_rules.asl ");}
return;
}

PARSEOID(oid) {
input=oid;
trapOID: ".1.3.6.1.4.1.9.9.161.1.3.1.1.4."
slot: integer "."
serverNameInt: integer "."
intserverName: {rep(integer ".",serverNameInt-1) integer} "."
ipAddress: {rep(integer ".", 3) integer}
.. eol
}
do {
dserverNameIntOnly=list();
PARSESERVERNAME(intserverName);
serverName="";
foreach alpha ( dserverNameIntOnly ) {
serverName=serverName.intToChar(alpha);
}
if (debug) {
print("slot:".slot);
print("serverNameInt:".serverNameInt);
print("serverName:".serverName);
print("ipAddress:".ipAddress);
}
EVENTTEXT="CSM Slot:".slot." ".serverName." IP:".ipAddress." SlbRealServerState:". intToServerState(V1);

}

PARSESERVERNAME(intoid){
delim=".";
input=intoid;
rep(NUMBER) " eol
}

NUMBER {
x:word
}
do {
dserverNameIntOnly += x;
}

/*
* These variables describe the formatting of this file.  If you don't like the
* template defaults, feel free to change them here (not in your .emacs file).
*
* Local Variables:
* mode: C++
* End:
*/

Detectable by VMware SkylineTM

Actions

Copy

link to clipboard
copied!

Print

Language:
English

Attachments

Additional Resources

No results for undefined

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