GPS Maps

Discussions on developing plugins for the Cacti Plugin Architecture

Moderators: Moderators, Developers

Post Reply
Author
Message
spiffydudex
Cacti User
Posts: 97
Joined: Thu Jul 24, 2008 11:21 am
Location: Hallsville, TX
Contact:

GPS Maps

#1 Post by spiffydudex » Tue Jun 02, 2009 5:13 pm

Google maps for cacti

This is my first Cacti plugin so bear with me.

I work for a Wireless internet company and this does its job just as we would like to have it.

About GPS Maps:
This plugin provides an integration of Google maps with cacti in order to visually map out hosts using previously recorded Latitude and Longitude coordinates. Tracking of IP ranges and addresses and displaying them on the map. Information about each point is displayed when clicked on. Additionally there is a function that will allow for overlay mapping of IP ranges to get a coverage map.

How I use it:
We have access points on towers. The AP's are on on the same IP range. IE 192.168.4.2, 192.168.4.3, 192.168.4.4. Typically we will have 3 AP's per tower. The each tower has subscribers connected to it. The subscribers are in the same IP range as well. This is a means to get the range and coverage map that we need. The below screen shot just shows that the coverage range is dynamic. Once we get more hosts moved to this system. I'll post another screenshot of the coverage map.

Future plans:
-Decrease number of database calls.
-Clean up code for displaying of certain IP ranges
-Fix the map so that both Height and Width can be set to 100%. (currently only width can be set to 100%)

I do request that if you are to make changes to the code, you post your changes so that we can further develop this plugin.
Please post about any bugs that are found. That would help me greatly.

---Added coverage map with IP tracking. Version 1.36----
Notable Changes since 1.3 to 1.36
-Some internal enhancements behind the scene to reduce the amount of memory required for some arrays.
-Allowed for towers in the same IP range to graph a circle. This might not be the best way to approach this issue.
But seeing that there is no way to get actual connected subscribers, IP range is the only way to do this.
-Increased float range in database for increased accuracy. Up to 13 characters for Lat/Long now
-Added customizable options in the settings.
Attachments
gpsmap_1.36.zip
Version 1.36, Includes overlay mode.

Newest Version
(15.28 KiB) Downloaded 636 times
overlay.jpg
Mapping Overlay
overlay.jpg (50.55 KiB) Viewed 20714 times
Last edited by spiffydudex on Wed Jun 17, 2009 11:32 pm, edited 12 times in total.

eternal
Cacti User
Posts: 68
Joined: Thu Dec 14, 2006 4:38 pm
Location: Kingsport TN
Contact:

#2 Post by eternal » Thu Jun 04, 2009 3:34 pm

Great idea.

I added the plugin now, I can't save device info.

spiffydudex
Cacti User
Posts: 97
Joined: Thu Jul 24, 2008 11:21 am
Location: Hallsville, TX
Contact:

#3 Post by spiffydudex » Fri Jun 05, 2009 3:49 pm

Run the included SQL file. It adds two columns to your hosts table for latitude and longitude.

Heh, probably need to start documenting more.

heqisong
Posts: 8
Joined: Fri Apr 10, 2009 3:39 am

#4 Post by heqisong » Tue Jun 09, 2009 9:40 pm

It is a good idea .

User avatar
TheWitness
Developer
Posts: 14817
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

#5 Post by TheWitness » Wed Jun 10, 2009 6:06 am

Now this is cool! Needs a little code polish and update for PIA 2.x, but it's functional. Good first plugin!!

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
GitHub Repository with Supported Plugins
Central Plugin Repository
Central Templates Repository


I'm still out there people. Getting excited for Cacti 1.2. I think it will be a great release.

eternal
Cacti User
Posts: 68
Joined: Thu Dec 14, 2006 4:38 pm
Location: Kingsport TN
Contact:

#6 Post by eternal » Wed Jun 10, 2009 11:07 am

(13)Permission denied: access to /plugins/cycle/images/tab_cycle.gif denied, referer: http://foo.foo.com/plugins/gpsmap/gpsma ... how=region

(Going into the plugin I receive no errors and nothing shows up. )
Showing up in wrong place must be a mis calculation on my part



Going into the iplevel i receive the error above

User avatar
TheWitness
Developer
Posts: 14817
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

#7 Post by TheWitness » Wed Jun 10, 2009 11:38 am

That's odd:

Code: Select all

cd /var/www/html/cacti/plugins
chown -R apache:apache *
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
GitHub Repository with Supported Plugins
Central Plugin Repository
Central Templates Repository


I'm still out there people. Getting excited for Cacti 1.2. I think it will be a great release.

spiffydudex
Cacti User
Posts: 97
Joined: Thu Jul 24, 2008 11:21 am
Location: Hallsville, TX
Contact:

Continuing development

#8 Post by spiffydudex » Wed Jun 10, 2009 4:05 pm

Thanks Witness,

I do plan on continuing development. Could you elaborate on PIA 2.x and where I could find the proper documentation for it. That would help significantly. Most of the Official documentation would seem to be outdated and is hard for me to follow. I had to scrape by, by dissecting other plugins. So any help would be greatly appreciated.

And as far as the IP Tracking. I am not sure what would be a better way to reduce the number of database calls. Javascript would be nice to update the map as the IP ranges are traversed. But being a client side only language, there would be issues in fetching the data. Any Ideas?

I should be releasing a version soon with more inline commenting, more documentation and some minor tweaks , so others can get a better Idea of what is going on.

Thanks,
Andy

User avatar
TheWitness
Developer
Posts: 14817
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

#9 Post by TheWitness » Wed Jun 10, 2009 9:44 pm

Use the functions at the beginning of the current CLOG plugin. I believe it is currently 1.21. This will contain the install/uninstall hooks that will enable automatic inclusion without the need to modify global.php.

CLOG is very simple, but includes sufficient information. If you want to see a plugin that is making database changes, look at the most recent version of RRDcleaner. It will show you how to add, but not delete tables. You should strongly consider removing the columns during an uninstall of the plugin.

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
GitHub Repository with Supported Plugins
Central Plugin Repository
Central Templates Repository


I'm still out there people. Getting excited for Cacti 1.2. I think it will be a great release.

eternal
Cacti User
Posts: 68
Joined: Thu Dec 14, 2006 4:38 pm
Location: Kingsport TN
Contact:

#10 Post by eternal » Thu Jun 11, 2009 8:06 am

I pasted the wrong error
PHP Notice: Undefined offset: 3 in /var/www/html/plugins/gpsmap/gpsmap.php on line 108, referer: http://foo.foo.com/plugins/gpsmap/gpsmap.php


I have tried several conversion utilities on the gps coordinates. They all end up the same and wrong on the map any ideas?

spiffydudex
Cacti User
Posts: 97
Joined: Thu Jul 24, 2008 11:21 am
Location: Hallsville, TX
Contact:

#11 Post by spiffydudex » Thu Jun 11, 2009 9:47 am

That line 108, splits IP addresses into their respective parts. Currently there is no support for actual hostnames, only IP addresses.
If you were to change whatever host, that had an actual hostname, to an IP address that should fix it, temporarily.
Perhaps that is what is causing it to break.

I will note that, and will find a fix to support full hostnames.

Thanks for the Feedback :)



Thanks Witness for giving me a direction to pursue.
Many thanks.

spiffydudex
Cacti User
Posts: 97
Joined: Thu Jul 24, 2008 11:21 am
Location: Hallsville, TX
Contact:

#12 Post by spiffydudex » Thu Jun 11, 2009 4:23 pm

Version 1.3 has been released

-Implemented PIA 2.x standards
-Fixed partially, Bug when performing an IP analysis and no IP address is specified in hostname area. Currently it will not display those devices. Trying to find solution that would retrieve the IP address and go from there.
-Fixed some minor inconsistencies involving the XML output to Google maps.
-better documentation. for those trying to figure out how to use things.
-Install/Uninstall of plugin works and removes database columns.

You may notice that this update is alot smaller than the last ones. I have removed the left over PSD files when creating the GPS Map icon.

Hopefully this weekend I'll have time to tackle the coverage overlay.

spiffydudex
Cacti User
Posts: 97
Joined: Thu Jul 24, 2008 11:21 am
Location: Hallsville, TX
Contact:

#13 Post by spiffydudex » Mon Jul 13, 2009 2:29 pm

For those of you who have downloaded this plugin.

Is there anything that would be particularly useful in having?
Any additions or alterations?
Comments or otherwise?

User avatar
JorisFRST
Cacti User
Posts: 217
Joined: Mon Oct 02, 2006 1:22 pm
Location: Belgium
Contact:

#14 Post by JorisFRST » Fri Sep 25, 2009 5:43 am

Hi,

if I understand the google maps API right, you can't use this inside a firewall, as that would be not rule with their terms and conditions ?

Joris.

Post Reply