[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Getting SNMP data in variable instead of using puts

jackster the jackle

2/6/2008 7:35:00 PM

I'm trying to access my variable directly here rather than using puts to
print it out. Can anyone tell me the easiest way to access it from the
variable?

ipadd = ARGV[0]
columns = ["ifDescr"]
SNMP::Manager.open(:Host => ipadd, :Community => "877pricelineHOBO" ) do
|m|
m.walk(columns) { |row| puts row.join("\t") }
end

thanks

jackster
--
Posted via http://www.ruby-....

2 Answers

Todd Benson

2/7/2008 12:46:00 AM

0

On Feb 6, 2008 1:35 PM, jackster the jackle <contact@thirdorder.net> wrote:
> I'm trying to access my variable directly here rather than using puts to
> print it out. Can anyone tell me the easiest way to access it from the
> variable?

Can't test right now because I don't have a device/system using SNMP
handy, but, thinking it's simply a scoping issue...

>
> ipadd = ARGV[0]
> columns = ["ifDescr"]

ifDescr = []

> SNMP::Manager.open(:Host => ipadd, :Community => "877pricelineHOBO" ) do
> |m|

m.walk(columns) { |row| ifDescr << row.join("\t") }

> end

puts ifDescr


Todd

jackster the jackle

2/7/2008 9:47:00 PM

0

Thanks alot Todd...I'm in good shape...

jackster



Todd Benson wrote:
> On Feb 6, 2008 1:35 PM, jackster the jackle <contact@thirdorder.net>
> wrote:
>> I'm trying to access my variable directly here rather than using puts to
>> print it out. Can anyone tell me the easiest way to access it from the
>> variable?
>
> Can't test right now because I don't have a device/system using SNMP
> handy, but, thinking it's simply a scoping issue...
>
>>
>> ipadd = ARGV[0]
>> columns = ["ifDescr"]
>
> ifDescr = []
>
>> SNMP::Manager.open(:Host => ipadd, :Community => "877pricelineHOBO" ) do
>> |m|
>
> m.walk(columns) { |row| ifDescr << row.join("\t") }
>
>> end
>
> puts ifDescr
>
>
> Todd

--
Posted via http://www.ruby-....