Alexander Shikoff
2017-02-18 15:16:24 UTC
Hello!
I'm gathering counters from Juniper firewall filters.
JunOS provides instance IDs for such counters as text, for example:
jnxFWCounterByteCount."xe-0-0-3-counter-out"."vlan777-out".counter'
So I just put it in SNMP::VarList and then call SNMP::get().
It works, but the problem is that get() function modifies SNMP::Varbinds
and converts ID textual presentation to dotted.
Before get():
$VAR1 = bless( [
bless( [
'jnxFWCounterByteCount."xe-0-0-3-counter-out"."vlan777-out".counter'
], 'SNMP::Varbind' )
], 'SNMP::VarList' );
After get():
$VAR1 = bless( [
bless( [
'jnxFWCounterByteCount',
'20.120.101.45.48.45.48.45.51.45.99.111.117.110.116.101.114.45.111.117.116.11.118.108.97.110.55.55.55.45.111.117.116.2',
'138745492700486',
'COUNTER64'
], 'SNMP::Varbind' )
], 'SNMP::VarList' );
Is there a way to convert dotted form back to text, or to do not parse it?
Thanks!
I'm gathering counters from Juniper firewall filters.
JunOS provides instance IDs for such counters as text, for example:
jnxFWCounterByteCount."xe-0-0-3-counter-out"."vlan777-out".counter'
So I just put it in SNMP::VarList and then call SNMP::get().
It works, but the problem is that get() function modifies SNMP::Varbinds
and converts ID textual presentation to dotted.
Before get():
$VAR1 = bless( [
bless( [
'jnxFWCounterByteCount."xe-0-0-3-counter-out"."vlan777-out".counter'
], 'SNMP::Varbind' )
], 'SNMP::VarList' );
After get():
$VAR1 = bless( [
bless( [
'jnxFWCounterByteCount',
'20.120.101.45.48.45.48.45.51.45.99.111.117.110.116.101.114.45.111.117.116.11.118.108.97.110.55.55.55.45.111.117.116.2',
'138745492700486',
'COUNTER64'
], 'SNMP::Varbind' )
], 'SNMP::VarList' );
Is there a way to convert dotted form back to text, or to do not parse it?
Thanks!
--
MINO-RIPE
MINO-RIPE