--001485f03c922f18c1047d714da9
Content-Type: text/plain; charset=ISO-8859-1

Hello,
You should use: net/snmp library for ruby and get and set methods of SNMP
Manager.
http://snmplib.rubyforge.org/
I'm guessing that the first snmpset command is used to reset port status (i
is iterator - you can have
many ports to reset - just a guess).
The second command snmpget is used to read port reset status.
Could you provide more source code ?



2010/1/18 Atheeq Pasha <atheeq / carmatec.com>

>
>
> Hello,
>
> Can any one please help me in converting this php code into ruby on
> rails?
>
>
>
> $oid  1.3.6.1.4.1.318.1.1.12.3.3.1.1.4';
> $row['address']  x.xx.xx.xx         //contains an IP address.
> $row['snmp_community_str']  xrt3bY  //stores the community string
> $row['reset_port']  6               //stores a port number
> where '3' is immediate reboot
>
>
>
>  snmpset($row['address'],$row['snmp_community_str'],$oid.".".$row['reset_port'],'i','3');
>   .......
>   .......
>   .......
>
> I have no idea of what 'i' is..
>
> and
>
>
> $statusmpget($row['address'],$row['snmp_community_str'],$oid.".".$row['reset_port']);
>
>
> Any help will be appreciated.. thnx in advance:)
> --
> Posted via http://www.ruby-forum.com/.
>
>


-- 
trednu / gmail.com

--001485f03c922f18c1047d714da9--