• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

smithsnmp: SNMP agent for monitor

原作者: [db:作者] 来自: 网络 收藏 邀请

开源软件名称:

smithsnmp

开源软件地址:

https://gitee.com/begeekmyfriend/smithsnmp

开源软件介绍:

SmithSNMP -- Customize your private MIBs in Lua

Build Status

SmithSNMP is a fork from SmartSNMPwith more advanced features ahead such as SNMPv3, encryption and SNMPv2 trap.Just like the character in the famous science fiction movie Matrix, Agent Smith,with great power and is programmed to keep the system in order.

SmithSNMP is an easy-config agent supporting SNMP v1/v2c/v3 and AgentXprotocol. It is written in C99 and Lua5.1. It can be run on general Linux andBSD platforms as well as embedded systems like OpenWRT. The agent can not onlybe compatible with command utilities but also SNMPv2 trap daemon of Net-SNMP.

License

SmithSNMP is licensed under GPLv2 with "PRIVATE MIB" EXCEPTION, see LICENSEfile for more details.

Configuration

The biggest bonus of this agent is that private MIBs in Lua are allowed to becustomized and in hot-loading in config and mibs directory.

Build

As for Ubuntu, you should install libraries such as:

# lua5.1sudo apt-get install -y lua5.1 liblua5.1-0-dev# sconssudo apt-get install -y scons# luarockssudo apt-get install -y luarocks# clone with gitgit clone https://github.com/begeekmyfriend/smithsnmp.git

For more build options, type:

scons --help

You will get:

... SCons Options ...Local Options:  --with-agentx               enable agentx feature you want to use  --without-trap              disable trap feature you do not want to use  --without-crypto            disable crypto feature you do not want to use  --without-md5               disable MD5 feature you do not want to use  --without-sha               disable SHA feature you do not want to use  --without-aes               disable AES feature you do not want to use  --evloop=[select|kqueue|epoll]                              select event loop model  --with-cflags=CFLAGS        use CFLAGS as compile time arguments (will                                ignore CFLAGS env)  --with-ldflags=LDFLAGS      use LDFLAGS as link time arguments to ld (will                                ignore LDFLAGS env)  --with-libs=LIBS            use LIBS as link time arguments to ld  --with-liblua=DIR           use liblua in DIR

You can specify options above you need to build the project.

For luarocks build, type:

sudo luarocks build smithsnmp-scm-1.rockspec

Test

There are three test modes.

SNMP Agent Mode

In this mode the agent is running as an independent agent and process SNMPdatagrams from the clients.

Any SNMP daemon installed in your system should be shut down before testing.

sudo /etc/init.d/snmpd stop

We start SmithSNMP as a daemon:

cd /usr/local/lib/luarocks/rocks/smithsnmp/scm-1sudo ./tests/snmp_daemon.sh

And then run the testcases:

./tests/testcases.sh

AgentX agent mode

In this mode the agent is running as a sub-agent while Net-SNMP as themaster agent from which AgentX datagrams will be received. So we need todownload NET-SNMP-5.7.3 source and build out the images under testsdirectory:

cd /usr/local/lib/luarocks/rocks/smithsnmp/scm-1sudo ./tests/netsnmp_build.sh

And then start Net-SNMP as the master agent:

sudo ./tests/netsnmpd.sh

And then start SmithSNMP as a sub-agent:

sudo ./tests/agentx_daemon.sh

And then run the testcases:

./tests/testcases.sh

SNMP Trap Mode

Especially if you want to test SNMP trap feature, start snmptrapd on thedefault port 162:

cd /usr/local/lib/luarocks/rocks/smithsnmp/scm-1sudo ./tests/netsnmptrapd.sh

Now enable the trap feature when SmithSNMP is running as an agent on thedefault port 161):

snmpset -v2c -cprivate localhost .1.3.6.1.6.3.1.1.4.42.0 t 100

And you can disable the trap feature any time as you like:

snmpset -v2c -cprivate localhost .1.3.6.1.6.3.1.1.4.42.0 t 0

鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
热门推荐
热门话题
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap