GPS Maps for Cacti

Announcements concerning Plugins for Cacti

Moderators: Developers, Moderators

Post Reply
maxamis
Posts: 2
Joined: Fri Oct 26, 2007 3:06 pm
Location: River Falls, Wisconsin

Anyone get GPS Map working on Windows2008 ???

Post by maxamis »

Here's my setup
Cacti Version - 0.8.7e
Plugin Architecture - 2.5
Poller Type - CMD.php
Server Info - Windows NT 6.0
Web Server - Microsoft-IIS/7.0
PHP - 5.2.11
PHP Extensions - bcmath, calendar, com_dotnet, ctype, date, filter, ftp, hash, iconv, json, odbc, pcre, Reflection, session, libxml, standard, tokenizer, zlib, SimpleXML, dom, SPL, wddx, xml, xmlreader, xmlwriter, cgi-fcgi, ldap, mysql, snmp, sockets, gd
MySQL - 5.0.88-community-nt
RRDTool - 1.2.30
SNMP - At line 1 in (none)
Cannot find module (NET-SNMP-AGENT-MIB): At line 1 in (none)
Cannot find module (DISMAN-EVENT-MIB): At line 1 in (none)
No hostname specified.
USAGE: snmpwalk [OPTIONS] AGENT [OID]

Version: 5.5
Web: http://www.net-snmp.org/
Email: net-snmp-coders@lists.sourceforge.net

Plugins
  • PHP Network Weathermap (weathermap - v0.96a)
    Network Tools (tools - v0.3)
    Mobile Cacti (mobile - v0.1)
    Host Info (hostinfo - v0.2)
    Device Tracking (mactrack - v1.1)
    Login Page Mod (loginmod - v1.0)
    SSL Redirector (ssl - v0.1)
    Notices (Notices - v0.2c)
    Update Checker (update - v0.4)

I've got most other plugins working correctly... but having real issues with this one... I've read as much as I can find on this topic... basically I am getting the following error...

500 - Internal server error.
There is a problem with the resource you are looking for, and it cannot be displayed.

I've tried tweaking rights on the XML file/folder and have made sure I have add initial coordinates... anybody out there ever get this working on windows !!!! I would love to get this thing going...

Thanks in advance for any help...
User avatar
rukshankb
Posts: 10
Joined: Mon Sep 07, 2009 2:17 am
Location: Colombo, Sri Lanka
Contact:

Post by rukshankb »

I have following errors.
Notice: Undefined variable: hostArray in /var/www/cacti/plugins/gpsmap/gpsmap.php on line 67

Warning: Invalid argument supplied for foreach() in /var/www/cacti/plugins/gpsmap/includes/pointsxml.php on line 5
spiffydudex
Cacti User
Posts: 97
Joined: Thu Jul 24, 2008 11:21 am
Location: Hallsville, TX
Contact:

Re: Anyone get GPS Map working on Windows2008 ???

Post by spiffydudex »

maxamis wrote:Here's my setup
Cacti Version - 0.8.7e
Plugin Architecture - 2.5
Poller Type - CMD.php
Server Info - Windows NT 6.0
Web Server - Microsoft-IIS/7.0
PHP - 5.2.11
PHP Extensions - bcmath, calendar, com_dotnet, ctype, date, filter, ftp, hash, iconv, json, odbc, pcre, Reflection, session, libxml, standard, tokenizer, zlib, SimpleXML, dom, SPL, wddx, xml, xmlreader, xmlwriter, cgi-fcgi, ldap, mysql, snmp, sockets, gd
MySQL - 5.0.88-community-nt
RRDTool - 1.2.30
SNMP - At line 1 in (none)
Cannot find module (NET-SNMP-AGENT-MIB): At line 1 in (none)
Cannot find module (DISMAN-EVENT-MIB): At line 1 in (none)
No hostname specified.
USAGE: snmpwalk [OPTIONS] AGENT [OID]

Version: 5.5
Web: http://www.net-snmp.org/
Email: net-snmp-coders@lists.sourceforge.net

Plugins
  • PHP Network Weathermap (weathermap - v0.96a)
    Network Tools (tools - v0.3)
    Mobile Cacti (mobile - v0.1)
    Host Info (hostinfo - v0.2)
    Device Tracking (mactrack - v1.1)
    Login Page Mod (loginmod - v1.0)
    SSL Redirector (ssl - v0.1)
    Notices (Notices - v0.2c)
    Update Checker (update - v0.4)

I've got most other plugins working correctly... but having real issues with this one... I've read as much as I can find on this topic... basically I am getting the following error...

500 - Internal server error.
There is a problem with the resource you are looking for, and it cannot be displayed.

I've tried tweaking rights on the XML file/folder and have made sure I have add initial coordinates... anybody out there ever get this working on windows !!!! I would love to get this thing going...

Thanks in advance for any help...
I personally have never tested this on an IIS setup. My experience with IIS is very limited so I really don't know where to begin. I would check the IIS log files and see if you can garner more information.

rukshankb wrote:I have following errors.
Notice: Undefined variable: hostArray in /var/www/cacti/plugins/gpsmap/gpsmap.php on line 67

Warning: Invalid argument supplied for foreach() in /var/www/cacti/plugins/gpsmap/includes/pointsxml.php on line 5
Above line 67 there should be a silly error where the line is just

Code: Select all

$hostArray;
replace that with

Code: Select all

$hostArray = array();
oldeduardo
Posts: 1
Joined: Tue Mar 16, 2010 9:34 am

Post by oldeduardo »

Hi community,

Congrats for this wonderfull plugin

Regards.
shoelessfarmer
Posts: 11
Joined: Sun Mar 21, 2010 6:35 pm

Post by shoelessfarmer »

Hello,

This is a wonderful plugin! Nice work!!

I am curious though, has anybody looked into a way to automatically plot a location based on the SNMP Location? In my case we keep the SNMP location filled out for each piece of equipment...it is a physical street address, though not LAT/LONG.

So, along those lines, is there anyway to use the street address instead of LAT/LONG?


Keep up the good work! :D
zeosez
Posts: 6
Joined: Thu Mar 25, 2010 12:08 am

Post by zeosez »

Hi, I need some help. I install gsm map plugin. Its shows map after adding lat/log but when I add Lat / Log in host device to show host on map, for example ( I use http://itouchmap.com/latlong.html for get the coordinates)
lat : -4.628652
log: 55.448424

And save it and check the map, its not shown there, then i check the host coordinates.
coordinates automatically change or you can say adds additional numbers at the end.
lat : -4.6286520958
log: 55.4484242930

can anyone help me out what have i done wrong.
I can not able to add even single host.

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

Post by spiffydudex »

zeosez wrote:Hi, I need some help. I install gsm map plugin. Its shows map after adding lat/log but when I add Lat / Log in host device to show host on map, for example ( I use http://itouchmap.com/latlong.html for get the coordinates)
lat : -4.628652
log: 55.448424

And save it and check the map, its not shown there, then i check the host coordinates.
coordinates automatically change or you can say adds additional numbers at the end.
lat : -4.6286520958
log: 55.4484242930

can anyone help me out what have i done wrong.
I can not able to add even single host.

thanks in advance
In all honesty, I really don't know why it does that. I have the values stored in the database as floats with 13 places, 10 of those places are for designated use after the decimal point. From my understanding of coordinates after you get more than 6 decimal places its getting more precise. (IE withing 1 foot, 1 inch..etc) In all practicality you wont notice any difference. I just leave up to 10 decimal points just in case someone would require that much precision.

The storage code for the device parameters is:

Code: Select all

$fields_host_edit3['latitude'] = array(
				'friendly_name' => 'Latitude',
				'description' => 'The devices latitude coordinates',
				'method' => 'textbox',
				'max_length' => 13,
				'value' => '|arg1:latitude|',
				'default' => '',
);

On a more broad topic I was able to find some time over spring break to code some. I would have like to finish more, but its kinda hard when the girlfriend takes you on vacation to the beach. Anyways, some screenshots to fancy the eyes.

I am working on tying together the images for both Google earth and Cacti so that the colors will always be the same between the two programs.

There are still some small bugs such as the one in the third picture that I cannot figure out due to my lack of experience with the plugin architecture. If anyone knows how to solve this, please let me know. I know it is probably something small and silly I missed.

I think I am going to completely leave the weather option out of the next release. It is only so handy... besides I think the color differences will be the most desired improvement.
Attachments
Blue was selected as the "Up" color for the field modules. White was selected for "Up" for the APs
Blue was selected as the "Up" color for the field modules. White was selected for "Up" for the APs
map color_640x403.jpg (43.94 KiB) Viewed 7342 times
Image in Google earth. Sorry for all the blackout...need to protect privacy of the customers.
Image in Google earth. Sorry for all the blackout...need to protect privacy of the customers.
kmlMap_640x478.jpg (58.25 KiB) Viewed 7342 times
strange bug?
strange bug?
top.jpg (11.8 KiB) Viewed 7342 times
zeosez
Posts: 6
Joined: Thu Mar 25, 2010 12:08 am

Post by zeosez »

Thanks spiffydudex,

But i'm still unable to see any host in map. HOW TO ADD HOST.
I removed gpsXML.xml, so cacti generate new gpsXML.xml file, it did. but its empty. then i try to add another host, put lat/log. and then check gpsXML.xml file its still empty.
# more gpsXML.xml
<markers></markers>
#

Please can you help me out.
its better to post step by step guide, how to add hosts. that will not only me about others also.
thanks in advance
spiffydudex
Cacti User
Posts: 97
Joined: Thu Jul 24, 2008 11:21 am
Location: Hallsville, TX
Contact:

Post by spiffydudex »

Sounds like everything is working as it should. The one thing I noticed was that the newer version of PHP is a bit more strict for including files.
So, the two files in the <yoursite>/plugin/gpsmap/includes folder.

Check to make sure that at the top of the file sthere is

Code: Select all

<?php
instead of

Code: Select all

<?
I found this issue when I migrated my test cacti to a newer php version. This (small issue/dumb mistake) on my part could be in a few other files as well, but those are the two that deal with creating the XML output and could easily cause the problem you describe.

Hope that fixes it.
zeosez
Posts: 6
Joined: Thu Mar 25, 2010 12:08 am

Post by zeosez »

Thanks spiffydudex

after adding <?php in /include file, now gpsXML.xml start saving info,
but still not able to display any host on map.

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

Post by spiffydudex »

zeosez wrote:Thanks spiffydudex

after adding <?php in /include file, now gpsXML.xml start saving info,
but still not able to display any host on map.

Thanks in advance
sent a PM with more information about this.
spiffydudex
Cacti User
Posts: 97
Joined: Thu Jul 24, 2008 11:21 am
Location: Hallsville, TX
Contact:

Post by spiffydudex »

For all of you following this thread... A new GPSmaps has been uploaded to the original post in this thread.

Please let me know if you guys have any problems with it. Ive been coding on this late at night, burning the midnight oil. With some luck everything should be working well.

Sorry for the long wait!!!
Bingobango
Posts: 6
Joined: Mon Dec 17, 2007 2:39 am
Location: Terra Firma

Post by Bingobango »

I installed your new version on my Ubuntu 9.10 box, and unfortunately I'm getting some errors. The first was on line 204 in gpsmaps.php.

Code: Select all

<script src="http://maps.google.com/maps?file=api&v=2&key=<?php= $apiKey ?>" type="text/javascript"></script>

Change it into this:

<script src="http://maps.google.com/maps?file=api&v=2&key=<?php echo $apiKey ?>" type="text/javascript"></script>
Then I'm getting some more:

Code: Select all

Notice: Undefined variable: displayupdown in /var/www/plugins/gpsmap/includes/gpsmapinitial.php on line 64

Notice: Undefined index: GPScoverage in /var/www/plugins/gpsmap/gpsmap.php on line 69
These I haven't checked out yet, but at least I'm getting a map on my page now. :D
nobi67
Posts: 6
Joined: Wed Apr 21, 2010 9:45 am

Post by nobi67 »

I installed the new version on a Windows box and I'm getting exactly the same errors.
spiffydudex
Cacti User
Posts: 97
Joined: Thu Jul 24, 2008 11:21 am
Location: Hallsville, TX
Contact:

Post by spiffydudex »

Found the errors and have fixed them. will be posting 1.51 shortly.
Also found and fixed a small issue in the KML creation based on 0 indexes.

Version 1.51 is posted in the original post. uninstall/install as normal and that should fix everything.
Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests