Hi,
I'm trying to implement my own MIB and extend it by AgentX. But I can't read
nothing when i do a snmptable;
Output snmptable:berni@berni-tosh:~/TFM/MIBS$ snmptable -v 2c -m + -c public
localhost
DEVICE-ENTERPRISE-MIB::devicesTableDEVICE-ENTERPRISE-MIB::devicesTable: No
entries
Output from agentx:berni@berni-tosh:~/TFM/MIBS$ sudo ./devicesTable -f -L
-DdevicesTable,verbose:devicesTable,internal:devicesTableregistered debug token
devicesTable, 1registered debug token verbose:devicesTable, 1registered debug
token internal:devicesTable, 1Log handling defined - disabling
stderrverbose:devicesTable:init_devicesTable:
calledverbose:devicesTable:initialize_table_devicesTable:
calledinternal:devicesTable:_devicesTable_initialize_interface:
calledverbose:devicesTable:devicesTable_init_data:
calledinternal:devicesTable:_devicesTable_container_init:
calledverbose:devicesTable:devicesTable_container_init:
calleddevicesTable:init_devicesTable: Registering devicesTable as a
mibs-for-dummies table.NET-SNMP version 5.7.3 AgentX subagent connected
Output from netsnmp:berni@berni-tosh:~/TFM/MIBS$ Connection from UDP:
[127.0.0.1]:43344->[127.0.0.1]:161agentx/master: transport connect on session
0x2271160agentx/master: handle pdu
(req=0x19e32965,trans=0x0,sess=0x0)agentx/master: open 0x2271160agentx/master:
opened 0x228e740 = 10 with flags = a0agentx/master: send response, stat 0
(req=0x19e32965,trans=0x0,sess=0x0)agentx_build: packet built
okayagentx/master: handle pdu (req=0x19e32966,trans=0x0,sess=0xa)agentx/master:
in register_agentx_listagentx/master: registered ok
I've been created my subagent using mib2c with mfd config. As we can see
devicesTable_container_load(netsnmp_container *container) Is not launching when
I lauch snmptable. In devicesTable_container_load i placed my funcion that
populate my table:
while( sqlite3_step( stmt ) == SQLITE_ROW ) { deviceId =
sqlite3_column_int64( stmt, 0 ); deviceName = (const
char*)sqlite3_column_text( stmt, 1 ); createdTime =
sqlite3_column_int64( stmt, 2 ); lastUpdate = sqlite3_column_int64(
stmt, 3 ); maxSensorsRows = sqlite3_column_int64( stmt, 4 );
rowreq_ctx = devicesTable_allocate_rowreq_ctx(NULL); if (NULL ==
rowreq_ctx) { snmp_log(LOG_ERR, "memory allocation failed\n");
return MFD_RESOURCE_UNAVAILABLE; } if(MFD_SUCCESS !=
devicesTable_indexes_set(rowreq_ctx , deviceId
)) { snmp_log(LOG_ERR,"error setting index while loading
" "devicesTable data.\n");
devicesTable_release_rowreq_ctx(rowreq_ctx); continue; }
rowreq_ctx->data.creationTime =createdTime;
rowreq_ctx->data.lastUpdate = lastUpdate; strncpy (
rowreq_ctx->data.deviceName, deviceName, sizeof(rowreq_ctx->data.deviceName) );
rowreq_ctx->data.deviceName_len=strnlen(rowreq_ctx->data.deviceName,sizeof(rowreq_ctx->data.deviceName));
rowreq_ctx->data.maxSensorsRows =maxSensorsRows;
CONTAINER_INSERT(container, rowreq_ctx); ++count; }
------------------------------------------------------------------------------
Dive into the World of Parallel Programming. The Go Parallel Website,
sponsored by Intel and developed in partnership with Slashdot Media, is your
hub for all things parallel software development, from weekly thought
leadership blogs to news, videos, case studies, tutorials and more. Take a
look and join the conversation now. http://goparallel.sourceforge.net/
_______________________________________________
Net-snmp-users mailing list
Net-snmp-users@lists.sourceforge.net
Please see the following page to unsubscribe or change other options:
https://lists.sourceforge.net/lists/listinfo/net-snmp-users