Cacti (home)ForumsRepositoryDocumentation
Cacti: offical forums and support  

 FAQFAQ   SearchSearch   MemberlistMemberlist    RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in    


No IP addresses shown from HP ProCurve Switch 4108GL

 
Post new topic   Reply to topic    Cacti Forum Index -> Plugin: (MAC Track)
Author Message
rdleeuw



Joined: 25 Jan 2007
Posts: 8
Location: Netherlands

PostPosted: Thu Jan 25, 2007 4:01 pm    Post subject: No IP addresses shown from HP ProCurve Switch 4108GL Reply with quote

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:

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 |
Back to top
jamespca



Joined: 21 Dec 2006
Posts: 8

PostPosted: Thu Feb 22, 2007 10:54 am    Post subject: Reply with quote

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.
Back to top
TheWitness
Developer


Joined: 14 May 2002
Posts: 9671
Location: MI, USA

PostPosted: Thu Feb 22, 2007 8:28 pm    Post subject: Reply with quote

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
Back to top
jamespca



Joined: 21 Dec 2006
Posts: 8

PostPosted: Thu Feb 22, 2007 10:56 pm    Post subject: Reply with quote

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.
Back to top
TheWitness
Developer


Joined: 14 May 2002
Posts: 9671
Location: MI, USA

PostPosted: Fri Feb 23, 2007 6:48 am    Post subject: Reply with quote

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
Back to top
jamespca



Joined: 21 Dec 2006
Posts: 8

PostPosted: Fri Feb 23, 2007 11:41 am    Post subject: Reply with quote

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.
Back to top
jorgan



Joined: 28 Dec 2005
Posts: 3
Location: Near the Northpole

PostPosted: Mon Feb 26, 2007 2:56 am    Post subject: HP ProCurve mibs Reply with quote

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
Back to top
bambid



Joined: 02 Nov 2006
Posts: 22

PostPosted: Wed Mar 07, 2007 6:20 am    Post subject: Reply with quote

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.
Back to top
floaty



Joined: 06 Mar 2007
Posts: 7

PostPosted: Mon Mar 19, 2007 8:56 pm    Post subject: procurve vlan-port-info Reply with quote

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:

<?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:

<?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");

?>



mactrack.png
 Description:
 Filesize:  24.08 KB
 Viewed:  5867 Time(s)

mactrack.png


Back to top
tommyj



Joined: 23 Jun 2005
Posts: 32
Location: Stockholm, Sweden

PostPosted: Sat Mar 24, 2007 2:05 am    Post subject: Reply with quote

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:
$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:
$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?
Back to top
jamespca



Joined: 21 Dec 2006
Posts: 8

PostPosted: Wed Mar 28, 2007 12:58 pm    Post subject: Reply with quote

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.
Back to top
tommyj



Joined: 23 Jun 2005
Posts: 32
Location: Stockholm, Sweden

PostPosted: Thu Mar 29, 2007 12:52 am    Post subject: Reply with quote

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..
Back to top
KAA



Joined: 08 Apr 2007
Posts: 7
Location: Russia

PostPosted: Sun Apr 08, 2007 2:11 pm    Post subject: Reply with quote

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..


Quote:

/* 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
Quote:

$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
Back to top
Display posts from previous:   
Post new topic   Reply to topic    Cacti Forum Index -> Plugin: (MAC Track) All times are GMT - 5 Hours
Page 1 of 1

 



Powered by phpBB © 2001, 2005 phpBB Group