# SNMP in rails

**URL:** <https://www.ruby-forum.com/t/snmp-in-rails/181801>\
**Category:** Rails\
**Created:** [January 18, 2010, 3:00pm UTC](https://www.ruby-forum.com/t/snmp-in-rails/181801 "2010-01-18T15:00:27Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![atheeq](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/3be4f8/32.png) [@atheeq](https://www.ruby-forum.com/u/atheeq)\
**Post date:** [January 18, 2010, 3:00pm UTC](https://www.ruby-forum.com/t/snmp-in-rails/181801/1 "2010-01-18T15:00:27Z")

</div>

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’] = xx.xx.xx.xx //contains an IP address.  
$row[‘snmp\_community\_str’] = 6xrt3bY //stores the community string  
$row[‘reset\_port’] = 66 //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

$status=snmpget($row[‘address’],$row[‘snmp\_community\_str’],$oid.".".$row[‘reset\_port’]);

Any help will be appreciated… thnx in advance:)
