Cacti (home)ForumsRepositoryDocumentation
Cacti: offical forums and support
It is currently Fri Oct 31, 2014 8:25 am

All times are UTC - 5 hours




Post new topic Reply to topic  [ 19 posts ]  Go to page 1, 2  Next
Author Message
 Post subject: MAC Track: another attempt
PostPosted: Wed Jul 19, 2006 11:32 am 
Offline

Joined: Wed Sep 29, 2004 6:58 am
Posts: 27
so i'm going to try this again. I completely wiped my mac_track_* tables in the cacti mysql db, added on our core router and a desktop switch.

The desktop switch (Cisco 3650- C3560-IPBASE-M) scan looks fine, it returns each mac per port, shows the port, etc.

But below attached is a jpeg of what the database looks like after a scan of the core router (C6MSFC3-PSV-M):
DEBUG: SQL: UPDATE mac_track_devices SET ports_total='30',device_type_id='44',scan_type = '2',vlans_total='-3',ports_active='0',ports_trunk='0',macs_active='0',snmp_readstring='public',snmp_sysName='CR-01',snmp_sysLocation='',snmp_sysContact='',snmp_sysObjectID='.1.3.6.1.4.1.9.1.557',snmp_sysDescr='Cisco Internetwork Operating System Software IOS (tm) MSFC3 Software (C6MSFC3-PSV-M), Version 12.2(17d)SXB8, RELEASE SOFTWARE (fc2) Technical Support: http://www.cisco.com/techsupport Copyright (c) 1986-2005 by cisco Systems, Inc. Compiled Fri 29-Apr',snmp_sysUptime='3285282574',snmp_status='3',last_runmessage='Data collection completed ok. No active end devices on this device.',last_rundate='2006-07-19 11:15:01',last_runduration='3.1317' WHERE device_id ='1'

What I dont understand is why the IP address is coming out as HEX, and not as xxx.xxx.xxx.xxx numerical IP one would expect (ipv4 on our network, no ipv6)


Attachments:
CR-01-scanoutput.jpg
CR-01-scanoutput.jpg [ 215.75 KiB | Viewed 11204 times ]
Top
 Profile  
 
 Post subject:
PostPosted: Wed Jul 19, 2006 11:33 am 
Offline
Developer/Forum Admin
User avatar

Joined: Mon Nov 17, 2003 6:35 pm
Posts: 5904
Location: Michigan, USA
Edited your post subject to be more descriptive.

_________________
Tony Roman
Experience is what causes a person to make new mistakes instead of old ones.
There are only 3 way to complete a project: Good, Fast or Cheap, pick two.
With age comes wisdom, what you choose to do with it determines whether or not you are wise.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jul 19, 2006 12:48 pm 
Offline
Developer
User avatar

Joined: Tue May 14, 2002 5:08 pm
Posts: 14862
Location: MI, USA
As I had attempted to describe before, this may be a MIB issue. However, I may just make this more simple. If setting the environement variable MIBS=rfc-1215 does not get it, then maybe a function to convert from Hex to dotted decimal will. Stand by.

TheWitness

_________________
True understanding begins only when we realize how little we truly understand...

Life is an adventure, let yours begin with Cacti!

Author of MacTrack, Boost, CLog, SpikeKill, Platform RTM, DSStats, maintainer of Spine, lot's of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
Gandalfs Official Debugging Help
Central Plugin Repository
Central Templates Repository


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jul 19, 2006 1:01 pm 
Offline

Joined: Wed Sep 29, 2004 6:58 am
Posts: 27
TheWitness wrote:
As I had attempted to describe before, this may be a MIB issue. However, I may just make this more simple. If setting the environement variable MIBS=rfc-1215 does not get it, then maybe a function to convert from Hex to dotted decimal will. Stand by.

TheWitness


I did a couple quick converts of HEX -> numeric IP, and it looks like that is it. I'll try and dig through the PHP today (unless someone knows the line off the top of their head and could help) and see if instituting that function fixes it.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jul 19, 2006 1:07 pm 
Offline
Developer
User avatar

Joined: Tue May 14, 2002 5:08 pm
Posts: 14862
Location: MI, USA
Please try this mactrack_functions.php and let me know if it gives you joy.

TheWitness


Attachments:
mactrack_functions.zip [8.86 KiB]
Downloaded 362 times

_________________
True understanding begins only when we realize how little we truly understand...

Life is an adventure, let yours begin with Cacti!

Author of MacTrack, Boost, CLog, SpikeKill, Platform RTM, DSStats, maintainer of Spine, lot's of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
Gandalfs Official Debugging Help
Central Plugin Repository
Central Templates Repository
Top
 Profile  
 
 Post subject:
PostPosted: Wed Jul 19, 2006 1:46 pm 
Offline

Joined: Wed Sep 29, 2004 6:58 am
Posts: 27
TheWitness wrote:
Please try this mactrack_functions.php and let me know if it gives you joy.

TheWitness



It gives me a bit more joy :) . Looks like we're getting IP's but still the same issue from before, about not getting the last octet (notice 192.168.24 and 192.168.124 under end device IP address)


Attachments:
DS-24-20060719.jpg
DS-24-20060719.jpg [ 174.5 KiB | Viewed 11182 times ]
Top
 Profile  
 
 Post subject:
PostPosted: Wed Jul 19, 2006 2:06 pm 
Offline
Developer
User avatar

Joined: Tue May 14, 2002 5:08 pm
Posts: 14862
Location: MI, USA
Let me look over the code a bit more. I might have messed something up.

TheWitness

_________________
True understanding begins only when we realize how little we truly understand...

Life is an adventure, let yours begin with Cacti!

Author of MacTrack, Boost, CLog, SpikeKill, Platform RTM, DSStats, maintainer of Spine, lot's of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
Gandalfs Official Debugging Help
Central Plugin Repository
Central Templates Repository


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jul 19, 2006 2:11 pm 
Offline
Developer
User avatar

Joined: Tue May 14, 2002 5:08 pm
Posts: 14862
Location: MI, USA
You WILL get joy now...

TheWitness


Attachments:
mactrack_functions.zip [8.86 KiB]
Downloaded 294 times

_________________
True understanding begins only when we realize how little we truly understand...

Life is an adventure, let yours begin with Cacti!

Author of MacTrack, Boost, CLog, SpikeKill, Platform RTM, DSStats, maintainer of Spine, lot's of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
Gandalfs Official Debugging Help
Central Plugin Repository
Central Templates Repository
Top
 Profile  
 
 Post subject:
PostPosted: Wed Jul 19, 2006 2:21 pm 
Offline

Joined: Wed Sep 29, 2004 6:58 am
Posts: 27
TheWitness wrote:
You WILL get joy now...

TheWitness


Sad to say, close but no cigar.

I ran a quick run of the poller, and it seemed in an infinite loop, so I killed it, and ran the scanner on each device. THe scan on the switch looked as normal, but the scan on the router came up like this:

DEBUG: SQL: REPLACE INTO mac_track_ips (site_id,device_id,hostname,description,port_number,mac_address,ip_address,scan_date) VALUES ('1','1','192.168.1.1','CR-01','32','00:D0:2B:D9:24:FC','192.168.20002','2006-07-19 15:13:19')
DEBUG: SQL: REPLACE INTO mac_track_ips (site_id,device_id,hostname,description,port_number,mac_address,ip_address,scan_date) VALUES ('1','1','192.168.1.1','CR-01','32','00:D0:2B:D9:30:FC','192.168.20003','2006-07-19 15:13:19')


more examples:
DEBUG: SQL: REPLACE INTO mac_track_ips (site_id,device_id,hostname,description,port_number,mac_address,ip_address,scan_date) VALUES ('1','1','192.168.1.1','CR-01','30','00:04:0D:9D:20:AF','192.168.1436B','2006-07-19 15:13:19')
DEBUG: SQL: REPLACE INTO mac_track_ips (site_id,device_id,hostname,description,port_number,mac_address,ip_address,scan_date) VALUES ('1','1','192.168.1.1','CR-01','30','00:04:0D:E7:CB:A3','192.168.1436F','2006-07-19 15:13:19')


Notice the incorrect IP's 192.168.20003 and 192.168.20002


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jul 19, 2006 2:43 pm 
Offline
Developer
User avatar

Joined: Tue May 14, 2002 5:08 pm
Posts: 14862
Location: MI, USA
now that was stupid wasn't it... Glad you are saving me the task of testing...

TheWitness

_________________
True understanding begins only when we realize how little we truly understand...

Life is an adventure, let yours begin with Cacti!

Author of MacTrack, Boost, CLog, SpikeKill, Platform RTM, DSStats, maintainer of Spine, lot's of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
Gandalfs Official Debugging Help
Central Plugin Repository
Central Templates Repository


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jul 19, 2006 2:46 pm 
Offline
Developer
User avatar

Joined: Tue May 14, 2002 5:08 pm
Posts: 14862
Location: MI, USA
Here you go. Lot's of fun...

TheWitness


Attachments:
mactrack_functions.zip [8.89 KiB]
Downloaded 353 times

_________________
True understanding begins only when we realize how little we truly understand...

Life is an adventure, let yours begin with Cacti!

Author of MacTrack, Boost, CLog, SpikeKill, Platform RTM, DSStats, maintainer of Spine, lot's of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
Gandalfs Official Debugging Help
Central Plugin Repository
Central Templates Repository
Top
 Profile  
 
 Post subject:
PostPosted: Wed Jul 19, 2006 2:56 pm 
Offline

Joined: Wed Sep 29, 2004 6:58 am
Posts: 27
TheWitness wrote:
Here you go. Lot's of fun...

TheWitness



So close, yet so far away. Would running scanning more than one device at a time have any effect? I've set it to 5 simultaneous devices in the poller, but I only have 1 switch and 1 router in the mix.


It looks like it's adding a hexidecimal or two after the last octet.

FYI, all IP's in vlan 24 will be in 192.168.24.x subnet, and ip's in vlan 124 will be in 192.168.124.x. IP's in vlan 172 will be in 172.16.x.x.


See attached


Attachments:
DS-24-20060719.jpg
DS-24-20060719.jpg [ 192.05 KiB | Viewed 11148 times ]
Top
 Profile  
 
 Post subject:
PostPosted: Wed Jul 19, 2006 3:03 pm 
Offline
Developer
User avatar

Joined: Tue May 14, 2002 5:08 pm
Posts: 14862
Location: MI, USA
Goto the scanning utilities section and "clear" your database and run again. Post the output right after the next run.

TheWitness

_________________
True understanding begins only when we realize how little we truly understand...

Life is an adventure, let yours begin with Cacti!

Author of MacTrack, Boost, CLog, SpikeKill, Platform RTM, DSStats, maintainer of Spine, lot's of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
Gandalfs Official Debugging Help
Central Plugin Repository
Central Templates Repository


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jul 19, 2006 3:10 pm 
Offline

Joined: Wed Sep 29, 2004 6:58 am
Posts: 27
TheWitness wrote:
Goto the scanning utilities section and "clear" your database and run again. Post the output right after the next run.

TheWitness


The light at the end of the tunnel has been reached, and it is not another train. It is the light of a working mac track installation.

So through all the code hacks and my attempts, what turned out to be the culprit(s)?


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jul 19, 2006 3:37 pm 
Offline
Developer
User avatar

Joined: Tue May 14, 2002 5:08 pm
Posts: 14862
Location: MI, USA
Well,

I did have conversion code within the MacTrack functions. However, it made a few assumptions. First, that if you had a HEX IP address, it must be prefaced by a text string indicating so. If it did not have that, it would simply return the IP Address as is. Your's did not contain the text preface, so you got crap. Secondly, the algorythm was not correct as it left off the last octet. So I added it on, but forgot to add the "." and convert it to decimal.

Now, for the root cause: net-snmp. They tend to change "default" behavior of their command set from version to version. You have to either control the library compilation (say php_snmp) or you have to check for just about every stupid possibility. I have now added one more ;)

TheWitness

_________________
True understanding begins only when we realize how little we truly understand...

Life is an adventure, let yours begin with Cacti!

Author of MacTrack, Boost, CLog, SpikeKill, Platform RTM, DSStats, maintainer of Spine, lot's of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
Gandalfs Official Debugging Help
Central Plugin Repository
Central Templates Repository


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 19 posts ]  Go to page 1, 2  Next

All times are UTC - 5 hours


Who is online

Users browsing this forum: No registered users and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  

Protected by Anti-Spam ACP Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group