Virus2500 has asked for the wisdom of the Perl Monks concerning the following question:
maybe it is impossible or at least i have no clue how to solve this myself :)
I am trying to load a config file in yaml style (which works). However in the yaml file are some constants which i want to get "translated" by Net::SNMP.
I tried it with an has before which worked a treat
my $snmpConf = ( '.1.3.6.1.4.1.1918.2.13.10.30.80.1.110.2' => { type => INTEGER + , 'value' => '1' }, );
This is the line in the yaml file
Reading the values via the oid by snmpget is no problem at all..1.3.6.1.4.1.1918.2.13.10.30.80.1.110.2: type: INTEGER value: "1"
However afaik Net::SNMP translates the bareword INTEGER into an integer value... right?
But when i now want to set an variable via snmp it needs to know the type and then it seems like it doesn't get translated to the value anymore.
Results inforeach $oid ( keys $snmpConf) { $snmp_session->set_request (-varbindlist => [$oid, $snmpConf->{$oid}{t +ype}, $snmpConf->{$oid}{value}]); ....
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Use hash variable as constant
by kcott (Archbishop) on Jun 27, 2014 at 15:50 UTC | |
|
Re: Use hash variable as constant
by Virus2500 (Initiate) on Jun 27, 2014 at 12:37 UTC | |
by kcott (Archbishop) on Jun 27, 2014 at 16:21 UTC | |
|
Re: Use hash variable as constant
by RonW (Parson) on Jun 27, 2014 at 16:34 UTC | |
by Virus2500 (Initiate) on Jun 27, 2014 at 19:29 UTC |