GPS Maps for Cacti

Announcements concerning Plugins for Cacti

Moderators: Developers, Moderators

Post Reply
Caracarn
Posts: 17
Joined: Thu Nov 27, 2008 6:30 pm

Post by Caracarn »

Awesome work Spiffydudex!

The zoom functionality and the site status really make this plugin now.

Weather maps work if I have the US map visible, but nothing appears for Australia, so assume the service is US-only. Not a big deal but was interested in checking out what it looked like.

Is there any way to make the red pin for sites that are down, standout more? I have a number of sites clustered together and a site that is down is obscured. I can edit the red icon in host_icons.php and make it larger, but I thought there might be a better way to do it.

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

Post by spiffydudex »

Nope, Sad to say everything is done in the host icons file.

The weather was just something I was toying with I figured if anyone wants to enable it in the US they can edit it to their needs. Check the weather.php for more info. There should be a similar service like NOAA, for Australia.


Thanks for the great feedback and support :) definitely helps to have someone look at your work.
Caracarn
Posts: 17
Joined: Thu Nov 27, 2008 6:30 pm

Post by Caracarn »

The plugin doesnt appear to automatically update the status if the site goes down. Can it be setup to refresh the markers every 60 seconds so it will display a red marker for a site that has suddenly gone offline?

It would also be useful if when it refreshed and a site was down, it displayed the bubble to draw your attention

I've noticed that simulating a down site by changing it's IP address to a bogus address and refreshing the plugin, the marker changes to red. But when I change the ip back the marker never changes to green it stays red, despite Cacti and the Monitor plugin showing the site as being back up again. The only way to change it back to green is to close IE and re-open it.

I tried to get around the problem of a red marker being hidden by alot of green markers by replacing the green marker with a custom marker I made that reduced the opacity of the green by 75% so I could see through it. Unfortunately when I changed the path for the green marker in host_icons.php to my new marker, they no longer displayed. Not sure why this is the case, I made it a 24-bit png file and put it on the Linux server in the gpsmap/images folder with the same permissions as the print.gif.

I guess i'm hoping that if the functionality is there, I no longer need to use the Monitor plugin.

Thanks.
ursal
Posts: 6
Joined: Thu Aug 20, 2009 6:52 am

Post by ursal »

But one bug which is annoying me, is that I have to activate the 'console' menu for my users who wants to get the 'GPS map' link.

I have noticed though that if I click on any tab other than Console, the GPS Map tab disappears, and the only way I can bring it back is clicking on the Console tab again.
First upgrade plugin to 1.41 by copying files. Then in setup.php comment two lines

Code: Select all

function plugin_gpsmap_install () {
         //gpsmap_setup_database();
}
function plugin_gpsmap_uninstall () {
        //gpsmap_remove_database();
}
Now you can uninstall and install plugin without losing coordinates in database. After that this lines can be commented out. Reinstall will add some lines into plugin_hooks table.

Enjoy permanent "GPS" tab.

For cacti 0.8.7e I also changed line in ./include/top_header.php

Code: Select all

//api_plugin_hook('top_header_tabs');
api_plugin_hook('top_graph_header_tabs');
This fix different positions of "GPS" tab

Also in gpsmap.php change

Code: Select all

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

Code: Select all

include_once("./include/top_graph_header.php");
This will remove Console tab when "GPS map" tab active

Also edit in setup.php

Code: Select all

function gpsmap_draw_navigation_text ($nav) {
   //$nav["gpsmap.php:"] = array("title" => "GPS Map", "mapping" => "index.php:,utilities.php:", "url" => "gpsmap.php", "level" => "1");
   $nav["gpsmap.php:"] = array("title" => "GPS Map", "mapping" => "", "url" => "gpsmap.php", "level" => "0");
   return $nav;
}
Now GPS tab is no more connected to Console tab and can be shared with regular users. I dont know what is "level", so just copied it's value from another plugin
Mikekellner
Posts: 1
Joined: Tue Aug 25, 2009 8:33 am

Post by Mikekellner »

Hello, i have installed the plugin on 0.87e / Windows 2003.
The XML Folder has "Everyone" write enabled.
By the GPSMap Tab i see an IIS 500 Error.

Any idea?


Mike
User avatar
phalek
Developer
Posts: 2838
Joined: Thu Jan 31, 2008 6:39 am
Location: Kressbronn, Germany
Contact:

Post by phalek »

Just for the upgrade part, is that part of your gpsmap_check_upgrade function correct ??

Code: Select all

                include_once($config['base_path'] . '/plugins/thold/includes/database.php');
                thold_upgrade_database ();
It's more thold related than gpsmap ... :-)

Nice plugin, I would love to use it, but unfortunately, Google Licence terms forbidd using the free google api for internal web-sites and refers to the non-free Premium API ... :cry:
Greetings,
Phalek
---
Need more help ? Read the Cacti documentation or my new Cacti 1.x Book
Need on-site support ? Look here Cacti Workshop
Need professional Cacti support ? Look here CereusService
---
Plugins : CereusReporting
spiffydudex
Cacti User
Posts: 97
Joined: Thu Jul 24, 2008 11:21 am
Location: Hallsville, TX
Contact:

Post by spiffydudex »

Mikekellner wrote:Hello, i have installed the plugin on 0.87e / Windows 2003.
The XML Folder has "Everyone" write enabled.
By the GPSMap Tab i see an IIS 500 Error.

Any idea?


Mike
Check to make sure that the xml file also is writable, or delete it so that the server will remake it. Also be sure to check the ownership properties on the folder. I have never run an IIS server effectively (Always had problems with weird things like that)

phalek wrote:Just for the upgrade part, is that part of your gpsmap_check_upgrade function correct ??
It's more thold related than gpsmap ...
Yes...sadly I pulled a lot from Thold and it wiggled its way in there. :oops: I was just toying with how to start performing a more simplified upgrade process. Never got around to implementing it.


@ursal
That is a good fix, I don't know if that is the proper way to fix, but it works. Thanks
Øyvind
Posts: 12
Joined: Thu Mar 26, 2009 7:25 am

Post by Øyvind »

For some reason I don't get any icons on my map.

-I've added the Google Maps API key.
-I've set an initial long/lat and it works.
-I've set permissions on the XML folder, and the gpsXML.xml file is populated with positions and stuff.

All the hosts I've initially set a position for are of the "undefined" type, so should show as white icons. Tried logging off/on, restarting FireFox, no luck.

Any ideas? I'd really like to get this to work, as it seems like an awesome plugin!
trungtano
Cacti User
Posts: 90
Joined: Fri Apr 10, 2009 1:57 am
Contact:

API problem

Post by trungtano »

When I try to generate API key with my company then push it in GPS API key in cacti it sad:

The Google Maps API server rejected your request. This could be because the API key used on this site was registered for a different web site. You can generate a new key for this web site at
http://code.google.com/apis/maps/.

anybody know why?? Because my company web site have just resisted few days ago! Who stolen my web site ???
ursal
Posts: 6
Joined: Thu Aug 20, 2009 6:52 am

Post by ursal »

spiffydudex wrote: @ursal
That is a good fix, I don't know if that is the proper way to fix, but it works. Thanks
Wellcome) I don't know php well, but can force to work almost everything. top_header.php generates page with console on the left, top_graph_header.php - without it. I'm not sure about changes in cacti files, must be another way to fix tab order.
xefil
Cacti User
Posts: 233
Joined: Tue Jun 20, 2006 2:48 am
Location: Italy
Contact:

Post by xefil »

Hello!

This plugin is really great.
I've installed the 1.4 version and all works perfectly.
Now, I've upgraded to 1.41 version but I cannot see any Icon.
On 1.4 all was ok...
To upgrade I simply copied the new version over the old one. Copied custom_hosts.php and host_icons.php from old 1.40 to 1.41 to not loose anything. The XML folder is writable and the file gpsXML.xml has the coords in. The devices has the coords too, but on the map I cannot see any Icon.

Can you help me?

Thank's!

Simon

***EDIT***
I don't know why, but I'm seeing hosts on my Cacti GPS Map in the USA I've NEVER added of course...... :o :o
spiffydudex
Cacti User
Posts: 97
Joined: Thu Jul 24, 2008 11:21 am
Location: Hallsville, TX
Contact:

Post by spiffydudex »

To upgrade I simply copied the new version over the old one. Copied custom_hosts.php and host_icons.php from old 1.40 to 1.41 to not loose anything. The XML folder is writable and the file gpsXML.xml has the coords in. The devices has the coords too, but on the map I cannot see any Icon.
At the bottom of the 1.41 there were some additions to the custom_hosts.php This was for the up/down/recovering statuses. Make sure you have those.
I don't know why, but I'm seeing hosts on my Cacti GPS Map in the USA I've NEVER added of course......


Just empty the xml file and it should repopulate.

When I try to generate API key with my company then push it in GPS API key in cacti it sad:
The Google Maps API server rejected your request. This could be because the API key used on this site was registered for a different web site. You can generate a new key for this web site at
http://code.google.com/apis/maps/.
anybody know why?? Because my company web site have just resisted few days ago! Who stolen my web site ???
Make sure you copy the entire API key. if you just double click then copy you will usually only get half of the API Key. ALSO for some reason I have found that google can be particular about the differences between: www.domain.com and domain.com
Use the one that most suites you.

@Øyvind
Make sure you are using the newest version 1.41. If you updated I think that the custom_hosts.php is not the newest version. there are some changes in the new version.

Hopefully this helps guys.
xefil
Cacti User
Posts: 233
Joined: Tue Jun 20, 2006 2:48 am
Location: Italy
Contact:

Post by xefil »

spiffydudex wrote: At the bottom of the 1.41 there were some additions to the custom_hosts.php This was for the up/down/recovering statuses. Make sure you have those.
This is the 1.41 content of custom_hosts.php, empty:

Code: Select all

<?
switch ($type) {

// ****** DO NOT EDIT ABOVE ******

        //Here you can set custom host type definitions.
        //the case number corresponds to the type number set within the Cacti Host databse
        //$type = "whatever";
        //the "whatever" must be set the same within the host_icons
        // THIS WILL be different for all cacti installations as things will be installed in different orders




case 1:
        $type = "Server";
        break;
case 5:
        $type = "Router/Pix";
        break;
case 8:
        $type = "Localhost";
        break;
case 14:
        $type = "AP/Tower";
        break;
case 15:
        $type = "Subscriber";
        break;




// ****** DO NOT EDIT BELOW *******

//must include default for safety
default:
        $type = "Undefined";
        break;
}
It seems the same as 1.40, even if it cames from 'gpsmap1.41.tgz'.
Just empty the xml file and it should repopulate.
DONE, removed gpsXML.xml and cacti creates a new one, with ONLY my hostnames and coords, but if I zoom all out, I see hosts in Texas with IP address and hosts not used by me...
I still miss my icons/hosts in europe, seen since 1.40 version.
API key surely corret, otherwise i think I cannot see any map as well.

thank's

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

Post by spiffydudex »

That is strange. The XML file is parsed and then sent to google to make the map. Points in Texas should not be showing up unless they are in the XML or for some strange reason in your database.
When I get to a computer I'll check and post differences, because the customs_hosts.php should have several new additions.
spiffydudex
Cacti User
Posts: 97
Joined: Thu Jul 24, 2008 11:21 am
Location: Hallsville, TX
Contact:

Post by spiffydudex »

Sorry, I misspoke. it is the host_icons.php that was changed.

at the bottom it should have these:

Code: Select all

//DO NOT REMOVE THESE
customIcons["up"] = iconGreen;
customIcons["recovering"] = iconOrange;
customIcons["down"] = iconRed;
customIcons["disabled"] = iconBlack;
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest