GPS Maps for Cacti

Announcements concerning Plugins for Cacti

Moderators: Developers, Moderators

Post Reply
anmomin1
Cacti User
Posts: 63
Joined: Mon May 29, 2017 4:14 pm

Re: GPS Maps for Cacti

Post by anmomin1 »

Rno wrote: Wed Sep 11, 2019 4:59 am snmp location has to be in that format:

Country;City;Street_Building;Floor;Room;Rack;RU;Lat;Long


so if you have only lat long:
;;;;;;;Lat;Long

or if you have street address at minimum
Country;City;Street_Building
Hi @Rno,
I got closer now map is showing device in google map thanks for the informaiton.
I found that when I got to map tab it always have default to Switzerland.. Also I get Message when trying to access map (cactimaps-1.png)..
I found under settings -> Misc (cactimap-2.png) there is Map setting with API Key ( That's paid service) but you mentioned it should allow 2500 devices without buying any service from google..
I didn't find anywhere to set map to default location.

Thanks.
Attachments
cactimap-2.png
cactimap-2.png (8.84 KiB) Viewed 8093 times
cactimaps-1.png
cactimaps-1.png (417.67 KiB) Viewed 8093 times
anmomin1
Cacti User
Posts: 63
Joined: Mon May 29, 2017 4:14 pm

Re: GPS Maps for Cacti

Post by anmomin1 »

Rno wrote: Wed Sep 11, 2019 4:59 am snmp location has to be in that format:

Country;City;Street_Building;Floor;Room;Rack;RU;Lat;Long


so if you have only lat long:
;;;;;;;Lat;Long

or if you have street address at minimum
Country;City;Street_Building
Thanks @Rno
I tried ;;;;;;;Lat;Long and it works...
somehow Country;City;Street_Building doesn't work,, not sure if it's because of space in street
following is example:
Canada;Edmonton;11th Ave
I tried following too
Canada;Edmonton;11thAve
Canada; Edmontonl11th Ave_2230
netniV
Cacti Guru User
Posts: 3440
Joined: Sun Aug 27, 2017 12:05 am

Re: GPS Maps for Cacti

Post by netniV »

I'm pretty sure that Google Maps changed their API offering a while ago so that you have to have an account with them to get an API key with card details associated in case they need to change you. However, they do also give you an allowance so that you shouldn't get charged as long as the number of requests is under their limits.
Cacti Developer & Release Manager
The Cacti Group

Director
BV IT Solutions Ltd

+--------------------------------------------------------------------------+

Cacti Resources:
Cacti Website (including releases)
Cacti Issues
Cacti Development Releases
Cacti Development Documentation
anmomin1
Cacti User
Posts: 63
Joined: Mon May 29, 2017 4:14 pm

Re: GPS Maps for Cacti

Post by anmomin1 »

netniV wrote: Thu Sep 12, 2019 2:47 am I'm pretty sure that Google Maps changed their API offering a while ago so that you have to have an account with them to get an API key with card details associated in case they need to change you. However, they do also give you an allowance so that you shouldn't get charged as long as the number of requests is under their limits.
@netniV..
Thanks for the information.
I am now trying to give gpsmap a go... got error in php file :
PHP Parse error: syntax error, unexpected $end in /var/www/cacti/plugins/gpsmap/gpsmap.php on line 460, referer: http://192.168.129.73/cacti/utilities.php
I changed <? to <?php and now I am not getting internal server error 500.
But now I am getting following message when clicking on gpsmap tab:

Please make sure to properly configure GPS Map first under settings -> misc

I have attached screen shoot only setting that I have is initial co-ordinates. I have one device with latitude and longitude information
Attachments
gpsmap2.png
gpsmap2.png (27.77 KiB) Viewed 7580 times
gpsmap-1.png
gpsmap-1.png (34.3 KiB) Viewed 7581 times
Rno
Cacti Pro User
Posts: 680
Joined: Wed Dec 07, 2011 9:19 am

Re: GPS Maps for Cacti

Post by Rno »

It's look like I lost the answer I send you this morning.

Anyway I upload a new version (0.36) on github (https://github.com/arno-st/map/tree/cacti-0.8x):
1: option to use openstreetmap instead of google
2: center of the map can be set into the settings page, if not it will use Greenwich for it
3: Geocod one device at time (from edvice page)

There is more file for openstreetmap that need to be donwloaded and put into the same folder as the plugin:
MarkerCluster.Default.css
MarkerCluster.css
OpenLayers.js
leaflet.markercluster.js
markerclusterer.js

I try the location you give me 'Canada;edmonton;11st av' and it works

Can you activate the log of MAP and send me the output, it should be that large but I should be able to get some input.
Try in Goolmap mode and Openstreetmap mode too.

I'm still having a issue with opensteeetmap and the cluster of marker, it only show the number of device on a sector, and not the icon who should go with it.

Thanks for you return for error and so on.
Test
Almalinux
php 8.2.14
mariadb 10.6.16
Cacti 1.2.27
Spine 1.2.27
RRD 1.7.2
thold 1.8
monitor 2.5
syslog 3.2
flowview: 3.3
weathermap 1.0 Beta
anmomin1
Cacti User
Posts: 63
Joined: Mon May 29, 2017 4:14 pm

Re: GPS Maps for Cacti

Post by anmomin1 »

Rno wrote: Thu Sep 12, 2019 9:57 am It's look like I lost the answer I send you this morning.

Anyway I upload a new version (0.36) on github (https://github.com/arno-st/map/tree/cacti-0.8x):
1: option to use openstreetmap instead of google
2: center of the map can be set into the settings page, if not it will use Greenwich for it
3: Geocod one device at time (from edvice page)

There is more file for openstreetmap that need to be donwloaded and put into the same folder as the plugin:
MarkerCluster.Default.css
MarkerCluster.css
OpenLayers.js
leaflet.markercluster.js
markerclusterer.js

I try the location you give me 'Canada;edmonton;11st av' and it works

Can you activate the log of MAP and send me the output, it should be that large but I should be able to get some input.
Try in Goolmap mode and Openstreetmap mode too.

I'm still having a issue with opensteeetmap and the cluster of marker, it only show the number of device on a sector, and not the icon who should go with it.

Thanks for you return for error and so on.
Thanks @Rno for sharing new version...
I did rename old to mapold and put new one in plugin folder with all correct access. Getting following in /var/log/httpd/error_log :

PHP Fatal error: Cannot redeclare plugin_map_install() (previously declared in /var/www/cacti/plugins/map/setup.php:26) in /var/www/cacti/plugins/mapold/setup.php on line 38, referer: http://XXX.XXX.XXX.XXX/cacti/utilities. ... ew_logfile

When clicking pluging under GUI I get blank page...
I can get access to plugins if I remove that folder.

I did try to run php ./setup.php
not sure where it is refering to oldmap folder
Rno
Cacti Pro User
Posts: 680
Joined: Wed Dec 07, 2011 9:19 am

Re: GPS Maps for Cacti

Post by Rno »

You should not get the old one, otherwise cacti will look into both directory for the setup.php and since all has the same function name, it give you the error you have.

So remove the ole one and keep only the new version.

And then you chould be able to install/activate the plugins on the GUI
Test
Almalinux
php 8.2.14
mariadb 10.6.16
Cacti 1.2.27
Spine 1.2.27
RRD 1.7.2
thold 1.8
monitor 2.5
syslog 3.2
flowview: 3.3
weathermap 1.0 Beta
anmomin1
Cacti User
Posts: 63
Joined: Mon May 29, 2017 4:14 pm

Re: GPS Maps for Cacti

Post by anmomin1 »

Rno wrote: Fri Sep 13, 2019 12:00 am You should not get the old one, otherwise cacti will look into both directory for the setup.php and since all has the same function name, it give you the error you have.

So remove the ole one and keep only the new version.

And then you chould be able to install/activate the plugins on the GUI

@ Rno,
I have new one installed.. got map and put my setting in misc... I put my initial location and select option other than google..
now I can't access setting for my cacti...
error log:
[Fri Sep 13 00:38:49 2019] [error] [client XXX.XXX.XXX.XXX] PHP Fatal error: Class 'DOMDocument' not found in /var/www/cacti/plugins/map/setup.php on line 690, referer: http://XXX.XXX.XXX.XXX/cacti/plugins.php


Access log:
"GET /cacti/settings.php HTTP/1.1" 500 - "http://XXX.XXX.XXX.XXX/cacti/plugins.php" "Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.132 Safari/537.36"

I tired uninstalled and removing map ... delete map folder and tried again,,, still no luck.. as soon as I enable map plugin,, cacti setting gives me 500 error message..

THanks.
Rno
Cacti Pro User
Posts: 680
Joined: Wed Dec 07, 2011 9:19 am

Re: GPS Maps for Cacti

Post by Rno »

A php extension is missing:
https://stackoverflow.com/questions/143 ... -not-found

I will add this information to my README
Test
Almalinux
php 8.2.14
mariadb 10.6.16
Cacti 1.2.27
Spine 1.2.27
RRD 1.7.2
thold 1.8
monitor 2.5
syslog 3.2
flowview: 3.3
weathermap 1.0 Beta
anmomin1
Cacti User
Posts: 63
Joined: Mon May 29, 2017 4:14 pm

Re: GPS Maps for Cacti

Post by anmomin1 »

Rno wrote: Fri Sep 13, 2019 3:34 am A php extension is missing:
https://stackoverflow.com/questions/143 ... -not-found

I will add this information to my README
@Rhn.. Thanks for the information... I did install php-xml...
Installed:
php-xml.x86_64 0:5.3.3-49.el6

Dependency Installed:
libxslt.x86_64 0:1.1.26-2.el6_3.1

Dependency Updated:
php.x86_64 0:5.3.3-49.el6 php-cli.x86_64 0:5.3.3-49.el6 php-common.x86_64 0:5.3.3-49.el6
php-devel.x86_64 0:5.3.3-49.el6 php-gd.x86_64 0:5.3.3-49.el6 php-mbstring.x86_64 0:5.3.3-49.el6
php-mysql.x86_64 0:5.3.3-49.el6 php-pdo.x86_64 0:5.3.3-49.el6 php-snmp.x86_64 0:5.3.3-49.el6

Complete!


And try to access setting and still same error:

[error] [client XXX.XXX.XXX.XXX] PHP Fatal error: Class 'DOMDocument' not found in /var/www/cacti/plugins/map/setup.php on line 690, referer: http://XXX.XXX.XXX.XXX/cacti/plugins.php
netniV
Cacti Guru User
Posts: 3440
Joined: Sun Aug 27, 2017 12:05 am

Re: GPS Maps for Cacti

Post by netniV »

Did you enable it within the php.ini or apache mods?
Cacti Developer & Release Manager
The Cacti Group

Director
BV IT Solutions Ltd

+--------------------------------------------------------------------------+

Cacti Resources:
Cacti Website (including releases)
Cacti Issues
Cacti Development Releases
Cacti Development Documentation
anmomin1
Cacti User
Posts: 63
Joined: Mon May 29, 2017 4:14 pm

Re: GPS Maps for Cacti

Post by anmomin1 »

netniV wrote: Fri Sep 13, 2019 6:39 pm Did you enable it within the php.ini or apache mods?
THanks Guys you have been really helpful..
Not Sure how to enable it..
but I restarted httpd service and seems like it fixed the issue...now map is showing up...
my device was working with latitude and longituge ... but now it does show device either with just latitude;longitude info,,, nor with country;city;street
I enable the debug logs...under misc info..
And got following in cacti log:
MAP: Poller[0] Query location device: XXX.XXX.XXX.XX ;;;;;;;95.4505386353;-204.611831
MAP: Poller[0] Google Geocoding error:
MAP: Poller[0] Query location device: XXX.XXX.XXX.XX ;;;;;;;95.4505386353;-204.611831
MAP: Poller[0] Google Geocoding error:
SYSTEM STATS: Time:0.1175 Method:spine Processes:1 Threads:2 Hosts:2 HostsPerProcess:2 DataSources:624 RRDsProcessed:0
MAP: Poller[0] Google Geocoding error:
MAP: Poller[0] Google Geocoding error:


Is that the place where I will get debug log or seomewehre else?


Laitude and longitude works fine in open steet MAp.

Thanks.
Rno
Cacti Pro User
Posts: 680
Joined: Wed Dec 07, 2011 9:19 am

Re: GPS Maps for Cacti

Post by Rno »

Hello,
Ok so your latitude and longitude are wrong.

Latitue is + - 90°
Longitude is + - 180°

And I don't understand this line:
my device was working with latitude and longituge ... but now it does show device either with just latitude;longitude info,,, nor with country;city;street


Is it working with country;city;street or not ?

Other log for error will be into your web server error_log
Test
Almalinux
php 8.2.14
mariadb 10.6.16
Cacti 1.2.27
Spine 1.2.27
RRD 1.7.2
thold 1.8
monitor 2.5
syslog 3.2
flowview: 3.3
weathermap 1.0 Beta
anmomin1
Cacti User
Posts: 63
Joined: Mon May 29, 2017 4:14 pm

Re: GPS Maps for Cacti

Post by anmomin1 »

Rno wrote: Tue Sep 17, 2019 1:04 am Hello,
Ok so your latitude and longitude are wrong.

Latitue is + - 90°
Longitude is + - 180°

And I don't understand this line:
my device was working with latitude and longitude ... but now it does show device either with just latitude;longitude info,,, nor with country;city;street


Is it working with country;city;street or not ?

Other log for error will be into your web server error_log

Hi Rno,
I should mentioned .. I changed latitude and longitude to random numbers... I am using correct latitude and longitude information (that lies in values you mentioned).

What I meant is with older version of Map... I had same latitude and longitude were working with google....but after installing new version of map addons,., Google doesn't work either with Latitude;Longitude or with address format.



Only OpenStreetMap works with latitude and Longitude... I tried format you mentioned Country;City;Street_Building; but it did work... I have sent you address in private message.
Following are error I get when trying with Country;City;Street_Building;

error_log
[error] [client XXX.XXX.XXX.XXX] PHP Notice: Undefined offset: 0 in /var/www/cacti/plugins/map/setup.php on line 699, referer: http://XXX.XXX.XXX.XXX/cacti/utilities.php
[error] [client XXX.XXX.XXX.XXX] PHP Notice: Undefined offset: 0 in /var/www/cacti/plugins/map/setup.php on line 699, referer: http://XXX.XXX.XXX.XXX/cacti/utilities. ... ap_rebuild


Cacti log
MAP: Poller[0] Query location device: XXX.XXX.XXX.XX Country;City;Street AVE_2543;
MAP: Poller[0] lati: longi:
MAP: Poller[0] Query location device: XXX.XXX.XXX.XX Country;City;Street AVE_2543;
MAP: Poller[0] host: 202 address: 1

Thanks.


THanks.
Rno
Cacti Pro User
Posts: 680
Joined: Wed Dec 07, 2011 9:19 am

Re: GPS Maps for Cacti

Post by Rno »

Hi,
Thanks for the return, I can't find so fare any explanation!

can you send me again you location in PM, I didn't get it.



And can you try with this location:
Canada;edmonton;11th av 2230

it works on my server, either with Googlemap and openstreet map
Test
Almalinux
php 8.2.14
mariadb 10.6.16
Cacti 1.2.27
Spine 1.2.27
RRD 1.7.2
thold 1.8
monitor 2.5
syslog 3.2
flowview: 3.3
weathermap 1.0 Beta
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests