Hi Guille,

sorry, I have no idea what a subhandler is.

But the HostTable MIB example is quit simple.
it parse /etc/host and show the contents, and you may modify, delete, and create new rows...

with a little love it works like that:

claus-kleins-macbook-pro:net-snmp clausklein$ snmptable -Cib -r0 -t 15 -v3 -n subagent localhost:4700 hoststable
SNMP table: NET-SNMP-EXAMPLES-MIB::netSnmpHostsTable

index AddressType Address Storage RowStatus \"loopback\" ipv6 "FE 80 00 01 00 00 00 00 00 00 00 00 00 00 00 01 " nonVolatile active \"ftpserver\" ipv6 "00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 01 " nonVolatile active \"localhost\" ipv4 "7F 00 00 01 " nonVolatile active \"broadcasthost\" ipv4 "FF FF FF FF " nonVolatile active \"claus-kleins-macbook-pro.local\" ipv4 "C0 A8 01 82 " nonVolatile active
claus-kleins-macbook-pro:net-snmp clausklein$ cat /etc/hosts
##
# Host Database
#
# localhost is used to configure the loopback interface
# when the system is booting.  Do not change this entry.
##
::1             ftpserver
127.0.0.1       localhost
255.255.255.255 broadcasthost
fe80::1%lo0     loopback
fe80::223:6cff:fe8c:45b1%en1    claus-kleins-macbook-pro.local
192.168.1.130   claus-kleins-macbook-pro.local
claus-kleins-macbook-pro:net-snmp clausklein$



Best Regards
Claus

On 21.01.2013, at 21:20, Guillermo Veneranda wrote:

Hi,
I'm reading the files examples/netSnmpHostsTable* but I find these quite difficult to understand, This is going to take a while. Maybe I should try something easier that use subhandler function.

Could you please show me a simple example of a subhandler function?

Thanks Claus
regards,
Guille


------------------------------------------------------------------------------
Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS,
MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current
with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft
MVPs and experts. SALE $99.99 this month only -- learn more at:
http://p.sf.net/sfu/learnmore_122412
_______________________________________________
Net-snmp-coders mailing list
Net-snmp-coders@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders

Reply via email to