GPS Maps

Discussions on developing plugins for the Cacti Plugin Architecture

Moderators: Developers, Moderators

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

GPS Maps

Post by spiffydudex »

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 689 times
Mapping Overlay
Mapping Overlay
overlay.jpg (50.55 KiB) Viewed 22088 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:

Post by eternal »

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:

Post by spiffydudex »

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

Post by heqisong »

It is a good idea .
User avatar
TheWitness
Developer
Posts: 16997
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Post by TheWitness »

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 dozens of Cacti plugins and customization's. Advocate of LAMP, MariaDB, IBM Spectrum LSF and the world of batch. Creator of IBM Spectrum RTM, author of quite a bit of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Percona Device Packages (no support)
Interesting Device Packages


For those wondering, I'm still here, but lost in the shadows. Yearning for less bugs. Who want's a Cacti 1.3/2.0? Streams anyone?
eternal
Cacti User
Posts: 68
Joined: Thu Dec 14, 2006 4:38 pm
Location: Kingsport TN
Contact:

Post by eternal »

(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: 16997
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Post by TheWitness »

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 dozens of Cacti plugins and customization's. Advocate of LAMP, MariaDB, IBM Spectrum LSF and the world of batch. Creator of IBM Spectrum RTM, author of quite a bit of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Percona Device Packages (no support)
Interesting Device Packages


For those wondering, I'm still here, but lost in the shadows. Yearning for less bugs. Who want's a Cacti 1.3/2.0? Streams anyone?
spiffydudex
Cacti User
Posts: 97
Joined: Thu Jul 24, 2008 11:21 am
Location: Hallsville, TX
Contact:

Continuing development

Post by spiffydudex »

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: 16997
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Post by TheWitness »

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 dozens of Cacti plugins and customization's. Advocate of LAMP, MariaDB, IBM Spectrum LSF and the world of batch. Creator of IBM Spectrum RTM, author of quite a bit of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Percona Device Packages (no support)
Interesting Device Packages


For those wondering, I'm still here, but lost in the shadows. Yearning for less bugs. Who want's a Cacti 1.3/2.0? Streams anyone?
eternal
Cacti User
Posts: 68
Joined: Thu Dec 14, 2006 4:38 pm
Location: Kingsport TN
Contact:

Post by eternal »

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:

Post by spiffydudex »

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:

Post by spiffydudex »

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:

Post by spiffydudex »

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: 229
Joined: Mon Oct 02, 2006 1:22 pm
Location: Belgium
Contact:

Post by JorisFRST »

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

Who is online

Users browsing this forum: No registered users and 2 guests