GPS Maps for Cacti

Announcements concerning Plugins for Cacti

Moderators: Developers, Moderators

Post Reply
tictac
Posts: 2
Joined: Wed Nov 03, 2010 4:59 am
Location: France

Re: GPS Maps for Cacti

Post by tictac »

Hi,
Yes a simple refresh should be sufficient and perhaps also a sound alert when a device is going down.
Regards.
puflet
Posts: 7
Joined: Mon Oct 19, 2009 3:17 pm
Contact:

Re: GPS Maps for Cacti

Post by puflet »

Hi there,
I just discovered this nice plugin. Is there a way to get the host status from a sql table other than 'hosts'?
Here's my case:
I'm using Cacti for graphing local switches/routers, Nagios to monitor remote offices, and NPC to view everything at one place. So ndo2db is already injecting host's status from nagios into mysql, and GPSmap only needs to lookup host status in another table. Is there a way to do that?
geskorup
Posts: 24
Joined: Thu Nov 23, 2006 1:08 am

Re: GPS Maps for Cacti

Post by geskorup »

Hi, this plugin is pretty neat. I have a large Motorola Canopy network (but mixed in with that is other non-Canopy equipment). As I'm sure you are aware, the Canopy radios have a fixed range setting for frame timing. The way this does coverage overlays seems odd, to me anyway. I do NOT have the subscriber modules on the same IP subnet as the access points for security reasons. My management network is completely separate from the CPE networks. So this is impossible to do coverage/radius overlays. On top of that, many sites are sectorized and some do not have 360 degree coverage. A simple radius setting per host could solve this somewhat. Just thought I'd throw in my $0.02. Thanks
puflet
Posts: 7
Joined: Mon Oct 19, 2009 3:17 pm
Contact:

Re: GPS Maps for Cacti

Post by puflet »

I managed to get GPSmap working with npc, if someone is interested here's how I did it:
around line 57 gpsmap.php we have:

Code: Select all

$result = mysql_query("SELECT * FROM `host` LEFT JOIN gpsmap_templates ON host.host_template_id = gpsmap_templates.templateID");
which we change to

Code: Select all

$result = mysql_query("SELECT * FROM `host` LEFT JOIN npc_hoststatus ON host.npc_host_object_id = npc_hoststatus.host_object_id LEFT JOIN gpsmap_templates ON host.host_template_id = gpsmap_templates.templateID");
then around line 65 we change the column where we 'see' the status of the host

Code: Select all

                $status = $row['current_state'];
and a few lines below we put this:

Code: Select all

if ($status == 0){
                        $status = "up";
                }elseif($status == 1){
                        $status = "down";
                }elseif($status == 2){
                        $status = "recovering";
                }else{ $status = "undefined"; }
                if($row['disabled'] == "on"){
                        $status = "disabled";
                }
This is done on Cacti: 0.8.7g, Plugin Architecture: 2.8, NPC: 2.0.4, GPSmap: 1.5, Nagios3 with ndo3db
I'll attach the edited gpsmap.php and a screenshot of what I've done
Attachments
gpsmap-edit.tar.gz
Edited version of gpsmap.php
(4 KiB) Downloaded 213 times
gpsmap.png
gpsmap.png (240.32 KiB) Viewed 4847 times
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,

This plugin have a limit on the number of guests they can handle ?
I saw an existing bug is not seeing some equipment, for my part by adding equipments they are all gone in the map :(
Is there a way to see why and how in logs ?
I have seen this in my error.log from apache2 :

[Sun Mar 06 18:43:58 2011] [error] [client 10.xxx.xxx.xx] PHP Deprecated: Function ereg() is deprecated in /usr/share/cacti/site/lib/html_validate.php on line 38, referer: http://xxxx.xxxxxxx.fr/cacti/plugins/gpsmap/gpsmap.php
[Sun Mar 06 18:43:58 2011] [error] [client 10.xxx.xxx.xx] PHP Deprecated: Function split() is deprecated in /usr/share/cacti/site/lib/functions.php on line 1744, referer: http://xxxx.xxxxxxx.fr/cacti/plugins/gpsmap/gpsmap.php
[Sun Mar 06 18:43:58 2011] [error] [client 10.xxx.xxx.xx] PHP Deprecated: Function session_unregister() is deprecated in /usr/share/cacti/site/lib/functions.php on line 359, referer: http://xxxx.xxxxxxx.fr/cacti/plugins/gpsmap/gpsmap.php

Thank you for yours answers and advice :)

EDIT : My problem seemed to come from my google api key, I refreshed and it worked again.
Last edited by tosage on Mon Mar 14, 2011 4:04 am, edited 1 time in total.
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
niobe
Cacti User
Posts: 228
Joined: Mon Mar 10, 2008 6:52 pm
Location: Australia

Re: GPS Maps for Cacti

Post by niobe »

Great plugin!
Has anyone tried to tackle the console always showing problem?
I seem to recall having the same problem with a plugin I wrote a couple of years ago, so if no-ones tried I'll give it a go.
By the way is the OP still developing?
thanks,
N
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 »

niobe wrote:Great plugin!
Has anyone tried to tackle the console always showing problem?
I seem to recall having the same problem with a plugin I wrote a couple of years ago, so if no-ones tried I'll give it a go.
By the way is the OP still developing?
thanks,
N
I am still developing and adding features. Its been a while since the 1.53 release and the leftover unfinished business has bugging me. Like you mentioned, I am still having issues with the console tab still being highlighted. I cannot for the life of me figure out what is causing that problem. My code is practically identical to that of the THold plugin.

The 1.6 release candidate is close. This is my last semester at university before I graduate so I have been struggling to find adequate time to finish this project.

For the most part, these are the new features with 1.6

-USA Regional weather overlays (All I have is NOAA data unless someone else can point me elsewhere for other countries)
-Better manipulation of Map Templates (includes Edit feature previously talked about)
-Grouping of overlapping nodes
-Overlapped nodes will have information placed into tabs
-Ability to include a selected graph in the device info
-Reduced overlays to just "Subnet Traversal" (enable/disable overlay in settings)
-Overlays can be turned on/off in the settings
-Coverage overlays are can now be directional (degree settings)

(This is looking good for the 1.61 release)-Devices can be assigned group IDs, these group IDs are used to determine distance for overlays. Javascript will be used to enable/disable the display of groups.

Most notably you should see a performance increase in 1.6 vs. 1.53. In 1.53, most features were tacked on top of development code. In 1.6 the whole processing engine has been rewritten to better support multiple groups and types. Files are only included when needed, rather than everything being included from the start.

1.6 is more PIA compliant. This means that "uninstalling" will remove the GPS data from your database.

I am still trying to workout a good path to upgrade from 1.53 to 1.6 without having to do an SQL dump. I know PIA has an update function, but there is little documentation describing how it works.

The main thing holding back from releasing 1.6RC is messy code. I'm quite ashamed of the way it looks and it is not very efficient is some areas. Not to mention there is little commenting/documentation on the functions.


Thanks for the interest in the plugin, if you have any questions please ask.

Andy
tosage
Cacti User
Posts: 164
Joined: Wed Jul 28, 2010 5:05 am
Location: France

Re: GPS Maps for Cacti

Post by tosage »

Hey spiffy,

Good news, i wait for your new module with interested :)

Thanks in advance !
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
lany
Posts: 12
Joined: Sun Mar 18, 2007 4:33 am

Re: GPS Maps for Cacti

Post by lany »

Just installed gpsmap and I really like it. The grouping of overlapping nodes that you´re talking about would be a very nice feature.

Thanks!
lany
Posts: 12
Joined: Sun Mar 18, 2007 4:33 am

Re:

Post by lany »

Hello

I´m having this problem to. I think it might have something with the representation of float values i mysql since the exact same thing happens if I try to edit the fields "manually" i the database. If I store the values as decimal I can type in what I want into the database field but not when type is float. Did anyone solve this problem?

Best regards
Lars
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
lany
Posts: 12
Joined: Sun Mar 18, 2007 4:33 am

Re: Re:

Post by lany »

More info:

http://dev.mysql.com/doc/refman/5.0/en/ ... types.html

Floating-Point (Approximate-Value) Types
The FLOAT and DOUBLE types represent approximate numeric data values. MySQL uses four bytes for single-precision values and eight bytes for double-precision values.
For FLOAT, the SQL standard permits an optional specification of the precision (but not the range of the exponent) in bits following the keyword FLOAT in parentheses. MySQL also supports this optional precision specification, but the precision value is used only to determine storage size. A precision from 0 to 23 results in a four-byte single-precision FLOAT column. A precision from 24 to 53 results in an eight-byte double-precision DOUBLE column.
MySQL permits a nonstandard syntax: FLOAT(M,D) or REAL(M,D) or DOUBLE PRECISION(M,D). Here, “(M,D)” means than values can be stored with up to M digits in total, of which D digits may be after the decimal point. For example, a column defined as FLOAT(7,4) will look like -999.9999 when displayed. MySQL performs rounding when storing values, so if you insert 999.00009 into a FLOAT(7,4) column, the approximate result is 999.0001. Because floating-point values are approximate and not stored as exact values, attempts to treat them as exact in comparisons may lead to problems. They are also subject to platform or implementation dependencies. For more information, see Section C.5.5.8, “Problems with Floating-Point Values”
For maximum portability, code requiring storage of approximate numeric data values should use FLOAT or DOUBLE PRECISION with no specification of precision or number of digits.



lany wrote:Hello

I´m having this problem to. I think it might have something with the representation of float values i mysql since the exact same thing happens if I try to edit the fields "manually" i the database. If I store the values as decimal I can type in what I want into the database field but not when type is float. Did anyone solve this problem?

Best regards
Lars
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
fg1010
Posts: 18
Joined: Mon Mar 21, 2011 11:41 am

Re: GPS Maps for Cacti

Post by fg1010 »

HI there.

I have the problem wiuth 1.53 that host doesn't show on the map. There are someone that can solve this problem ???

If 1.6 is right to come, please spiffydudex fix the compatibility problem with 0.87g and PIA 2.8 (I've that versions)
lany
Posts: 12
Joined: Sun Mar 18, 2007 4:33 am

Re: GPS Maps for Cacti

Post by lany »

fg1010 wrote:HI there.

I have the problem wiuth 1.53 that host doesn't show on the map. There are someone that can solve this problem ???

If 1.6 is right to come, please spiffydudex fix the compatibility problem with 0.87g and PIA 2.8 (I've that versions)

I think it has to do with the browser. I had troubles with ie 8 and tried google crome. Once the coordinates are saved with a working browser the host can be viewed wiith any browser.
fg1010
Posts: 18
Joined: Mon Mar 21, 2011 11:41 am

Re: GPS Maps for Cacti

Post by fg1010 »

lany wrote:
fg1010 wrote:HI there.

I have the problem wiuth 1.53 that host doesn't show on the map. There are someone that can solve this problem ???

If 1.6 is right to come, please spiffydudex fix the compatibility problem with 0.87g and PIA 2.8 (I've that versions)

I think it has to do with the browser. I had troubles with ie 8 and tried google crome. Once the coordinates are saved with a working browser the host can be viewed wiith any browser.

mmmmm for me chrome, firefox and konkeror doesn't work, but IE8 can do the trick, thanks !!
niobe
Cacti User
Posts: 228
Joined: Mon Mar 10, 2008 6:52 pm
Location: Australia

Re: GPS Maps for Cacti

Post by niobe »

spiffydudex wrote: I am still developing and adding features. Its been a while since the 1.53 release and the leftover unfinished business has bugging me. Like you mentioned, I am still having issues with the console tab still being highlighted. I cannot for the life of me figure out what is causing that problem. My code is practically identical to that of the THold plugin.
Hi Andy,

Well I have fixed this problem. In gpsmap.php, change this:

Code: Select all

include_once("./include/top_header.php");
to this:

Code: Select all

include_once("./include/top_graph_header.php");
The side effect of this is that GPSMap no longer displays the console menu down the side, but not sure that's what was intended. The overall reason is that cacti is basically divided into console pages/functions and graph pages/functions and the plugin architecture architecture tends to assume you are using the graph pages.

Great to hear you are still developing. I would love to see two things: grouping by host template, and kml export.
For example a sidebar with checkboxes for each host template, and perhaps a hostname filter, and then an export function.
This will enable us to dynamically create and export different network views, say a wireless map for public access, and a switch map for internal use.

cheers!

N
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests