08-15-2016 10:55 PM
Hello,
The command
show event manager detector snmp-notification detailed
shows me a lot of accessible variables like a $_event_id or $_snmp_notif_oid.
Applet Built-in Environment Variables:
$_event_id
$_job_id
$_event_type
$_event_type_string
$_event_pub_time
$_event_pub_sec
$_event_pub_msec
$_event_severity
$_snmp_notif_oid
$_snmp_notif_oid_val
$_snmp_notif_src_ip_addr
$_snmp_notif_dest_ip_addr
$_x_x_x_x_x_x (varbinds)
$_snmp_notif_trap_oid
$_snmp_notif_ent_oid
$_snmp_notif_gen_trap
$_snmp_notif_spec_trap
Among them are we can see some $_x_x_x_x_x_x (varbinds) environment variables, if I understand correctly its a dynamically created variables which includes SNMP PDU varbinds. How can I get access to this variables from my TCL\applet? I didn’t found any information about it from public manuals.
Many thanks for any help!
Solved! Go to Solution.
08-16-2016 07:57 AM
Yes, they are dynamically created based on the varbinds, but they are almost impossible to access from applets since you have to know the full varbind (including any instance values). Because of this, I use Tcl for any policies in which I need to access varbind details like this. Here is a Tcl example of accessing the varbind variables:
array set arr_einfo [event_reqinfo]
set vb {}
foreach key [array names arr_einfo] {
if { [regexp {1_3_6_1_4_1_9_10_91_1_2_3_1_11_} $key] } {
set vb $key
break
}
}
08-16-2016 07:57 AM
Yes, they are dynamically created based on the varbinds, but they are almost impossible to access from applets since you have to know the full varbind (including any instance values). Because of this, I use Tcl for any policies in which I need to access varbind details like this. Here is a Tcl example of accessing the varbind variables:
array set arr_einfo [event_reqinfo]
set vb {}
foreach key [array names arr_einfo] {
if { [regexp {1_3_6_1_4_1_9_10_91_1_2_3_1_11_} $key] } {
set vb $key
break
}
}
Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community: