GPS Maps for Cacti

Announcements concerning Plugins for Cacti

Moderators: Developers, Moderators

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

Re: GPS Maps for Cacti

Post by spiffydudex »

pocobor wrote:2spiffydudex:

thanks for plugin!
migration to API v3 coming soon?
Actually I looked into migrating to API v3 for 1.6. Its big change from the way things are currently done. I don't plan on migrating to API v3. From what Google says is that the v2 is just deprecated, but they will still support the API for some time(This was back when I did my research on possibly migrating to v3, about 5 months ago).
lany
Posts: 12
Joined: Sun Mar 18, 2007 4:33 am

Re: GPS Maps for Cacti

Post by lany »

Hi
Thanks for the update to 1.62.
I´m having some troubles getting the upgrade from 1.53 to work. You say that the gpsmap folder in the plugin directory should be overwritten with the updated gspmap folder. Is that all that needs to be done? Do I need to uninstall the 1.53 in plugin management first and then install it again after the upgrade.
If I do a uninstall in 1.53 does that mean that my coordinates will be lost or is that just in 1.62?
Could there be some scripts to update the db that doesn´t run?

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

Re: GPS Maps for Cacti

Post by spiffydudex »

lany wrote:Hi
Thanks for the update to 1.62.
I´m having some troubles getting the upgrade from 1.53 to work. You say that the gpsmap folder in the plugin directory should be overwritten with the updated gspmap folder. Is that all that needs to be done? Do I need to uninstall the 1.53 in plugin management first and then install it again after the upgrade.
If I do a uninstall in 1.53 does that mean that my coordinates will be lost or is that just in 1.62?
Could there be some scripts to update the db that doesn´t run?

Regards
Lars
You should be able to replace the previous gpsmap folder. The plugin architecture should recognize that there is an updated plugin and run the update function for the necessary DB alterations and additions.

If you are having issues, you can backup your host table, uninstall the the 1.5 plugin completely, then install the 1.6 version clean. If the GPS coordinates are not there, import the hosts table back into the DB.
User avatar
Jem
Posts: 35
Joined: Tue Apr 12, 2005 4:36 pm
Contact:

Re: GPS Maps for Cacti

Post by Jem »

Hi,

I just installed GPSMap 1.62, my map is showing correctly but I can't see any host on it...

Moreover I have the following messages in my httpd/error.log file

Code: Select all

PHP Notice:  Undefined index:  id in /var/www/html/cacti/plugins/gpsmap/setup.php on line 125
PHP Warning:  mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /var/www/html/cacti/plugins/gpsmap/setup.php on line 127
PHP Notice:  Undefined index:  id in /var/www/html/cacti/plugins/gpsmap/setup.php on line 125
PHP Warning:  mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /var/www/html/cacti/plugins/gpsmap/setup.php on line 127
I created a map template, defined the Cisco Router host template to be an AP, and then I put coordinates ont 3 of my devices (Cisco Router templated) but I can't see anything.

I also put the mysql extract from one of my host:

Code: Select all


mysql> Select host_template_id,hostname,rdistance,groupnum,stop,start,GPScoverage,longitude,latitude from host where description="MyHostName";
+------------------+-------------+-----------+----------+------+-------+-------------+--------------+---------------+
| host_template_id | hostname    | rdistance | groupnum | stop | start | GPScoverage | longitude    | latitude      |
+------------------+-------------+-----------+----------+------+-------+-------------+--------------+---------------+
|                5 | xxx.yy.z.aa | 10.000000 |        0 |   90 |    45 | on          | 2.2048616409 | 48.7812780020 |
+------------------+-------------+-----------+----------+------+-------+-------------+--------------+---------------+
1 row in set (0.00 sec)
And here is the extract of my gpsXML.xml file:

Code: Select all


<markers><marker id="3" name="MyHostName" address="xxx.yy.z.aa" lat="48.7812780020" lng="2.2048616409" type="Cisco Router" templateId="5" availability="100.00000" radius="0" status="up" latency="319.46000" group="" />
</markers>
User avatar
Jem
Posts: 35
Joined: Tue Apr 12, 2005 4:36 pm
Contact:

Re: GPS Maps for Cacti

Post by Jem »

Well, something strange happened... Looks like adding a new plugin (QuickTree) solved the problem, everything is fine now...
CCNAJ
Posts: 30
Joined: Fri Apr 15, 2011 7:13 am
Location: Australia

Re:

Post by CCNAJ »

Caracarn wrote:Looks great, been hoping for a plugin such as this! :D

How about an option to default to map type ie either Map, Satellite or Hybrid?

Thanks again.
Found a partial solution for this as I was really in need of the Terrain Layer

from here : http://code.google.com/apis/maps/docume ... ction.html
Common Map Types

The following map types are commonly used in the Google Maps API:

G_NORMAL_MAP displays the default road map view.
G_SATELLITE_MAP displays Google Earth satellite images. *
G_HYBRID_MAP displays a mixture of normal and satellite views.*
G_DEFAULT_MAP_TYPES contains an array of the above three types, useful for iterative processing.
G_PHYSICAL_MAP displays a physical map based on terrain information.

Note: at high zoom levels, both satellite and hybrid map types may also display aerial imagery which is built into those map types. For more information, see Aerial Map Types below.)

You can set the map type using the GMap2 object's setMapType() method. For example, the following code sets the map to use the satellite view from Google Earth:

Go to the gpsmap.php and open with an editor (notepad++ as example)
>>> add this line after line #69 [ map= new GMap2 (document.getElementById("map")); *leave this as is!
map.setMapType(G_SATELLITE_MAP);

or which layer you wish........
++++++ Cacti Newbie ++++++++++++++++++++++++++++++++++++++++++
Cacti 0.8.8f with PIA on a Centos6 VM
Plugins Used: Infopage | RouterConfigs | Spikekill | BOOST | REALTIME | CLOG
arcane50
Posts: 4
Joined: Tue Aug 09, 2011 2:17 pm

Re: GPS Maps for Cacti

Post by arcane50 »

I have a couple thousand nodes and adding the coordinates isn't practical via the web interface. Is there a way I can do it with mysql? can anyone help? I have all the coords and the device ID's
arcane50
Posts: 4
Joined: Tue Aug 09, 2011 2:17 pm

Re: GPS Maps for Cacti

Post by arcane50 »

figured out the post above incase anyone is interrested:

Code: Select all

UPDATE  `cacti`.`host` SET  `longitude` =  '-999.999999',`latitude` =  '99.999999' WHERE  `host`.`description` =XXXXXX;
Nice plugin, I really like it. I have a question. The map does not display in internet explorer. It works properly in Chrome and Firefox. IE gives the following error.
Webpage error details

Code: Select all

User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; MS-RTC LM 8; InfoPath.3; Tablet PC 2.0)
Timestamp: Mon, 15 Aug 2011 16:38:51 UTC


Message: Invalid argument.
Line: 189
Char: 56
Code: 0
URI: http://lnxapp94/cacti/plugins/gpsmap/js/GPSMaps.js

I looked at this line and it looks correct. Any Idea on how I can fix it?

Code: Select all

function resize(){
var frame = document.getElementById("map");
var htmlheight = document.body.parentNode.scrollHeight;
var windowheight = window.innerHeight;
if ( htmlheight < windowheight ) { document.body.style.height = windowheight + "px"; frame.style.height = windowheight-105 + "px"; }
else { document.body.style.height = htmlheight + "px"; frame.style.height = htmlheight-105 + "px"; }
}
tosage
Cacti User
Posts: 164
Joined: Wed Jul 28, 2010 5:05 am
Location: France

Re: GPS Maps for Cacti

Post by tosage »

Hello all,

I have a Cacti 0.8.7e with PA 2.6.
I have replace all file in the plugins directory (/usr/share/cacti/site/plugins).
When i go in the Plugin Management Link, i see the plugin in 1.5 version
When i go in settings - GPS Map, i see the settings of the 1.5 plugin
If i go in the GPS MAP Button i see all my node with the new link Subnet Transversal (older is IP Analysis, IP Analysis with Coverage)
So when i click on my nodes i don't have the bubble with information about my host...

I have disable and uninstall the plugin in the PA. When i have uninstall, PA will see the plugin in the 1.62 version. I install and enable it.
Settings are update in the settings menu.
I have insert the gps coordinates in my table and all node are resurfaced and the tooltip is working again

His my feedback on my installation :roll:

Thanks for the works again !!!! 8)
Cacti Version - 0.8.8a
Plugin Architecture - 3.1
Poller Type - spine
Server Info - Linux
Web Server - Apache/2.2.22 (Ubuntu)
PHP - 5.3.10-1ubuntu3.6 with Suhosin-Patch (cli)
MySQL - 5.5.29-0ubuntu0.12.04.2
RRDTool - 1.4.7
User avatar
bkbristlin
Cacti User
Posts: 79
Joined: Fri Jan 14, 2011 3:28 pm
Location: Lincoln, NE

Re: GPS Maps for Cacti

Post by bkbristlin »

This thing is pretty cool. I cannot for the life of me figure out why the overlay doesn't show up. Are there certain settings I should be tweaking? I have this running with three nodes on my test box all in the same subnet. All three are Cisco routers using the Cisco Routers template. I created a map template, referenced the Cisco Routers template, and set the AP to true. With the exception of this thread I can't find documenation anywhere so I have no idea what if anything I am missing.

edit: and all three are set to group 100.
Brian
CCNA, MCDST, MCP, A+
CCNAJ
Posts: 30
Joined: Fri Apr 15, 2011 7:13 am
Location: Australia

Re: GPS Maps for Cacti

Post by CCNAJ »

I have the same problem on a new installation.

The everything is configured as my old installation which is still working (this is just a backup monitoring box)

GPS maps is registered but no maps show up.....maybe something has changed at google's end?
++++++ Cacti Newbie ++++++++++++++++++++++++++++++++++++++++++
Cacti 0.8.8f with PIA on a Centos6 VM
Plugins Used: Infopage | RouterConfigs | Spikekill | BOOST | REALTIME | CLOG
fl0rinc
Posts: 3
Joined: Tue May 03, 2011 2:51 am

Re: GPS Maps for Cacti

Post by fl0rinc »

Hi,

I have updated the GPSmap version from 1.5 to 1.62.
I have Cacti version 0.8.7g

I have the same problem as Jem, my map is showing correctly but I can't see any host on it...

I have the same errors in httpd/error.log file, that are repeating every time I access cacti:

Code: Select all

PHP Notice:  Undefined index: id in /var/www/vhost/cacti/plugins/gpsmap/setup.php on line 125
PHP Warning:  mysql_fetch_array() expects parameter 1 to be resource, boolean given in /var/www/vhost/cacti/plugins/gpsmap/setup.php on line 127

PHP Notice:  Undefined index: id in /var/www/vhost/cacti/plugins/gpsmap/setup.php on line 125
PHP Warning:  mysql_fetch_array() expects parameter 1 to be resource, boolean given in /var/www/vhost/cacti/plugins/gpsmap/setup.php on line 127

These are the lines from setup.php that generate the above error:

Code: Select all

125:       $did = $_GET["id"];
126:       $result = mysql_query("SELECT AP FROM `host` RIGHT JOIN gpsmap_templates ON host.host_template_id = gpsmap_templates.templateID WHERE id=".$did."");
127:       $row = mysql_fetch_array($result,MYSQL_ASSOC);


Here is the extract of my gpsXML.xml file:

Code: Select all

<markers><marker id="10" name="Catalyst 3550-12T" address="192.168.5.3" lat="44.8614200000" lng="25.1885620000" type="Cisco Router" templateId="5" availability="99.97766" radius="0" status="up" latency="4.72000" group="0" />
</markers>

I have also tried adding another plugin like Jem (QuickTree), but no success in my case.
wilduca
Posts: 1
Joined: Tue Nov 29, 2011 8:37 am

Re: GPS Maps for Cacti

Post by wilduca »

Hi fl0rinc,

no hosts on map due to a missing icon style ( http://labs.google.com/ridefinder/image ... _white.png and so on...), I found these icons on the web, setup a (virtual and fake) web server to reply on labs.google.com.
thanks Google!

ale
fl0rinc
Posts: 3
Joined: Tue May 03, 2011 2:51 am

Re: GPS Maps for Cacti

Post by fl0rinc »

Hi wildulca,

Thank for your reply.

You are right, the urls like http://labs.google.com/ridefinder/image ... _white.png and all other icons colors are no more available on google site.
These url links are used by files like gpsmap/includes/icons.php and gpsmap/includes/iconskml.php

Probably spiffydudex shoud release a new version of gpsmaps with these icons saved localy.

Anyway, now (with labs.google.com url problem passed) the icons are showed correctly on the map :D but the errors from my anterior post are still there :( .

Thanks
User avatar
bkbristlin
Cacti User
Posts: 79
Joined: Fri Jan 14, 2011 3:28 pm
Location: Lincoln, NE

Re: GPS Maps for Cacti

Post by bkbristlin »

As I understood it on his website, SpiffyDudex was no longer supporting this. It is an awesome idea.
Brian
CCNA, MCDST, MCP, A+
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests