|
|
| Author |
Message |
dagonet Cacti User
Joined: 29 Oct 2005 Posts: 74 Location: Wuerzburg
|
Posted: Mon Mar 03, 2008 2:26 pm Post subject: return values of ifTypes |
|
|
Hello everybody,
I hope someone can shed some light of this:
foreach($active_ports_array as $port_info)
{
if (($ifInterfaces[$indexes[$i]]["ifType"] >= 6) && ($ifInterfaces[$indexes[$i]]["ifType"] <= 9))
{
if ($port_info == 1)
{
$ports_active++;
}
$ports_total++;
}
$i++;
}
This is a code snippet of the mactrack_cabletron.php. I took it as an example. As you can see the ifType is compared against integers. But when I query the ifType OID I got always an array that looks like this:
Array
(
[1] => ethernetCsmacd(6)
[2] => ethernetCsmacd(6)
[3] => ethernetCsmacd(6)
[4] => ethernetCsmacd(6)
[5] => ethernetCsmacd(6)
[6] => ethernetCsmacd(6)
[7] => ethernetCsmacd(6)
[8] => ethernetCsmacd(6)
[9] => ethernetCsmacd(6)
...
)
So that's it what make me thinking. Obviously the array contains strings, but I haven't found anything in the mactrack code, that looks like a conversion part.
Any help is appriciated. I do the writting for extreme switches right know and that drives me realy craisy.
Regards
Dagonet |
|
| Back to top |
|
 |
dagonet Cacti User
Joined: 29 Oct 2005 Posts: 74 Location: Wuerzburg
|
Posted: Sat Apr 05, 2008 8:09 am Post subject: |
|
|
| Thanks for not helping. |
|
| Back to top |
|
 |
TheWitness Developer
Joined: 14 May 2002 Posts: 9255 Location: MI, USA
|
Posted: Sat Apr 05, 2008 11:34 am Post subject: |
|
|
Dude, chill. The problem here requires me to ask a few questions. Oh, and I keep trying to "make" time to get back to this.
1) What version of PHP are you using, you "SHOULD" be using PHP 5.1++ as it contains a nice new feature.
2) Do you have php_snmp enabled? I need to know that?
3) Are you using the binary mode net-snmp? If so, what version.
The bottom line is that net-snmp should be returning the "numeric" equiv and it is not. We have to find why it is not. The information you provided above, will help answer that. I would like to get to the bottom of it before you upgrade PHP by the way. So, the ball is back in your court.
Larry |
|
| Back to top |
|
 |
|