Cacti / plugin_mactrack

Mactrack Plugin for Cacti
GNU General Public License v2.0
12 stars 25 forks source link

Device: UNKNOWN #93

Closed xefil closed 6 years ago

xefil commented 6 years ago

Hello,

I've installed last version of mactrack on Cacti 1.1.38. Trying to scan a device manually from cli /usr/bin/php -q /data/cacti/plugins/mactrack/mactrack_scanner.php -id=4 -d, it starts to collect all informations, but on the interface the device still is in UNKNOWN status. Why? It ends correctly... If I check the database, seems that the interface tables are popolated and related to the device id, but something is not working as expected. How to check - debug?

Thanks, Simon

xefil commented 6 years ago

Looking on the query done during Interface browsing in MacTrack, it needs to associate the device to the device type, otherwise it dosn't take the infos out:

SELECT mac_track_interfaces.*, mac_track_device_types.description AS device_type, mac_track_devices.device_name, mac_track_devices.host_id, mac_track_devices.disabled, mac_track_devices.last_rundate FROM mac_track_interfaces INNER JOIN mac_track_devices ON mac_track_interfaces.device_id=mac_track_devices.device_id INNER JOIN mac_track_device_types ON mac_track_device_types.device_type_id=mac_track_devices.device_type_id WHERE mac_track_interfaces.device_id=8 ORDER BYdevice_nameASC

The issue is on the mac_track_device_types association, which is empty. Is there a too/way to test those associations without executing every time the poller/scanner? It takes every time 5-10 minutes.

The device is a Cisco 7200:

snmpwalk -On -c tux -v 2c myhost system   
.1.3.6.1.2.1.1.1.0 = STRING: Cisco IOS Software, s72033_rp Software (s72033_rp-ADVENTERPRISEK9_WAN-M), Version 12.2(33)SXI7, RELEASE SOFTWARE (fc1)
Technical Support: http://www.cisco.com/techsupport
Copyright (c) 1986-2011 by Cisco Systems, Inc.
Compiled Mon 18-Jul-11 05:49 by pr
.1.3.6.1.2.1.1.2.0 = OID: .1.3.6.1.4.1.9.1.657
.1.3.6.1.2.1.1.3.0 = Timeticks: (973242160) 112 days, 15:27:01.60
.1.3.6.1.2.1.1.4.0 = STRING: \"CUT\"
.1.3.6.1.2.1.1.5.0 = STRING: CUT
.1.3.6.1.2.1.1.6.0 = STRING: \"DataCenter\"
.1.3.6.1.2.1.1.7.0 = INTEGER: 78
.1.3.6.1.2.1.1.8.0 = Timeticks: (0) 0:00:00.00

I'm putting the string s72033_rp on System Description Match but won't work for association. As Vendor Object ID Match .1.3.6.1.4.1.9

Thanks, Simon

jpobeda commented 6 years ago

@xefil Can you please post an screenshot of your device_type settings and how did you set this device? switch/hub, router?

If possible provide the debug output, suppress only sensitive data, don't bother to hide RFC1918

xefil commented 6 years ago

Hello,

Here the pics, thanks!

Simon

cacti03 cacti02 cacti01

jpobeda commented 6 years ago

@xefil , sorry the delay

OK, to start with, I'd change IP Address Scanning function to get_standard_arp_table because I don't you're running DHCP Snooping on your router, are you?

image

Secondly

Change 802.1x Scanning function to Not Applicable . Are you running dot1x on your router?

image

Once you've done all those changes, go to Configuration/Settings/Device Tracking

And post an screenshot of your settings

image

After that, go to Tracking tools/View device Tracking process status and post an screenshot of that

image

And we'll see from there. If it runs fine from cli, it should work and it's likely to be some setting causing it.

xefil commented 6 years ago

Hello,

Settings corrected. Here the screens you are asking:

cacti07 cacti06 cacti05

cacti04

I can see the process seems hangs. How to test it manually?

jpobeda commented 6 years ago

@xefil Don't try to fly before learning to walk =O

Disable Perform reverse DNS name resolution and then change your Scanning frequency FROM 12 HOURS to the minimum.

And let it run. Don't do it from the cli because you already know it works from cli, problem comes when cacti's poller calls Mactrack's poller and all the rest of the settings come to play, nor to say when it's so badly configured lol

Another thing is, I'd recommend new mactrack devices to be imported from Cacti, and by doing that you don't need to specify an SNMP community because it gets it from the import process.

After 10-15 min after it should have run, post the status screenshots again

xefil commented 6 years ago

Hello, Done, dns disabled and the plugin now tries every 10 minutes. Two devices now are in ERROR. I'm seeing a lot of errors like:

26/10/2018 17:38:34 - ERROR PHP NOTICE in  Plugin 'mactrack': Undefined offset: 2652 in file: /data/cacti/plugins/mactrack/lib/mactrack_cisco.php  on line: 342
26/10/2018 17:38:34 - CMDPHP PHP ERROR NOTICE Backtrace: (/plugins/mactrack/mactrack_scanner.php: 168 get_IOS_dot1dTpFdbEntry_ports)(/plugins/mactrack/lib/mactrack_cisco.php: 342 CactiErrorHandler)(/lib/functions.php: 4591 cacti_debug_backtrace)

Btw seems those devices are answerring very slow on snmp :-(

jpobeda commented 6 years ago

How did you create your device? imported from Cacti?

If you go to edit your device, what have you set on Scan type ?

If it's a router, make it router, if it's a switch with layer 3 features, Switch/Router.

image

Also noticed that it's actually a router so, go back to device types, edit it and change MAC Address Scanning Function to Not Applicable - Router

image

At the end It's all related to what MIBs these devices provide support for.

xefil commented 6 years ago

Hi, they are Cisco devices, nothing particular. BTW I'm noticing that I'm having some issues with import as well. I've deleted the non working devices, then pressed IMPORT and the mactrack frame gets white. The rest of the cacti page is shown. No errors About the devices, they are switches with L3 features, so yes, I'll correct them, but the import problem remains. A way to reset all at this point would help?

jpobeda commented 6 years ago

uff, yes definitely. If you don't mind to start over.

The white page is something to do with Cacti, if you can record a gif or post screenshots and open up a a new issue, that'd be good.

There a few basic steps to follow MacTrack Wiki Also look at MIB Support by vendor Also read https://github.com/Cacti/plugin_mactrack/issues/87, don't turn sync snmp. By importing the device from cacti should be enough.

jpobeda commented 6 years ago

@xefil update?

netniV commented 6 years ago

Closing due to lack of response.

xefil commented 6 years ago

Sorry, I'm out of office. I can check to reset the DB as soon I'm back, within this week btw. Thanks, Simon