Brian,

awesome!

thank you,

Derek B. Smith
OhioHealth IT
UNIX / TSM / EDM Teams




                                                                           
             [EMAIL PROTECTED]                                             
             rum-health.org                                                
                                                                        To 
             02/16/2005 09:11          beginners@perl.org                  
             AM                                                         cc 
                                                                           
                                                                   Subject 
                                       RE: snmp requests CORRECTED!        
                                                                           
                                                                           
                                                                           
                                                                           
                                                                           
                                                                           




HI. There's really two parts you need to have for a snmp get request. The
first part is the object identifier (OID). This is the long string of
numbers. The second part is the instance number. That is the zero at the
end
you're asking about.

.iso.org.dod.internet.mgmt.mib-2.interfaces.ifNumber.0
<------------------------OID----------------------->.<-Instance->

Every MIB object has at least one instance number. Some have multiple. If
you move up the tree a little bit to:

.iso.org.dod.internet.mgmt.mib-2.interfaces.ifTable.ifEntry.ifOperStatus

Here you are likely to have multiple instances. In my case I have 4
instances, one for each interface on my server:

.iso.org.dod.internet.mgmt.mib-2.interfaces.ifTable.ifEntry.ifOperStatus.1
:
down
                                                                         2
:
up
                                                                         3
:
down
                                                                         4
:
up

Now here's the confusing part. The instance number does not show up in the
MIB map because it is assigned dynamically by the snmp agent running on
your
device, and the instance number can change if your device setup changes. In
other words, if I have a snmp object that represents CPU utilization, and
my
server only has one CPU, I will only have one instance for that snmp
object.
If a year from now I add a second CPU, the snmp agent will add a second
instance dynamically. So the instance number is really governed by the snmp
agent running on the device you are querying and not the MIB map.

Let me know if this helps.

- Brian

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: Tuesday, February 15, 2005 4:52 PM
To: 'Perl Beginners '
Subject: snmp requests CORRECTED!



All,

to get the number of interfaces via a snmp call from a perl program I would
say:

get_request("1.3.6.1.2.1.2.1.0");

After referencing the MIB, I can follow the path to interfaces, but I get
lost at 0 as there is no 0 on the MIB map.
Is there another map?

BEGIN
- - - - - - - -
iso 1
org 3
dod 6
internet 1
mgmt 2
mib-2 1
interfaces 2

- - - - - - - -
END



Derek B. Smith
OhioHealth IT
UNIX / TSM / EDM Teams



--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>





-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to