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