Hi dave, Yes, I am able to walk thru the MIB and get the details. And I am testing this on my own machine. The PDU is of type SNMP_GET.
//////// pdu = snmp_pdu_create(SNMP_MSG_GET); /////// Now my question is how to get the details like hard disc drives, running processes etc..since the OIDs will be having a number appenede to the standard OIDs like host.hrStorage.hrStorageTable.hrStorageEntry.hrStorageDescr.1 //for drive 1 Ex c:/ host.hrStorage.hrStorageTable.hrStorageEntry.hrStorageDescr.2 //for drive 2 Ex d:/ And we will not be knowing how many drives are there and how many processes are running. Thanks Harish -----Original Message----- From: [email protected] [mailto:[email protected]] On Behalf Of Dave Shield Sent: Monday, February 23, 2009 5:17 PM To: Sathyanarayana Murthy, Harish Kolar Cc: [email protected] Subject: Re: Help Required on Net-SNMP 2009/2/23 Sathyanarayana Murthy, Harish Kolar <[email protected]>: > Now i am looking to get details like list of running processes and > list of hard disk storage drives etc.. but not able to achieve this. > > I know the OID text corresposning to them like > > H/W disk storage drives : > "host.hrStorage.hrStorageTable.hrStorageEntry.hrStorageDescr.*" > running processes : > "host.hrStorage.hrStorageTable.hrStorageEntry.hrStorageDescr.*" The first thing to check is whether the remote agent actually supports this information. Try running the command-line application "snmpwalk" on these objects, and verify that you see the expected results. > i am using the following code to read these values > > //////////////// > get_node("host.hrStorage.hrStorageTable.hrStorageEntry.hrStorageDescr. > *", anOID, &anOID_len);//using a wild char here You can't use a wildcard here. SNMP requests work with specific OIDs - not fuzzy ones. You can only request a single item of information - either the one specified (a GET request) or the "next" one (a GETNEXT request). But in both cases, the request takes a single fixed OID to start from. [ Please could no-one muddy the waters by talking about GETBULK just yet! Thanks ] > snmp_add_null_var(pdu, anOID, anOID_len); What type of pdu is this? You don't say. If you're trying to get more than one value, then you'll need to send more than one request. Have a look at the code for the "snmpwalk" command, to see the sort of thing that you'll need to do. Dave ------------------------------------------------------------------------------ Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA -OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise -Strategies to boost innovation and cut costs with open source participation -Receive a $600 discount off the registration fee with the source code: SFAD http://p.sf.net/sfu/XcvMzF8H _______________________________________________ Net-snmp-coders mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/net-snmp-coders
