首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > Ruby Rails >

关于?????????????ΞЧ? - sendto(2)的有关问题,ruby snmp

2012-11-08 
关于???????????????ΞЧ?? - sendto(2)的问题,ruby snmp运行程序出错结果如下:Errno::EADDRNOTAVAIL in Adm

关于???????????????ΞЧ?? - sendto(2)的问题,ruby snmp
运行程序出错结果如下:

Errno::EADDRNOTAVAIL in AdminController#index4 ???????????????ΞЧ?? - sendto(2)RAILS_ROOT: ./script/../config/..Application Trace | Framework Trace | Full Trace D:/InstantRails/ruby/lib/ruby/site_ruby/1.8/snmp/manager.rb:34:in `send'D:/InstantRails/ruby/lib/ruby/site_ruby/1.8/snmp/manager.rb:34:in `send'D:/InstantRails/ruby/lib/ruby/site_ruby/1.8/snmp/manager.rb:478:in `send_request'D:/InstantRails/ruby/lib/ruby/site_ruby/1.8/snmp/manager.rb:462:in `try_request'D:/InstantRails/ruby/lib/ruby/site_ruby/1.8/snmp/manager.rb:461:in `times'D:/InstantRails/ruby/lib/ruby/site_ruby/1.8/snmp/manager.rb:461:in `try_request'D:/InstantRails/ruby/lib/ruby/site_ruby/1.8/snmp/manager.rb:205:in `get'D:/InstantRails/ruby/lib/ruby/site_ruby/1.8/snmp/manager.rb:226:in `get_value'C:/Documents and Settings/Administrator/My Documents/NetBeansProjects/RubyGoOn/RubyGoOn/app/models/modem.rb:63:in `getmac'C:/Documents and Settings/Administrator/My Documents/NetBeansProjects/RubyGoOn/RubyGoOn/app/models/modem.rb:62:in `getmac'C:/Documents and Settings/Administrator/My Documents/NetBeansProjects/RubyGoOn/RubyGoOn/app/controllers/admin_controller.rb:20:in `index4'C:/Documents and Settings/Administrator/My Documents/NetBeansProjects/RubyGoOn/RubyGoOn/app/controllers/admin_controller.rb:20:in `collect!'C:/Documents and Settings/Administrator/My Documents/NetBeansProjects/RubyGoOn/RubyGoOn/app/controllers/admin_controller.rb:20:in `index4'


其实是因为snmp的manager在执行对modem的snmpget的时候出错了。
因为在读取modem信息的时候,应该注意有三种情况:
1,cmts头端里面根本没有这个Modem的注册信息,就是说Modem可能从来没注册过,或者已经给注销了。只要注册过的modem都会留有一个ID。
2,modem注册过,也就是合法的,但是不在线。
3,modem在线。

对于以上三种情况,第一种会导致返回错误信息,也许是noinstarnt啊之类的,需要进行判定,否则会出错。
D:/InstantRails/ruby/lib/ruby/site_ruby/1.8/snmp/manager.rb:34:in `send'

针对第一第二种,可以采用直接给记录赋值(全部都是‘0’)然后return,跳出方法,进行下一个modem的snmpget。

热点排行