You have traps with up to 28 or 30 varbinds but the TRAP OI processes only up to 20 varbinds.
You would like to customize the appropriate ASL script to populate the additional event attributes.
This article provides detailed instructions on how to extend the trap_mgr_parse.asl script to handle a higher number of varbinds, such as up to 30 (which will cover the requested 28 varbinds).
All Supported Smarts releases
By default, the VMware Smart Assurance Trap Adapter, through the trap_mgr_parse.asl script, is configured to process and expose a maximum of 20 varbinds (V1 through V20) from incoming SNMP traps to subsequent ASL scripts.
Customers often encounter traps that contain more than 20 varbinds (e.g., up to 28, 30, or more). When such traps are received, any varbinds beyond the 20th will not be parsed or made available as Vxx or OIDxx variables, preventing other ASL scripts from populating event attributes based on these additional varbinds.
if (defined(Varbinds[18])) {
persistentAdapter->setVariable("V19", Varbinds[18]) ? IGNORE;
persistentAdapter->setVariable("OID19", Oids[18]) ? IGNORE;
}
if (defined(Varbinds[19])) {
persistentAdapter->setVariable("V20", Varbinds[19]) ? IGNORE;
persistentAdapter->setVariable("OID20", Oids[19]) ? IGNORE;
}
To allow the Trap Adapter to process more than 20 varbinds, you need to manually edit the trap_mgr_parse.asl file to:
Let's assume you want to extend varbind processing up to 30 varbinds.
1. Locate and Open trap_mgr_parse.asl:
Navigate to the appropriate directory (preferably in the /local/rules/) and open trap_mgr_parse.asl in a text editor (e.g., vi, nano).
2. Add Variable Declarations (Vxx and OIDxx):
Scroll down to the section where persistentAdapter->setVariable calls declare the V and OID variables. This section typically looks like this (search for "V20"):
persistentAdapter->setVariable("V18", "") ? IGNORE;persistentAdapter->setVariable("OID18", "") ? IGNORE;persistentAdapter->setVariable("V19", "") ? IGNORE;persistentAdapter->setVariable("OID19", "") ? IGNORE;persistentAdapter->setVariable("V20", "") ? IGNORE;persistentAdapter->setVariable("OID20", "") ? IGNORE;Below the existing V20 and OID20 declarations, add lines for V21 through V30 and OID21 through OID30:
// --- START: Custom Varbind Declarations (21-30) ---persistentAdapter->setVariable("V21", "") ? IGNORE;persistentAdapter->setVariable("OID21", "") ? IGNORE;persistentAdapter->setVariable("V22", "") ? IGNORE;persistentAdapter->setVariable("OID22", "") ? IGNORE;persistentAdapter->setVariable("V23", "") ? IGNORE;persistentAdapter->setVariable("OID23", "") ? IGNORE;persistentAdapter->setVariable("V24", "") ? IGNORE;persistentAdapter->setVariable("OID24", "") ? IGNORE;persistentAdapter->setVariable("V25", "") ? IGNORE;persistentAdapter->setVariable("OID25", "") ? IGNORE;persistentAdapter->setVariable("V26", "") ? IGNORE;persistentAdapter->setVariable("OID26", "") ? IGNORE;persistentAdapter->setVariable("V27", "") ? IGNORE;persistentAdapter->setVariable("OID27", "") ? IGNORE;persistentAdapter->setVariable("V28", "") ? IGNORE;persistentAdapter->setVariable("OID28", "") ? IGNORE;persistentAdapter->setVariable("V29", "") ? IGNORE;persistentAdapter->setVariable("OID29", "") ? IGNORE;persistentAdapter->setVariable("V30", "") ? IGNORE;persistentAdapter->setVariable("OID30", "") ? IGNORE;// --- END: Custom Varbind Declarations (21-30) ---
3. Add Conditional Assignment Logic:
Scroll further down to the section where the if (defined(Varbinds[N])) blocks assign the varbind values. This section typically looks like this (search for "if (defined(Varbinds[19]))"):
if (defined(Varbinds[18])) { persistentAdapter->setVariable("V19", Varbinds[18]) ? IGNORE; persistentAdapter->setVariable("OID19", Oids[18]) ? IGNORE; } if (defined(Varbinds[19])) { persistentAdapter->setVariable("V20", Varbinds[19]) ? IGNORE; persistentAdapter->setVariable("OID20", Oids[19]) ? IGNORE; }Below the existing if (defined(Varbinds[19])) block, add similar blocks for Varbinds[20] through Varbinds[29] (which correspond to V21 through V30):
// --- START: Custom Varbind Assignments (21-30) --- if (defined(Varbinds[20])) { persistentAdapter->setVariable("V21", Varbinds[20]) ? IGNORE; persistentAdapter->setVariable("OID21", Oids[20]) ? IGNORE; } if (defined(Varbinds[21])) { persistentAdapter->setVariable("V22", Varbinds[21]) ? IGNORE; persistentAdapter->setVariable("OID22", Oids[21]) ? IGNORE; } if (defined(Varbinds[22])) { persistentAdapter->setVariable("V23", Varbinds[22]) ? IGNORE; persistentAdapter->setVariable("OID23", Oids[22]) ? IGNORE; } if (defined(Varbinds[23])) { persistentAdapter->setVariable("V24", Varbinds[23]) ? IGNORE; persistentAdapter->setVariable("OID24", Oids[23]) ? IGNORE; } if (defined(Varbinds[24])) { persistentAdapter->setVariable("V25", Varbinds[24]) ? IGNORE; persistentAdapter->setVariable("OID25", Oids[24]) ? IGNORE; } if (defined(Varbinds[25])) { persistentAdapter->setVariable("V26", Varbinds[25]) ? IGNORE; persistentAdapter->setVariable("OID26", Oids[25]) ? IGNORE; } if (defined(Varbinds[26])) { persistentAdapter->setVariable("V27", Varbinds[26]) ? IGNORE; persistentAdapter->setVariable("OID27", Oids[26]) ? IGNORE; } if (defined(Varbinds[27])) { persistentAdapter->setVariable("V28", Varbinds[27]) ? IGNORE; persistentAdapter->setVariable("OID28", Oids[27]) ? IGNORE; } if (defined(Varbinds[28])) { persistentAdapter->setVariable("V29", Varbinds[28]) ? IGNORE; persistentAdapter->setVariable("OID29", Oids[28]) ? IGNORE; } if (defined(Varbinds[29])) { persistentAdapter->setVariable("V30", Varbinds[29]) ? IGNORE; persistentAdapter->setVariable("OID30", Oids[29]) ? IGNORE; } // --- END: Custom Varbind Assignments (21-30) ---
4. Save the trap_mgr_parse.asl file.
For the changes to take effect, the Trap Adapter service needs to be restarted.
Restart the Trap Adapter Service
sm_service stop <TrapAdapter_Domain_Name> & sm_service start <TrapAdapter_Domain_Name> sm_service stop INCHARGE-SA_TRAP & sm_service start INCHARGE-SA_TRAP
Troubleshooting