jlsemi / smartsnmp

Easily writing boring SNMP MIB with Lua.
GNU General Public License v2.0
91 stars 34 forks source link

There is no CPU, memory information of OpenWrt #51

Open tedaz opened 9 years ago

tedaz commented 9 years ago

Is there anything wrong or I should configuration by myself to enable smartsnmpd provide OpenWrt's CPU and memory information?

xfguo commented 9 years ago

Hi, @tedaz

The Openwrt package of smartsnmpd is at https://github.com/openwrt/packages/tree/master/net/smartsnmpd/. How did you install smartsnmpd, by opkg?

All the OpenWrt related MIB implementation is https://github.com/openwrt/packages/tree/master/net/smartsnmpd/files/mibs. We just impl interface and system MIBs for OpenWrt, and I think CPU and Memory info are not part of this. You can write the MIB if you like and we will happy to help you to implement them. The smartsnmp is under heavy development and we may try to implement CPU and Memory MIB after the 0.1 version is released.

Thanks!

tedaz commented 9 years ago

@xfguo Thanks for your reply and confirmation. Currently there are only 3 mibs, and CPU/memory information covered. I'm very happy to write the mib for CPU and memory, if it is not too complex. Where should I start?

begeekmyfriend commented 9 years ago

Hi @tedaz , you may start it with doc/how-to-write-mib-group.md and config/snmp.conf, and there are some examples in mibs directory. On OpenWRT you may use UCI or other components for system I/O. If any problem, please let us know. We will be glad to improve our documents for any user.

xfguo commented 9 years ago

@tedaz

https://github.com/credosemi/smartsnmp/blob/master/doc/how-to-write-mib-group.md this doc is a good start.

It is very simple to write a new MIB on WRT. Just install it using opkg from offical source, then you can use vi/nano create a new lua file on /usr/lib/lua/smartsnmp/mibs/, you will find other MIB nodes as example in that directory. To let snmpsnmpd load your MIB node, you need add a new config section in /etc/config/smartsnmpd then restart smartsnmpd service.

xfguo commented 9 years ago

@tedaz, I'm trying to implement the CPU/Memory MIB. I want to know which MIB standard you want to implement? I mean something like RFCxxxx... Thanks.

tedaz commented 9 years ago

I don't know the exact MIB standard, I'm using Orion Network Performance to monitor OpenWrt's CPU, memory usage, as well as network traffics.