GPS Maps for Cacti

Announcements concerning Plugins for Cacti

Moderators: Moderators, Developers

Post Reply
Author
Message
anmomin1
Posts: 49
Joined: Mon May 29, 2017 4:14 pm

Re: GPS Maps for Cacti

#301 Post by anmomin1 » Wed Sep 11, 2019 11:03 am

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 545 times
cactimaps-1.png
cactimaps-1.png (417.67 KiB) Viewed 545 times

anmomin1
Posts: 49
Joined: Mon May 29, 2017 4:14 pm

Re: GPS Maps for Cacti

#302 Post by anmomin1 » Wed Sep 11, 2019 2:54 pm

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: 2779
Joined: Sun Aug 27, 2017 12:05 am

Re: GPS Maps for Cacti

#303 Post by netniV » 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.

anmomin1
Posts: 49
Joined: Mon May 29, 2017 4:14 pm

Re: GPS Maps for Cacti

#304 Post by anmomin1 » Thu Sep 12, 2019 9:16 am

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 32 times
gpsmap-1.png
gpsmap-1.png (34.3 KiB) Viewed 33 times

Rno
Cacti User
Posts: 329
Joined: Wed Dec 07, 2011 9:19 am

Re: GPS Maps for Cacti

#305 Post by Rno » 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.
CentOS
Production
Cacti 0.8.8h
Spine 0.8.8h
PIA 3.1
Aggregate 0.75
Monitor 1.3
Settings 0.71
Weathermap 0.98
Thold 0.5
rrdclean 0.41

Own plugin: LinkDiscovery 0.45, Map 0.36

Test
Cacti 1.2.1
Spine 1.2.1
thold 1.0.6
monitor 2.3.5
php 7.2.11
mariadb 5.5.56
Own plugin:
ExtendDB 1.1.2
LinkDiscovery 1.2.4
Map 1.2.5

anmomin1
Posts: 49
Joined: Mon May 29, 2017 4:14 pm

Re: GPS Maps for Cacti

#306 Post by anmomin1 » Thu Sep 12, 2019 2:47 pm

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 User
Posts: 329
Joined: Wed Dec 07, 2011 9:19 am

Re: GPS Maps for Cacti

#307 Post by Rno » 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
CentOS
Production
Cacti 0.8.8h
Spine 0.8.8h
PIA 3.1
Aggregate 0.75
Monitor 1.3
Settings 0.71
Weathermap 0.98
Thold 0.5
rrdclean 0.41

Own plugin: LinkDiscovery 0.45, Map 0.36

Test
Cacti 1.2.1
Spine 1.2.1
thold 1.0.6
monitor 2.3.5
php 7.2.11
mariadb 5.5.56
Own plugin:
ExtendDB 1.1.2
LinkDiscovery 1.2.4
Map 1.2.5

anmomin1
Posts: 49
Joined: Mon May 29, 2017 4:14 pm

Re: GPS Maps for Cacti

#308 Post by anmomin1 » Fri Sep 13, 2019 1:47 am

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 User
Posts: 329
Joined: Wed Dec 07, 2011 9:19 am

Re: GPS Maps for Cacti

#309 Post by Rno » 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
CentOS
Production
Cacti 0.8.8h
Spine 0.8.8h
PIA 3.1
Aggregate 0.75
Monitor 1.3
Settings 0.71
Weathermap 0.98
Thold 0.5
rrdclean 0.41

Own plugin: LinkDiscovery 0.45, Map 0.36

Test
Cacti 1.2.1
Spine 1.2.1
thold 1.0.6
monitor 2.3.5
php 7.2.11
mariadb 5.5.56
Own plugin:
ExtendDB 1.1.2
LinkDiscovery 1.2.4
Map 1.2.5

anmomin1
Posts: 49
Joined: Mon May 29, 2017 4:14 pm

Re: GPS Maps for Cacti

#310 Post by anmomin1 » Fri Sep 13, 2019 1:35 pm

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: 2779
Joined: Sun Aug 27, 2017 12:05 am

Re: GPS Maps for Cacti

#311 Post by netniV » Fri Sep 13, 2019 6:39 pm

Did you enable it within the php.ini or apache mods?

anmomin1
Posts: 49
Joined: Mon May 29, 2017 4:14 pm

Re: GPS Maps for Cacti

#312 Post by anmomin1 » Sat Sep 14, 2019 7:50 pm

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.

Post Reply