Bulk import GPS Coordinates into Google Maps

Scrutinizer is an enterprise/business class NetFlow and sFlow analysis tool. Scrutinizer provides historical trends of the company's critical network interfaces as well as the details on:

Who: The end system causing the traffic
What: The application/protocol that is being used
When: The time frame it has been occurring for
Where: The network connection that is affected

Moderators: scottr, Moderator Team

Bulk import GPS Coordinates into Google Maps

Postby peterkuric » Mon Sep 19, 2011 4:51 am

Hi

I'm just setting up the Google Map function in Scrutinizer and I was wondering if there is a bulk import method for the latitude/longitude details for each object as it is quite time consuming and prone to human error when there 500+ hosts to configure manually.

I'd even be happy updating via the mysql command line however I can't seem to find the database table that this data lives in.

Any ideas?
peterkuric
 
Posts: 3
Joined: Mon Sep 19, 2011 4:38 am

Re: Bulk import GPS Coordinates into Google Maps

Postby mkrygeri » Mon Sep 19, 2011 8:04 am

I have a script That I could modify to do this if you want.
Do you have the sysLocation set on all your routers set to values that could be looked up in Google? e.g. 1060 W. Addison, Chicago Il" or "Bangor, Maine"?

I could also easily modify it do pull in a CSV that contains Exporter IP addresses and physical addresses like the following:
Code: Select all
"10.1.1.1","1060 W. Addison, Chicago Il"
"10.1.1.2"."Bangor, me"


If you want to just try this yourself, the table you want to update is plixer.membership. It looks like this:
Code: Select all
mysql> select * from plixer.membership ;
+-----------+----------+-----------------+-----------------+------+------+---------+--------+
| object_id | group_id | x               | y               | lng  | lat  | address | hidden |
+-----------+----------+-----------------+-----------------+------+------+---------+--------+
|         1 |        1 | 50.000000000000 | 50.000000000000 | NULL | NULL | NULL    |      0 |
|         2 |        1 | 50.000000000000 | 50.000000000000 | NULL | NULL | NULL    |      0 |
+-----------+----------+-----------------+-----------------+------+------+---------+--------+


The object_id is the id assigned to the exporter in the plixer.exporters table.

You would update the table like this:
Code: Select all
update plixer.membership set lat='45.0963338',lng='-94.4101481' where object_id = '1'


Hope this helps! Let Me know if you would like to check out that script!

Mike Krygeris
mkrygeri
 
Posts: 87
Joined: Tue Aug 02, 2005 8:47 am

Re: Bulk import GPS Coordinates into Google Maps

Postby peterkuric » Tue Sep 20, 2011 10:56 am

Thanks Mike!

I've now successfully imported all my GPS coordinates using the update query and have a map of Australia with my sites scattered across it, looks great.

For those wondering how the table relationships work for this stuff this query should give you an idea:
Code: Select all
select s.sysname,m.lat,m.lng from snmpsystem s,membership m,exporters e where m.object_id = e.object_id and e.exporter_id = s.device_id;


The only problem is it takes 2 whole minutes for the map to load! So its just a grey screen whilst loading. The page appears to refresh every 5mins so I'm getting about 3mins of map time in any 5min block! =(

This sucks because it's on a big screen in our NOC that everyone can see.

Has anyone encountered this problem before? There's about 400 nodes on my map if that helps
peterkuric
 
Posts: 3
Joined: Mon Sep 19, 2011 4:38 am

Re: Bulk import GPS Coordinates into Google Maps

Postby mkrygeri » Tue Sep 20, 2011 12:37 pm

Hi peterkuric,
I've spoken with a developer about this and they are looking into it. I'll let you know what we find.
I'm curious, have you tried this on multiple browsers? Is there a difference in load time between Firefox, Chrome and IE? I'm wondering if this is more of a js issue or a back-end issue.

Thanks,
Mike Krygeris
mkrygeri
 
Posts: 87
Joined: Tue Aug 02, 2005 8:47 am

Re: Bulk import GPS Coordinates into Google Maps

Postby peterkuric » Tue Sep 20, 2011 7:53 pm

Hi Mike

I've only tried with Firefox and IE and its pretty much the same.

I've also noticed the CPU load on the server is fairly high.

Cheers
Peter
peterkuric
 
Posts: 3
Joined: Mon Sep 19, 2011 4:38 am

Re: Bulk import GPS Coordinates into Google Maps

Postby DMalt » Wed Sep 21, 2011 8:21 am

mkrygeri wrote:I have a script That I could modify to do this if you want.
Do you have the sysLocation set on all your routers set to values that could be looked up in Google? e.g. 1060 W. Addison, Chicago Il" or "Bangor, Maine"?

Hope this helps! Let Me know if you would like to check out that script!

Mike Krygeris


If the offer is still there, the script would be great! I have all the addresses but not the GPS coordinates.

If it is more specific or better to do GPS, does anyone have a suggestion on an easy way to convert a batch (over 50) of addresses to GPS coordinates?

Thanks for the assistance,
David Maltenfort
DMalt
 
Posts: 2
Joined: Wed Sep 21, 2011 8:16 am

Re: Bulk import GPS Coordinates into Google Maps

Postby BenjaminM » Wed Sep 21, 2011 9:10 am

Hi DMalt,

Indeed there is a way to convert addresses to coordinates. A good site to achieve is http://www.gpsvisualizer.com/geocoder/

You can input multiple addresses one line at a time and it will convert them all to GPS coordinates.

Thanks,
Ben
Benjamin Moore
Plixer International Tech Support
(207)324-8805 ex:4
Bio: viewtopic.php?f=20&t=2404
Twitter: http://twitter.com/ActiveBeerGeek/
User avatar
BenjaminM
 
Posts: 63
Joined: Tue Mar 01, 2011 11:33 am
Location: Sanford, Maine

Re: Bulk import GPS Coordinates into Google Maps

Postby DMalt » Mon Sep 26, 2011 7:49 am

Ok, I have the GPS coordiates. Now the probelm is that I am a complete MYSql newb. I'm not sure what to do next. I see that I should run:

update plixer.membership set lat='45.0963338',lng='-94.4101481' where object_id = '1'

Though I'm not sure on:
A) object_id
B) what format a file should be
C) how to execute the file once I have made it

Thanks for the assistance in advance.

David
DMalt
 
Posts: 2
Joined: Wed Sep 21, 2011 8:16 am

Re: Bulk import GPS Coordinates into Google Maps

Postby mkrygeri » Mon Sep 26, 2011 8:28 am

The object ID is assigned in the plixer.exporters table.
A simple query to to get that list would be
Code: Select all
select object_id,inet_b2a(exporter_id) from plixer.exporters;




The format of the file should be a .sql file that can be imported into mysql using the mysql, although these are queries I would just paste in at the mysql prompt.

mysql -u root -p plixer < data.sql

Make sure there is a semicolon at the end of each query
Code: Select all
update plixer.membership set lat='45.0963338',lng='-94.4101481' where object_id = '1';



If you are unsure about mysql queries, make sure you back up your plixer database since the changes are not reversible.
mkrygeri
 
Posts: 87
Joined: Tue Aug 02, 2005 8:47 am


Return to Scrutinizer

Who is online

Users browsing this forum: No registered users and 0 guests

Who is online

In total there are 0 users online :: 0 registered, 0 hidden and 0 guests (based on users active over the past 5 minutes)
Most users ever online was 60 on Thu Jun 25, 2009 9:07 am

Users browsing this forum: No registered users and 0 guests