Hi,
I have the following MIB and I am trying to
populate some of the variables(prtGeneralCurrentLocalization) let say
with some values (30).
I have used mib2c and create-data-set to generate the code's skeleton.
Before compiling and running the subagent:
if I do a snmpwalk on prtGeneralTable as following:
snmpwalk -v 1 -c public localhost prtGeneral
I
get nothing, no errors,....????? Does that mean that the rows are just
not there yet ? (other walks on other objects work fine)
If I now run the subagent I still have the same result.
Below is the code I use for initialization as well as the MIB used for this
purpose.
I hope someone will help. Thanks!
---------------------------------------------------------------
MIB
---------------------------------------------------------------
prtGeneralTable
+--prtGeneralEntry(1)
| Index: hrDeviceIndex
|
+-- -R-- Counter prtGeneralConfigChanges(1)
+-- -RW- Integer32 prtGeneralCurrentLocalization(2)
| Range: 1..65535
+-- -RW- EnumVal prtGeneralReset(3)
| Values: notResetting(3), powerCycleReset(4), resetToNVRAM(5),
resetToFactoryDefaults(6)
+-- -RW- String prtGeneralCurrentOperator(4)
| Size: 0..127
+-- -RW- String prtGeneralServicePerson(5)
| Size: 0..127
+-- -RW- Integer32 prtInputDefaultIndex(6)
| Range: 1..65535
+-- -RW- Integer32 prtOutputDefaultIndex(7)
+-- -RW- Integer32 prtMarkerDefaultIndex(8)
| Range: 1..65535
+-- -RW- Integer32 prtMediaPathDefaultIndex(9)
| Range: 1..65535
+-- -RW- Integer32 prtConsoleLocalization(10)
| Range: 1..65535
+-- -R-- Integer32 prtConsoleNumberOfDisplayLines(11)
| Range: 0..65535
+-- -R-- Integer32 prtConsoleNumberOfDisplayChars(12)
| Range: 0..65535
+-- -RW- EnumVal prtConsoleDisable(13)
Values: enabled(3), disabled(4)
-------------------------------
Init code from mib2c create-data-set
-------------------------------
/** Initialize the prtGeneralTable table by defining its contents and how it's
structured */
void initialize_table_prtGeneralTable(void)
{
static oid prtGeneralTable_oid[] = {1,3,6,1,2,1,43,5,1};
size_t prtGeneralTable_oid_len = OID_LENGTH(prtGeneralTable_oid);
netsnmp_table_data_set *table_set;
netsnmp_table_row *row;
/* create the table structure itself */
table_set = netsnmp_create_table_data_set("prtGeneralTable");
/* comment this out or delete if you don't support creation of new rows */
table_set->allow_creation = 1;
/***************************************************
* Adding indexes
*/
DEBUGMSGTL(("initialize_table_prtGeneralTable",
"adding indexes to table prtGeneralTable\n"));
netsnmp_table_set_add_indexes(table_set,
ASN_INTEGER, /* index: hrDeviceIndex */
0);
DEBUGMSGTL(("initialize_table_prtGeneralTable",
"adding column types to table prtGeneralTable\n"));
netsnmp_table_set_multi_add_default_row(table_set,
COLUMN_PRTGENERALCONFIGCHANGES,
ASN_COUNTER, 0,
NULL, 0,
COLUMN_PRTGENERALCURRENTLOCALIZATION, ASN_INTEGER, 1,
NULL, 0,
COLUMN_PRTGENERALRESET,
ASN_INTEGER, 1,
NULL, 0,
COLUMN_PRTGENERALCURRENTOPERATOR,
ASN_OCTET_STR, 1,
NULL, 0,
COLUMN_PRTGENERALSERVICEPERSON,
ASN_OCTET_STR, 1,
NULL, 0,
COLUMN_PRTINPUTDEFAULTINDEX,
ASN_INTEGER, 1,
NULL, 0,
COLUMN_PRTOUTPUTDEFAULTINDEX,
ASN_INTEGER, 1,
NULL, 0,
COLUMN_PRTMARKERDEFAULTINDEX,
ASN_INTEGER, 1,
NULL, 0,
COLUMN_PRTMEDIAPATHDEFAULTINDEX,
ASN_INTEGER, 1,
NULL, 0,
COLUMN_PRTCONSOLELOCALIZATION,
ASN_INTEGER, 1,
NULL, 0,
COLUMN_PRTCONSOLENUMBEROFDISPLAYLINES, ASN_INTEGER, 0,
NULL, 0,
COLUMN_PRTCONSOLENUMBEROFDISPLAYCHARS, ASN_INTEGER, 0,
NULL, 0,
COLUMN_PRTCONSOLEDISABLE,
ASN_INTEGER, 1,
NULL, 0,
0);
/* registering the table with the master agent */
/* note: if you don't need a subhandler to deal with any aspects
of the request, change prtGeneralTable_handler to "NULL" */
netsnmp_register_table_data_set(netsnmp_create_handler_registration("prtGeneralTable",
prtGeneralTable_handler,
prtGeneralTable_oid,
prtGeneralTable_oid_len,
HANDLER_CAN_RWRITE),
table_set, NULL);
row = netsnmp_create_table_data_row();
netsnmp_table_row_add_index(row, ASN_INTEGER, 1, 1);
netsnmp_set_row_column(row, 2, ASN_INTEGER,"3", 1);
netsnmp_mark_row_column_writable(row, 4, 1); /* make writable via
SETs */
netsnmp_table_dataset_add_row(table_set, row);
}
------------------------------------------------------------------------------
Enter the BlackBerry Developer Challenge
This is your chance to win up to $100,000 in prizes! For a limited time,
vendors submitting new applications to BlackBerry App World(TM) will have
the opportunity to enter the BlackBerry Developer Challenge. See full prize
details at: http://p.sf.net/sfu/Challenge
_______________________________________________
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