Ad blocker detected: Our website is made possible by displaying online advertisements to our visitors. Please consider supporting us by disabling your ad blocker on our website.
Has anybody been able to get the VLAN information from HP Procurve swithces using the get_procurve_switch_ports function? I know it's designed for Procurve 4000 but I've modified it so I can get the port number and portname for 2500, 2600, 2800 and 5300 series but I can't get the VLAN info.
Looking into the log it seems that the VLAN info don't get inserted into the database (between the swtchname and the macaddress):
I've looked through most of this thread and still can't seem to find where to download mactrack from? Each time I think I've found it there is an edit that says outdated or something to that effect! Can someone let me know where to download this or what page it is on?
segelhof wrote:I've looked through most of this thread and still can't seem to find where to download mactrack from? Each time I think I've found it there is an edit that says outdated or something to that effect! Can someone let me know where to download this or what page it is on?
Thanks!
I shalt take pity on thy poor soul, and post the latest SVN of the Plugin version. Actually, no pity is involved... I'm just too lazy to go back through all the pages.
Ok, this may only apply to the version of MySQL I am using, but I will post it anyway. I have been having problems with certain ip_ranges not getting added to the cacti database. The errors I get when the 'poller_mactrack.php' runs are as follows:
05/04/2006 10:16:12 AM - CMDPHP: Poller[0] ERROR: SQL Exec Failed "REPLACE INTO `mac_track_ip_ranges` (ip_range, site_id, ips_current, ips_current_date) VALUES (10.1.200,2,10,2006-05-04 09:40:16)"
05/04/2006 10:16:12 AM - CMDPHP: Poller[0] ERROR: SQL Exec Failed "REPLACE INTO `mac_track_ip_ranges` (ip_range, site_id, ips_current, ips_current_date) VALUES (10.1.200,71,2,2006-05-04 09:40:16)"
05/04/2006 10:16:12 AM - CMDPHP: Poller[0] ERROR: SQL Exec Failed "REPLACE INTO `mac_track_ip_ranges` (ip_range, site_id, ips_current, ips_current_date) VALUES (10.1.201,2,63,2006-05-04 09:40:16)"
I grew tired of seeing the errors, and noticed that some of the sites where not displaying all assigned 'IP ranges' under the 'site ip range report'. long and short, I found that when the poller was doing the 'replace into' for the 'ip ranges' it found, the database was throwing errors. I duplicated this by hand as shown here:
mysql> REPLACE INTO `mac_track_ip_ranges` (ip_range, site_id, ips_current, ips_current_date) VALUES (10.101.101,2,84,2006-05-04 09:40:16);
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.101,2,84,2006-05-04 09:40:16)' at line 1
mysql>
I found that the only way this would work from the mysql command prompt is as follows:
05/04/2006 10:16:12 AM - CMDPHP: Poller[0] ERROR: SQL Exec Failed "REPLACE INTO `mac_track_ip_ranges` (ip_range, site_id, ips_current, ips_current_date) VALUES (10.1.200,2,10,2006-05-04 09:40:16)"
05/04/2006 10:16:12 AM - CMDPHP: Poller[0] ERROR: SQL Exec Failed "REPLACE INTO `mac_track_ip_ranges` (ip_range, site_id, ips_current, ips_current_date) VALUES (10.1.200,71,2,2006-05-04 09:40:16)"
05/04/2006 10:16:12 AM - CMDPHP: Poller[0] ERROR: SQL Exec Failed "REPLACE INTO `mac_track_ip_ranges` (ip_range, site_id, ips_current, ips_current_date) VALUES (10.1.201,2,63,2006-05-04 09:40:16)"
I grew tired of seeing the errors, and noticed that some of the sites where not displaying all assigned 'IP ranges' under the 'site ip range report'. long and short, I found that when the poller was doing the 'replace into' for the 'ip ranges' it found, the database was throwing errors. I duplicated this by hand as shown here:
In case you don't see the difference, it is the single quotes around each value '. I have attached a patched 'poller_macktrack.php' file which adds the single quotes to every 'replace into' statement - which fixed my problems. Now I am getting all of the 'ip ranges' at every site reported properly in the 'site ip range report' - and no more errors.
Hope this helps someone else.
BTW, I am using the following version of MySQL:
mysqladmin Ver 8.41 Distrib 5.0.18, for portbld-freebsd6.0 on i386
Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB
This software comes with ABSOLUTELY NO WARRANTY. This is free software,
and you are welcome to modify and redistribute it under the GPL license
Server version 5.0.18
Protocol version 10
Connection Localhost via UNIX socket
UNIX socket /tmp/mysql.sock
Uptime: 2 days 2 hours 33 min 11 sec
Threads: 8 Questions: 34507786 Slow queries: 0 Opens: 0 Flush tables: 1 Open tables: 55 Queries per second avg: 189.613
Could have swore I fixed this a while back, but I guess I forgot to commit it to SVN at the time. I have now updated SVN with the newest, and will update the posted archive above.
when i do :
php.exe -q mactrack_scanner.php -id=9 -d
i have this :
DEBUG: HOST: 192.168.0.107 is alive, processing has begun.
DEBUG: WARNING: SITE: MONUM, IP: 192.168.0.107, TYPE: HP J4813A ProCurve Switch 2524, revision, Device Type Not Found in Device Type Table.
DEBUG: SQL: UPDATE mac_track_devices SET ports_total='26',device_type_id='45',scan_type = '1',vlans_total='0',ports_active='6',ports_trunk='0',macs_active='17', snmp_readstring='munom',snmp_sysName='0801',snmp_sysLocation='Les egouts',snmp_sysContact='ADMINISTRATEUR',snmp_sysObjectID='.1.3.6.1.4.1.11.2.3.7.11.19',snmp_sysDescr='HP J4813A ProCurve Switch 2524, revision F.01.08, ROM F.01.01 (/sw/code/build/info(s00))',snmp_sysUptime='852035114',snmp_status='4',last_runmessage='
WARNING: Device Type Not Found in Device Type table.',last_rundate='2006-05-09 12:07:35',last_runduration='0.1238' WHERE device_id ='9'
i have created 2 lines in table mac_track_device_types, one with 2524 and another with J4813A (scanning_function : get_generic_switch_ports)
i have found a solution :
i put this line
$device = call_user_func_array("get_generic_switch_ports", array($site, $device, $device_type["lowPort"], $device_type["highPort"]));
after this :
$device_type = find_scanning_function($device, $device_types);
Skept wrote:hi guys, i am getting the same error as qwuertz. any ideas on how to resolve it?
have you ran the database_upgrade.php script?
Hello,
database_upgrade solved the errors for me, but the scheduled scanning still doesn't happen.
poller_mactrack invoked manually and everything's OK and IP's are gathered.
B.t.w. I'm using cmd.php and not cactid, could that be the matter?
Thanks for the info. database_upgrade.php solved the problem. Now, I am wondering if it is possible to extend this to linux based siwtches and routers? For example, I do know that snmpd on linux routers saves recently connected host ip macs pairs in .1.3.6.1.2.1.3.1.1.2 I would appreciate any pointers on this.
Skept wrote:Thanks for the info. database_upgrade.php solved the problem. Now, I am wondering if it is possible to extend this to linux based siwtches and routers? For example, I do know that snmpd on linux routers saves recently connected host ip macs pairs in .1.3.6.1.2.1.3.1.1.2 I would appreciate any pointers on this.
try a device type with a scanning fuction of 'get generic switch ports' and the oid you think it is.
chadd, thanks for the tip. I have tried that and have created a device type with my oid. but after adding a new device, it still recognizes it as .1.3.6.1.4.1.8072.3.2.10 [the default one, i mean].
PHP Notice: Undefined index: url_path in /var/www/html/mactrack/include/top_mactrack_header.php on line 52,
PHP Notice: Undefined index: url_path in /var/www/html/mactrack/include/top_mactrack_header.php on line 53,
PHP Notice: Undefined index: url_path in /var/www/html/mactrack/include/top_mactrack_header.php on line 65,
PHP Notice: Undefined index: url_path in /var/www/html/mactrack/include/top_mactrack_header.php on line 65,
PHP Notice: Undefined index: url_path in /var/www/html/mactrack/include/top_mactrack_header.php on line 66,
PHP Notice: Undefined index: url_path in /var/www/html/mactrack/include/top_mactrack_header.php on line 66,
I resolved it by modifying the url_path in those lines with the http:// address.
However.. One issue still kept coming into the error_log when I clicked on the "Mactrack" tab.
PHP Fatal error: Call to undefined function: do_hook() in /var/www/html/mactrack/include/top_mactrack_header.php on line 67
System is:
Fedora Core release 3 (Heidelberg)
PHP 4.3.9 (cgi) (built: Oct 20 2004 14:52:04)
Copyright (c) 1997-2004 The PHP Group
Zend Engine v1.3.0, Copyright (c) 1998-2004 Zend Technologies
This is perl, v5.8.5 built for i386-linux-thread-multi
Not being a PHP guru, is there such a function in PHP 4? What will upgrading to PHP 5 do to existing scripts.
I have Cacti 0.8.6h in 2 Instances. One straight up Cacti, the other Mactrack. Each with its own Databases.
I also have cacti-cactid-0.8.6g
The MySql version is 3.23.58.
I have run database_upgrade.php on the Mactrack Database..
I was having some "path" issues with a few of the files, mainly with mactrack_view.php, but I corrected those.
any help would be appreciated with this little error.