GPS Maps for Cacti

Announcements concerning Plugins for Cacti

Moderators: Developers, Moderators

Post Reply
Voiper99
Cacti User
Posts: 276
Joined: Thu Mar 01, 2007 5:43 pm
Location: Melbourne, Australia

Post by Voiper99 »

lcano wrote:If you are not able to reproduce the issue, may be something related to installed plugins?.....
Good point. I just found that my Firefox is now working. (I am running Vista). The Firefox version details are:
Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9.0.19) Gecko/2010031422 YFF3 Firefox/3.0.19 ( .NET CLR 3.5.30729; .NET4.0C)
I haven't really changed anything on my box since my last post except add and then remove the Manage plugin and add the NMID CreatePDF plugin but then delete its directory as it had some permissions issues.

Other plugins I am running include Thold, Monitor, Settings and RealTime.
Voiper99
Cacti User
Posts: 276
Joined: Thu Mar 01, 2007 5:43 pm
Location: Melbourne, Australia

Post by Voiper99 »

I can't seem to get it working on my Windows XP box with Firefox 3.6.8 or Internet Explorer 8 :(

Just wondering if there has been any progress in getting this issue resolved??
Voiper99
Cacti User
Posts: 276
Joined: Thu Mar 01, 2007 5:43 pm
Location: Melbourne, Australia

Post by Voiper99 »

Sorry, my mistake, I forgot to enable write permissions to the XML file. After changing the permissions I got Firefox 3.6.8 to work, but not IE8. Having said that, it does work on IE6.

This is the error message I get on IE8:

Code: Select all

Webpage error details

User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1) ; InfoPath.1; .NET CLR 2.0.50727; .NET CLR 1.1.4322; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729)
Timestamp: Mon, 9 Aug 2010 00:22:12 UTC


Message: 'documentElement' is null or not an object
Line: 204
Char: 11
Code: 0
URI: http://xxxx/cacti/plugins/gpsmap/gpsmap.php
_JPL_
Cacti User
Posts: 67
Joined: Mon Nov 29, 2004 11:34 am

No Pins on the map

Post by _JPL_ »

I seem to have everything working ok except my hosts don't show up on the map. I have the right coordinates for the hosts and I picked icons for everything in the templates. When I am zoomed all the way out I still don't see the hosts so they are not just lost on the map somewhere.

Cacti: .8.7g
GPSmap: 1.53
Ubuntu 10.04
Apache2
php 5

console error in FF 3.6.8
Error: no element found
Source File: http://localhost/cacti/plugins/gpsmap/gpsmap.php
Line: 1
Error: no element found
Source File: http://localhost/cacti/plugins/gpsmap/XML/gpsXML.xml
Line: 1


The gpsXML.xml file is populated:

Code: Select all

<markers><marker id="1" name="Localhost" address="127.0.0.1" lat="44.6399993896" lng="-63.5699996948" type="Local Linux Machine" templateId="8" availability="100.00000" radius="0" status="up" latency="0.08000" />
<marker id="3" name="Test SNMP Local" address="tcp:127.0.0.1" lat="44.6399993896" lng="-63.5699996948" type="ucd/net SNMP Host" templateId="3" availability="99.95000" radius="0" status="up" latency="17.58000" />
No icons on the map though.

PS: Seems like a really neat plug-in. Keep up the good work even if it's not working for me as easily as it is for others.

PPS: Looks like I got a host to show (well, 2 actually but I can only see one as they have the same co-ordinates). I think I just had to restart firefox.
Last edited by _JPL_ on Thu Aug 26, 2010 11:08 am, edited 1 time in total.
cpttab
Posts: 1
Joined: Thu Aug 19, 2010 4:24 pm

Tower Radius

Post by cpttab »

Hey Spiffydudex -

The plugin is great and the maps work phenomenal, but I'm at a loss on how to build a radius, or flag a device as a tower.

I'm currently using the plugin to map each one of my central offices and the customer base around it. I want to put a 15mile radius around each one of my COs so I can get a good visualization as to density.
spiffydudex
Cacti User
Posts: 97
Joined: Thu Jul 24, 2008 11:21 am
Location: Hallsville, TX
Contact:

Re: Tower Radius

Post by spiffydudex »

cpttab wrote:Hey Spiffydudex -

The plugin is great and the maps work phenomenal, but I'm at a loss on how to build a radius, or flag a device as a tower.

I'm currently using the plugin to map each one of my central offices and the customer base around it. I want to put a 15mile radius around each one of my COs so I can get a good visualization as to density.
You would have to set the AP in the settings to the device type used at your COs. Usually those devices are different. Secondly click on the IP analysis with coverage. This will draw a transparent circle starting at the AP and going to the farthest device on that same IP subnet. If you want just a static 15mile circle radius around the CO devices, then you will have to edit some code.

_JPL_ wrote:I seem to have everything working ok except my hosts don't show up on the map. I have the right coordinates for the hosts and I picked icons for everything in the templates. When I am zoomed all the way out I still don't see the hosts so they are not just lost on the map somewhere.

Cacti: .8.7g
GPSmap: 1.53
Ubuntu 10.04
Apache2
php 5

console error in FF 3.6.8
Error: no element found
Source File: http://localhost/cacti/plugins/gpsmap/gpsmap.php
Line: 1
Error: no element found
Source File: http://localhost/cacti/plugins/gpsmap/XML/gpsXML.xml
Line: 1

The gpsXML.xml file is populated:
Code:
<markers><marker id="1" name="Localhost" address="127.0.0.1" lat="44.6399993896" lng="-63.5699996948" type="Local Linux Machine" templateId="8" availability="100.00000" radius="0" status="up" latency="0.08000" />
<marker id="3" name="Test SNMP Local" address="tcp:127.0.0.1" lat="44.6399993896" lng="-63.5699996948" type="ucd/net SNMP Host" templateId="3" availability="99.95000" radius="0" status="up" latency="17.58000" />

No icons on the map though.

PS: Seems like a really neat plug-in. Keep up the good work even if it's not working for me as easily as it is for others.
PPS: Looks like I got a host to show (well, 2 actually but I can only see one as they have the same co-ordinates). I think I just had to restart firefox.
I have been trying time and time again to produce this error. I originally had an issue with IE giving this error, corrected it and I cannot seem to make it happen. When I get enough time, I have several minor things to fix ascetically and a few things code wise to continue to reduce the number of database calls. I think it may have to do with a switch case I have in place, but I cannot be sure. I'll be slowly working on some changes the next few weeks.

My last year of Undergrad has started and I am of course busy with the workload that places on me. The wireless company that I worked for was sold and so I have been trying to hustle up work on the side as well. Might take a little bit of time, but I'll try and get some work done on this.
eternal
Cacti User
Posts: 68
Joined: Thu Dec 14, 2006 4:38 pm
Location: Kingsport TN
Contact:

Few changes I have made.

Post by eternal »

I do not use wireless, I do have fiber routes i wanted to include into the map
Changes made to gpsmap.php

Code: Select all

url_end = "?nocache=" + (new Date()).valueOf();
myKML_1 = "http://domain.com/googleearth.kml" + url_end;

function gload(){
//This is all standard stuff from the google API
//need to get some variables first before things get rolling to much
var liColor = "<?php echo($liColor) ?>";
var liWidth = "<?php echo($liWidth) ?>";
var liOpa = "<?php echo($liOpa) ?>";
var fillColor = "<?php echo($fillColor) ?>";
var fillOpa = "<?php echo($fillOpa) ?>";
var circleQuality = "<?php echo($circleQuality) ?>";


if (GBrowserIsCompatible()) {
        var map = new GMap2(document.getElementById("map"));
        map.setUIToDefault(); 
        geoxml1 = new GGeoXml(myKML_1);
        map.addOverlay(geoxml1);
        map.setCenter(new GLatLng(<?php echo($initialLat) ?>, <?php echo($initialLong) ?>), <?php echo($initialzoom) ?>);
        //set to our XML path
        GDownloadUrl("./XML/gpsXML.xml", function(data) {
          var xml = GXml.parse(data);
          var markers = xml.documentElement.getElementsByTagName("marker");
          for (var i = 0; i < markers.length; i++) {
            var id = markers[i].getAttribute("id");
            var name = markers[i].getAttribute("name");
            var address = markers[i].getAttribute("address");
            var templateid = markers[i].getAttribute("templateId");
            var type = markers[i].getAttribute("type");
            var availability = markers[i].getAttribute("availability");
            var status = markers[i].getAttribute("status");
            var latency = markers[i].getAttribute("latency");
            var point = new GLatLng(parseFloat(markers[i].getAttribute("lat")),parseFloat(markers[i].getAttribute("lng")));
            var marker = createMarker(id, templateid, point, name, address, type, availability, status, latency);
            map.addOverlay(marker);

            changeLayerStatus = function(x) {
                  i = x;
                  if (document.form1["layer"+i].checked == true) {
                        //alert(i+" added");
                        map.addOverlay(eval('geoxml' + i));
                  }else{
                        //alert(i+" removed");
                        map.removeOverlay(eval('geoxml' + i));
                  }
                }


        }
     });
   }      
 }
Then before

Code: Select all

<?php
}
$body .= "</script><div id=\"map\" style=\"height:10px;\"></div>";
add

Code: Select all

<strong>KML Network Element Overlay Layer Manager</strong><br />


<form id="form1" name="form1" method="post" action="">

<input name="layer1" type="checkbox" id="layer1" onClick="changeLayerStatus('1')" checked="checked" /> Fiber Route<br />

<input name="layer3" type="checkbox" id="layer3" onClick="changeLayerStatus('3')" /> Future (lines)<br />
[/code]

Maybe a drop in option can be added in the future to include overlays into the map
eternal
Cacti User
Posts: 68
Joined: Thu Dec 14, 2006 4:38 pm
Location: Kingsport TN
Contact:

Feature request

Post by eternal »

HAve each host configurable for different overlays.
I would like to keep it in cacti as much as possible. I guess it would be the same as having an option to create different overlays of wireless, routers, switches, etc all separate to view.

I dont know how far off that would be from your intent of the plugin, but would be nice.
spiffydudex
Cacti User
Posts: 97
Joined: Thu Jul 24, 2008 11:21 am
Location: Hallsville, TX
Contact:

Re: Feature request

Post by spiffydudex »

eternal wrote:HAve each host configurable for different overlays.
I would like to keep it in cacti as much as possible. I guess it would be the same as having an option to create different overlays of wireless, routers, switches, etc all separate to view.

I dont know how far off that would be from your intent of the plugin, but would be nice.
Each individual host or each device type?
eternal
Cacti User
Posts: 68
Joined: Thu Dec 14, 2006 4:38 pm
Location: Kingsport TN
Contact:

Post by eternal »

Add a option to add new layers from kml or kmz file.

My idea was like the manage plugin (site >group>hosts) Then one would be able to show or remove them from the map.

I use your plugin to show all my customers connections and info for the noc and sales people. I have imported into the node popup notes from the notices plugin, so I can have the port numbers they connect to and cir id information.

Great plugin.

Looking to get threshold info somehow into the marker next and maybe graph info.
spiffydudex
Cacti User
Posts: 97
Joined: Thu Jul 24, 2008 11:21 am
Location: Hallsville, TX
Contact:

Post by spiffydudex »

Well, Just an update. School is going well and surprisingly enough, my course load isn't as bad as I had initially predicted. Although, with my 2nd semester in software engineering, the group project may take a good amount of time later this semester.

I've done some thinking about how to implement some of these new features. Staring at my code, re-looking over functions I had written long ago. I've come to the conclusion that in order for this to work properly there is going to have to be some major sections of code torn up and rewritten to suit multiple layers. Lower the amount of PHP code loaded into memory, lower the amount of database calls. The code will hopefully be a bit more modularized so we can call functions out of order when needed. That way later on we can do some neat stuff with importing from external files. I have already found a few bugs that were quite bad for processing in the previous version. Some even processed the all of nodes twice and making 2 times the amount of DB calls. Although, Ive already torn apart my code so much, I'm not even sure if the fix even worked(oops).

Ideally I would like a simple drop-down box with a listing of subnets and you just select the subnets you want and it will change it on the map.

As eternal stated, usage of additional KML/KMZ files. (would a master toggle button work? Toggle to enable all KML file input from within a single folder? or would it be better if the KML was processed then added to the subnet listings?)

Please give me some ideas, I am listening and have my ears open for ideas.

Anyways, like always, don't expect anything done quickly, this is a side project and something to keep my brain active between school and studying. (Hah!)
User avatar
redpeppers
Posts: 2
Joined: Thu Sep 30, 2010 8:46 am

Re: GPS Maps for Cacti

Post by redpeppers »

I am not sure if this is a bug or not but I am able to place markers on the map and there is nothing is the XML file but <markers></markers>. All files in the XML dir are set to chmod 777 and owned by root/root. Like i said if i place the long/lat into a host it does place the host onto the map but i do not see anything listed in the xml file. Also i have noticed that if i change the long/lat back to all 0.0000" the host does not remove from the map. Any ideas on how to fix this problem? I am running the latest verson of cacti and the plugins and plugin install package is all uptodate. Centos 5 is the OS.
User avatar
JorisFRST
Cacti User
Posts: 229
Joined: Mon Oct 02, 2006 1:22 pm
Location: Belgium
Contact:

Re: GPS Maps for Cacti

Post by JorisFRST »

Hi,

just confirming the firefox issue with windows 7 and firefox 3.6.3 and 3.6.11

Works well in IE 8.

Joris.
Joris.
http://www.routerjanitor.com
tictac
Posts: 2
Joined: Wed Nov 03, 2010 4:59 am
Location: France

Re: GPS Maps for Cacti

Post by tictac »

Hello,
Thanks for this great plug-in.

I saw one question in this thread with no answer regarding the refresh of the map :
"The plug-in doesn’t appear to automatically update the status if the site goes down. Can it be setup to refresh the markers every 60 seconds so it will display a red marker for a site that has suddenly gone offline?"

I also have the same behavior , is it the normal or does a refresh should appear automatically ?

I saw also a screenshot on the documentation with some blue circle around some device not responding (red color) , is it also a feature that is in place ?

Thanks.
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 »

tictac wrote:Hello,
Thanks for this great plug-in.

I saw one question in this thread with no answer regarding the refresh of the map :
"The plug-in doesn’t appear to automatically update the status if the site goes down. Can it be setup to refresh the markers every 60 seconds so it will display a red marker for a site that has suddenly gone offline?"

I also have the same behavior , is it the normal or does a refresh should appear automatically ?

I saw also a screenshot on the documentation with some blue circle around some device not responding (red color) , is it also a feature that is in place ?

Thanks.
The markers are updated when you refresh the page. However, it does not poll the devices. The map only displays the information that the device management page displays. So the devices will update their color if the Cacti poller has changed the status of the device.

I will look into having the mapping software recheck the devices every 60(or specified) seconds. This next version has required a significant amount of refactoring of my previous code and should improve the stability across all browsers. Would a simple page refresh timer be sufficient?

Yes, the feature is in place. In the GPSMap settings set the check box for coverage map and also select a device type to use as a "tower" (aka Access point). This will create a circle from the access point device to the furthest device in that subnet.
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest