Greetings,
I'm creating a more or less 'dashboard' where people can enter the
server name, then I'll snmpget a bunch of different oids and show the
status of the device.

Now the problem is snmpget doesn't allow multiple OIDs in one go, so I
have to snmpget(server, community, oid1);, snmpget(server, community,
oid2);, snmpget(server, community, oid3);, etc etc.

I can't always use snmpwalkoid(), especially on really long trees where
I only need 4-5 different items. 

So how would you handle this? And array of OIDs and a foreach? Just
curious as to what people suggest, as I'm very new to PHP but.. Oddly
falling in love with it fast.

Also, another question since I'm on the topic.

If I know that an snmpwalkoid will always return a set number of values,
I make an array with my 'table of contents' and then use array_combine
to take the keys from my ToC with the values from the returned walk.
Now, with certain things (Like the Compaq logical disk oids) it will
return a varied amount of things, such as 2 logical drives, 3 logical
drives, etc.

Now, would it work if I did something like this? 
Create my 'table of contents' key array, Snmpwalkoid(), then move
through both at once and dump it to a new array:
Since the key from the snmpwalkoid() is the OID, I'd have my ToC matched
against the key in the walk array and essentially do string matching
So if .cpqDaPhyDrvModel.0.128 is found, it puts "Drive Model: " as the
key then it looks at the next OID in the array and sees it is
.cpqDaPhyDrvModel.0.129, so it puts it in as "Drive Model 2: ".

I hope you guys are getting this. It's so clear in my head!
I'm telling you, I use a half dozen languages here because I have to, as
glue between systems, and the 2 things that always get me are arrays and
map/hashes. Some day I hope to figure this out!
 

Jeremy Pavleck 
Sr. Network Engineer  - Systems Management 
IT Networks and Infrastructure 
Capella University

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to