[TODO] No IP addresses shown from HP ProCurve Switch 4108GL

Support questions about the MAC Track plugin

Moderators: Developers, Moderators

Post Reply
User avatar
rdleeuw
Posts: 8
Joined: Thu Jan 25, 2007 2:26 pm
Location: Netherlands

[TODO] No IP addresses shown from HP ProCurve Switch 4108GL

Post by rdleeuw »

Hello,

I took me the better part of a day to get MAC Track working (on Windows, Cacti 0.8.6.j).
Finally I got MAC-addresses which seem to resemble reality, but no IP addresses are shown.

Code: Select all

D:\inetpub\wwwroot\cacti\plugins\mactrack>php  mactrack_scanner.php -id=1 -d
DEBUG: HOST: 172.18.1.80 is alive, processing has begun.
DEBUG: Scanning function is 'get_generic_switch_ports'
DEBUG: ifIndexes data collection complete
DEBUG: ifTypes data collection complete.
DEBUG: ifNames data collection complete.
DEBUG: ipAddrTable scanning for link ports data collection complete.
DEBUG: ifInterfaces assembly complete.
INFO: HOST: 172.18.1.80, TYPE: HP J4865A ProCurve Switch 4108GL, revisi, TOTAL P
ORTS: 0, OPER PORTS: 0
DEBUG: No user ports on this network.
DEBUG: SQL: UPDATE mac_track_devices SET ports_total='0',device_type_id='44',sca
n_type = '1',vlans_total='0',ports_active='0',ports_trunk='0',macs_active='0',sn
mp_readstring='dmx2mrtg',snmp_sysName='dmxsw01.dmxnet.local',snmp_sysLocation=''
,snmp_sysContact='',snmp_sysObjectID='.1.3.6.1.4.1
.11.2.3.7.11.23',snmp_sysDescr='HP J4865A ProCurve Switch 4108GL, revision G.07.
99, ROM G.05.02 (/sw/code/build/gamo(m03))',snmp_sysUptime='25970622',snmp_statu
s='3',last_runmessage='Data collection completed ok',last_rundate='2007-01-25 21
:39:54',last_runduration='0.4437' WHERE device_id ='1'
The HP switch has a very standard config (only 1 default VLAN, SNMP configured and that's about it).

Do I need to use one of the included patched files (snmp.php)? If anyone needs more info/debugging, I'll be glad to post it.

Thanks,

Ronald

P.S. Keep up the good work with MAC Track, this certainly is one of the best plugins!

| Cacti 0.8.6j |
| MySQL 5.0.27 | PHP 5.1.6 | IIS 6 | RRDtool 1.2.15 | Cygwin 1.5.22 |
| Windows 2003 Server Standard R2 | P4 HT 3.2GHz | 512MB |
jamespca
Posts: 8
Joined: Thu Dec 21, 2006 11:12 am

Post by jamespca »

Which scanning function did you use? The "get_procurve_switch_ports" didn't work at all for me so I had to use the generic one. But like you I only see the MAC addresses, nothing else, not even a single vlan. I have tried this on the procurve 2800 series so far.
User avatar
TheWitness
Developer
Posts: 17047
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Post by TheWitness »

Someone with a lot of Procurves will have to familiarize themselves with the process of collecting data and contribute some scanning functions for HP.

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?
jamespca
Posts: 8
Joined: Thu Dec 21, 2006 11:12 am

Post by jamespca »

snmpwalk-ing the switch I noticed that there is nothing under: .1.3.6.1.4.1.11.5.1.3 so there must be some other OIDs needed. Once again this is by looking at the 2800 family of procurves (J4903A and J4904A) with firmware I.08.105.

Edit:
In mactrack_hp.php I replaced:
- the OID in $vlan_ids with: .1.3.6.1.4.1.11.2.14.11.5.1.7.1.15.1.1.1
- the OID in $ifNames with: .1.3.6.1.2.1.31.1.1.1.18 -> this is where the port "friendly names" are (the ifAlias).

There is a bunch of vlan information under .1.3.6.1.4.1.11.2.14.11.5.1.7 but I was not able to find the MIB for it.

So far I have the correct number of vlans show up in the Device Report, also all the port names show up in all reports. What I still don't have is any vlan information about an individual port.

One thought: the Trunk Ports column should probably be renamed to something else since trunk means port aggregation and the number represents the switch uplinks instead which are not necessarily aggregated. Single uplinks are counted as a trunk basically.
[b]Cacti[/b] - 0.8.6j; [b]Plugin Architecture[/b] - 1.1; [b]Poller Type[/b] - Cactid v0.8.6i; [b]Web Server[/b] - Apache/2.2.3 (Win32) PHP/5.2.0; [b]MySQL[/b] - 5.0.27; [b]RRDTool[/b] - 1.2.15; [b]SNMP[/b] - Net-SNMP 5.4
User avatar
TheWitness
Developer
Posts: 17047
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Post by TheWitness »

James,

Instead of "changing" the fields, replicate the collection function and give it a new name. Then make your corrections. Once that is done, you simply have to associate the correct device types with the correct scanning functions (like the one you just created).

When are satisfied that your work is done:

1) Export your device type table and publish it
2) Post your functions_hp.php file for everyone else.

Thanks,

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?
jamespca
Posts: 8
Joined: Thu Dec 21, 2006 11:12 am

Post by jamespca »

Thanks for the advice! I am far from being a php expert but I'll give it a try and see how it goes. Once I test everything to work with the 2800s I will post my results.
[b]Cacti[/b] - 0.8.6j; [b]Plugin Architecture[/b] - 1.1; [b]Poller Type[/b] - Cactid v0.8.6i; [b]Web Server[/b] - Apache/2.2.3 (Win32) PHP/5.2.0; [b]MySQL[/b] - 5.0.27; [b]RRDTool[/b] - 1.2.15; [b]SNMP[/b] - Net-SNMP 5.4
jorgan
Posts: 3
Joined: Wed Dec 28, 2005 4:30 am
Location: Near the Northpole

HP ProCurve mibs

Post by jorgan »

1.3.6.1.2.1.4.22.1.2
IP-MIB::ipNetToMediaPhysAddress.391.192.13.14.15 = STRING: ab:ba:ab:ba:ab:ba

now we have:
.391. - a "virtualport number for a vlan"
macaddress
ipaddress


1.3.6.1.2.1.17.4.3.1.2
snmpwalk -On
.1.3.6.1.2.1.17.4.3.1.2.0.48.5.138.93.130 = INTEGER: 5
without -On
(BRIDGE-MIB::dot1dTpFdbPort.'.P..>P' = INTEGER: 15) - Will give somekinda binary output

now we have:
0.48.5.138.93.130 = macadress in integer form.
portnumber for the macaddress


1.3.6.1.4.1.11.2.14.11.5.1.7.1.15.3.1.2
HP-ICF-OID::hpConfig.1.15.3.1.2.120.82 = INTEGER: 82

now we have:
vlanid - .120.
portnumber - .82 and INTEGER: 82


1.3.6.1.2.1.31.1.1.1.1
IF-MIB::ifName.140 = STRING: F10

now we have:
.140 - portnumber = F10 (module F port 10) (for Procurves with only numeric numbers the 140 would be port 140)

1.3.6.1.2.1.47.1.2.1.1.2
SNMPv2-SMI::mib-2.47.1.2.1.1.2.101 = STRING: "Nowhere"

vlanid .101 = vlanname Nowhere...



I thought i would share my knowledge of what different mibs does and try to get this procurve support going forward :)


/Jorgan
bambid
Posts: 23
Joined: Thu Nov 02, 2006 3:10 am

Post by bambid »

Hi,
any progress in this topic ? I have only ProCurve switches and will be very happy if we manage to get ProCurve switches work in MacTrack.

I have bunch of 2650-PWR, 2824 and 3500yl switches. Maybe I can contribute to this effort.
David
User avatar
floaty
Posts: 21
Joined: Tue Mar 06, 2007 10:27 am

procurve vlan-port-info

Post by floaty »

vlan-info added, but i got problems to implement the real vlan-name in the script (zero-niente php-skills) ... don't forget your backup

the oid's for the vlan-names starts with:

.1.3.6.1.2.1.17.7.1.4.3.1.1

add script "mactrack_hp_ng.php" in ./plugin/mactrack/lib

Code: Select all

<?php
/*
 +-------------------------------------------------------------------------+
 | Copyright (C) 2005-2007 Larry Adams                                     |
 |                                                                         |
 | This program is free software; you can redistribute it and/or           |
 | modify it under the terms of the GNU General Public License             |
 | as published by the Free Software Foundation; either version 2          |
 | of the License, or (at your option) any later version.                  |
 |                                                                         |
 | This program is distributed in the hope that it will be useful,         |
 | but WITHOUT ANY WARRANTY; without even the implied warranty of          |
 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the           |
 | GNU General Public License for more details.                            |
 +-------------------------------------------------------------------------+
*/

/* register this functions scanning functions */
if (!isset($mactrack_scanning_functions)) { $mactrack_scanning_functions = array(); }
array_push($mactrack_scanning_functions, "get_procurve_ng_switch_ports");

/* get_procurve_ng_switch_ports
        obtains port associations for HP Procurve Switches.  Designed after the
        ProCurve J8164A Switch 2626-PWR

*/
function get_procurve_ng_switch_ports($site, &$device, $lowPort = 0, $highPort = 0) {
        global $debug, $scan_date;

        /* initialize port counters */
        $device["ports_total"] = 0;
        $device["ports_active"] = 0;
        $device["ports_trunk"] = 0;

        /* get VLAN information */
        $vlan_ids = xform_standard_indexed_data(".1.3.6.1.4.1.11.2.14.11.5.1.7.1.15.1.1.1", $device);

        /* get VLAN Trunk status */
        $vlan_trunkstatus = xform_standard_indexed_data(".1.3.6.1.4.1.11.2.14.11.5.1.7.1.15.3.1.1.1.25", $device);
        $device["vlans_total"] = sizeof($vlan_ids);
        mactrack_debug("VLAN data collected. There are " . (sizeof($vlan_ids)) . " VLANS.");

        /* get the ifIndexes for the device */
        $ifIndexes = xform_standard_indexed_data(".1.3.6.1.2.1.2.2.1.1", $device);
        mactrack_debug("ifIndexes data collection complete");

        /* get and store the interfaces table */
        $ifInterfaces = build_InterfacesTable($device, $ifIndexes, TRUE, FALSE);

        foreach($ifIndexes as $ifIndex) {
                $ifInterfaces[$ifIndex]["trunkPortState"] = @$vlan_trunkstatus[$ifIndex];

                if (($ifInterfaces[$ifIndex]["ifType"] >= 6) && ($ifInterfaces[$ifIndex]["ifType"] <= 9)) {
                        $device["ports_total"]++;
                }

                if ($ifInterfaces[$ifIndex]["trunkPortState"] == 3) {
                        $device["ports_trunk"]++;
                }
        }
        mactrack_debug("ifInterfaces assembly complete.");

        $i = 0;
        foreach($vlan_ids as $vlan_id => $vlan_name) {
                $active_vlans[$i]["vlan_id"] = $vlan_id;
                $active_vlans[$i]["vlan_name"] = $vlan_name;
                $active_vlans++;

                $i++;
        }

        if (sizeof($active_vlans) > 0) {
                $i = 0;
                /* get the port status information */
                $port_results = get_base_dot1dTpFdbEntry_ports($site, $device, $ifInterfaces, "", "", FALSE);
                $port_vlan_data = xform_standard_indexed_data(".1.3.6.1.2.1.17.7.1.4.5.1.1", $device);

                $i = 0;
                $j = 0;
                $port_array = array();
                foreach($port_results as $port_result) {
                        $ifIndex = $port_result["port_number"];
                        $ifType = $ifInterfaces[$ifIndex]["ifType"];
                        $ifName = $ifInterfaces[$ifIndex]["ifName"];
                        $portName = $ifName;
                        $portTrunkStatus = @$ifInterfaces[$ifIndex]["trunkPortState"];

                        /* only output legitamate end user ports */
                        if (($ifType >= 6) && ($ifType <= 9)) {
                                $port_array[$i]["vlan_id"] = @$port_vlan_data[$port_result["port_number"]];
                                $port_array[$i]["vlan_name"] = @$vlan_ids[$port_array[$i]["vlan_id"]];
                                $port_array[$i]["port_number"] = @$port_result["port_number"];
                                $port_array[$i]["port_name"] = $portName;
                                $port_array[$i]["mac_address"] = $port_result["mac_address"];
                                $device["ports_active"]++;

                                mactrack_debug("VLAN: " . $port_array[$i]["vlan_id"] . ", " .
                                        "NAME: " . $port_array[$i]["vlan_name"] . ", " .
                                        "PORT: " . $ifIndex . ", " .
                                        "NAME: " . $port_array[$i]["port_name"] . ", " .
                                        "MAC: " . $port_array[$i]["mac_address"]);

                                $i++;
                        }
                        $j++;
                }

                /* display completion message */
                print("INFO: HOST: " . $device["hostname"] . ", TYPE: " . substr($device["snmp_sysDescr"],0,40) . ", TOTAL PORTS: " . $device["ports_total"] . ", ACTIVE PORTS: " . $device["ports_active"]);
                $device["last_runmessage"] = "Data collection completed ok";
                $device["macs_active"] = sizeof($port_array);
                db_store_device_port_results($device, $port_array, $scan_date);
        }else{
                print("INFO: HOST: " . $device["hostname"] . ", TYPE: " . substr($device["snmp_sysDescr"],0,40) . ", No active devcies on this network device.");
                $device["snmp_status"] = HOST_UP;
                $device["last_runmessage"] = "Data collection completed ok. No active devices on this network device.";
        }

        return $device;
}
?>
and register in ./mactrack/lib/mactrack_vendors.php ...:

Code: Select all

<?php
/*
 +-------------------------------------------------------------------------+
 | Copyright (C) 2005 Larry Adams                                          |
 |                                                                         |
 | This program is free software; you can redistribute it and/or           |
 | modify it under the terms of the GNU General Public License             |
 | as published by the Free Software Foundation; either version 2          |
 | of the License, or (at your option) any later version.                  |
 |                                                                         |
 | This program is distributed in the hope that it will be useful,         |
 | but WITHOUT ANY WARRANTY; without even the implied warranty of          |
 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the           |
 | GNU General Public License for more details.                            |
 +-------------------------------------------------------------------------+
*/

include_once($config["base_path"] . "/plugins/mactrack/lib/mactrack_cabletron.php");
include_once($config["base_path"] . "/plugins/mactrack/lib/mactrack_cisco.php");
include_once($config["base_path"] . "/plugins/mactrack/lib/mactrack_norbay.php");
include_once($config["base_path"] . "/plugins/mactrack/lib/mactrack_hp.php");
include_once($config["base_path"] . "/plugins/mactrack/lib/mactrack_hp_ng.php");

?>
Attachments
mactrack.png
mactrack.png (24.08 KiB) Viewed 17805 times
tommyj
Posts: 43
Joined: Thu Jun 23, 2005 5:16 pm
Location: Stockholm, Sweden

Post by tommyj »

Thanks for this floaty.
I tested it on the 2524, 2600, 2800, 5300 and 5400 series of Procurves and they all work. I simply changed VLAN info from

Code: Select all

$vlan_ids = xform_standard_indexed_data(".1.3.6.1.4.1.11.2.14.11.5.1.7.1.15.1.1.1", $device);
to

Code: Select all

$vlan_ids = xform_standard_indexed_data(".1.3.6.1.2.1.17.7.1.4.3.1.1", $device);
and got both VLAN id and name.
The only thing I would like to have now is IfName and IfAlias instead of IfIndex, anybody know how to do this?
jamespca
Posts: 8
Joined: Thu Dec 21, 2006 11:12 am

Post by jamespca »

In order to get the ifAlias change the ifNames line to:

$ifNames = xform_standard_indexed_data(".1.3.6.1.2.1.31.1.1.1.18", $device);

Having the ifAlias instead of ifIndex does help a lot with the HP switches if you use port friendly names.
[b]Cacti[/b] - 0.8.6j; [b]Plugin Architecture[/b] - 1.1; [b]Poller Type[/b] - Cactid v0.8.6i; [b]Web Server[/b] - Apache/2.2.3 (Win32) PHP/5.2.0; [b]MySQL[/b] - 5.0.27; [b]RRDTool[/b] - 1.2.15; [b]SNMP[/b] - Net-SNMP 5.4
tommyj
Posts: 43
Joined: Thu Jun 23, 2005 5:16 pm
Location: Stockholm, Sweden

Post by tommyj »

jamespca wrote:In order to get the ifAlias change the ifNames line to:

$ifNames = xform_standard_indexed_data(".1.3.6.1.2.1.31.1.1.1.18", $device);

Having the ifAlias instead of ifIndex does help a lot with the HP switches if you use port friendly names.
Yes it works in the original mactrack_hp.php but it's not included in floatys script above, how can I add that? Sorry, but I have no php-knowledge..
KAA
Posts: 7
Joined: Sun Apr 08, 2007 2:05 pm
Location: Russia

Post by KAA »

tommyj wrote:
Yes it works in the original mactrack_hp.php but it's not included in floatys script above, how can I add that? Sorry, but I have no php-knowledge..
/* get the port status information */
$ifNames = xform_standard_indexed_data(".1.3.6.1.2.1.31.1.1.1.18", $device);
$port_results = get_base_dot1dTpFdbEntry_ports($site, $device, $ifInterfaces, "", "", FALSE);
$port_vlan_data = xform_standard_indexed_data(".1.3.6.1.2.1.17.7.1.4.5.1.1", $device);
and
$port_array[$i]["port_number"] = @$port_result["port_number"];
// $port_array[$i]["port_name"] = $portName;
$port_array[$i]["port_name"] = @$ifNames[$port_result["port_number"]];

$port_array[$i]["mac_address"] = $port_result["mac_address"];
$device["ports_active"]++;
works for me with hp2626 and hp2810
User avatar
TheWitness
Developer
Posts: 17047
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Post by TheWitness »

Did anyone here get a modified HP Scanning function. If so, post it. I am working on 2.0 and would like to incorporate it.

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?
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests