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
[SOLVED] return values of ifTypes
Moderators: Developers, Moderators
- TheWitness
- Developer
- Posts: 17047
- Joined: Tue May 14, 2002 5:08 pm
- Location: MI, USA
- Contact:
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
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
True understanding begins only when we realize how little we truly understand...
Life is an adventure, let yours begin with Cacti!
Author of dozens of Cacti plugins and customization's. Advocate of LAMP, MariaDB, IBM Spectrum LSF and the world of batch. Creator of IBM Spectrum RTM, author of quite a bit of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Percona Device Packages (no support)
Interesting Device Packages
For those wondering, I'm still here, but lost in the shadows. Yearning for less bugs. Who want's a Cacti 1.3/2.0? Streams anyone?
Life is an adventure, let yours begin with Cacti!
Author of dozens of Cacti plugins and customization's. Advocate of LAMP, MariaDB, IBM Spectrum LSF and the world of batch. Creator of IBM Spectrum RTM, author of quite a bit of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Percona Device Packages (no support)
Interesting Device Packages
For those wondering, I'm still here, but lost in the shadows. Yearning for less bugs. Who want's a Cacti 1.3/2.0? Streams anyone?
I am experiencing the same problem. I have added a debug line in to determine what values are being returned and I am indeed seeing ifType's of ethernetCsmacd(6)
I use Net-SNMP on Ubuntu 8.04.
snmpwalk -V:
NET-SNMP version: 5.4.1
php -v
PHP 5.2.4-2ubuntu5.4 with Suhosin-Patch 0.9.6.2 (cli) (built: Nov 25 2008 22:10:31)
Copyright (c) 1997-2007 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2007 Zend Technologies
I have installed the php5-snmp package from Ubuntu, however I am not sure if it is functioning, I haven't attempted to toy with that much.
The device I'm scanning is: WS-C6509-E
Thank you for any help...
Jim
I use Net-SNMP on Ubuntu 8.04.
snmpwalk -V:
NET-SNMP version: 5.4.1
php -v
PHP 5.2.4-2ubuntu5.4 with Suhosin-Patch 0.9.6.2 (cli) (built: Nov 25 2008 22:10:31)
Copyright (c) 1997-2007 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2007 Zend Technologies
I have installed the php5-snmp package from Ubuntu, however I am not sure if it is functioning, I haven't attempted to toy with that much.
Code: Select all
# snmpwalk -v 2c -c mycommunity mydevice .1.3.6.1.2.1.2.2.1.3
IF-MIB::ifType.1 = INTEGER: ethernetCsmacd(6)
IF-MIB::ifType.2 = INTEGER: ethernetCsmacd(6)
IF-MIB::ifType.3 = INTEGER: ethernetCsmacd(6)
IF-MIB::ifType.4 = INTEGER: ethernetCsmacd(6)
IF-MIB::ifType.5 = INTEGER: ethernetCsmacd(6)
IF-MIB::ifType.6 = INTEGER: ethernetCsmacd(6)
IF-MIB::ifType.7 = INTEGER: ethernetCsmacd(6)
IF-MIB::ifType.8 = INTEGER: ethernetCsmacd(6)
IF-MIB::ifType.9 = INTEGER: ethernetCsmacd(6)
IF-MIB::ifType.10 = INTEGER: ethernetCsmacd(6)
Thank you for any help...
Jim
- TheWitness
- Developer
- Posts: 17047
- Joined: Tue May 14, 2002 5:08 pm
- Location: MI, USA
- Contact:
Please see the announcement in this sub forum. There is a change in PHP that needs to be accounted for. A patch is attached there.
TheWitness
TheWitness
True understanding begins only when we realize how little we truly understand...
Life is an adventure, let yours begin with Cacti!
Author of dozens of Cacti plugins and customization's. Advocate of LAMP, MariaDB, IBM Spectrum LSF and the world of batch. Creator of IBM Spectrum RTM, author of quite a bit of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Percona Device Packages (no support)
Interesting Device Packages
For those wondering, I'm still here, but lost in the shadows. Yearning for less bugs. Who want's a Cacti 1.3/2.0? Streams anyone?
Life is an adventure, let yours begin with Cacti!
Author of dozens of Cacti plugins and customization's. Advocate of LAMP, MariaDB, IBM Spectrum LSF and the world of batch. Creator of IBM Spectrum RTM, author of quite a bit of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Percona Device Packages (no support)
Interesting Device Packages
For those wondering, I'm still here, but lost in the shadows. Yearning for less bugs. Who want's a Cacti 1.3/2.0? Streams anyone?
Who is online
Users browsing this forum: No registered users and 1 guest