惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

J
Java Code Geeks
GbyAI
GbyAI
Google DeepMind News
Google DeepMind News
Jina AI
Jina AI
B
Blog
aimingoo的专栏
aimingoo的专栏
酷 壳 – CoolShell
酷 壳 – CoolShell
T
The Blog of Author Tim Ferriss
Last Week in AI
Last Week in AI
月光博客
月光博客
H
Help Net Security
V
Visual Studio Blog
量子位
A
About on SuperTechFans
博客园 - Franky
人人都是产品经理
人人都是产品经理
N
Netflix TechBlog - Medium
云风的 BLOG
云风的 BLOG
雷峰网
雷峰网
Martin Fowler
Martin Fowler
Microsoft Security Blog
Microsoft Security Blog
博客园 - 叶小钗
P
Proofpoint News Feed
MongoDB | Blog
MongoDB | Blog

博客园 - slaughter

java api下载网站 国外好的软件测试网站 watir,ruby版本查看方法 - slaughter - 博客园 Watir隐藏IE运行的方法 Ruby对MS Access的操作 Eclipse下安装RDT (转)什么是Unicode?什么是UTF-8?(1) Ruby的库路径 - slaughter - 博客园 Ruby对于串口的设置实例 - slaughter - 博客园 职业选择(转) ruby编码中碰到的一个诡异问题 - slaughter - 博客园 java读写文件(转) 在Java中操纵UDP(转) 在Java中使用UDP协议编程的相关类(转) 终于给宝宝确定了名字 RFT的对象识别技术 Ruby设置IE不可见 VC对EXCEL操作 Ruby转exe方法(转)
ruby下snmp-trap发包实例 - slaughter - 博客园
slaughter · 2008-08-27 · via 博客园 - slaughter

今天简单写了个ruby下的trap发包,如下:

require 'snmp'
include SNMP

varbind = VarBind.new("1.3.6.1.2.1.1.5.0", OctetString.new("System Name"))

SNMP::Manager.open(:Host => "192.168.203.166",:Version => :SNMPv1) do |snmp|
    snmp.trap_v1(
     "enterprises.9",
      "192.168.203.25",
      :enterpriseSpecific,
       42,
      12345,
      varbind)

 end