Page 1 of 2
Dynamic Google maps
Posted: Sun Nov 16, 2014 8:02 pm
by dsturlan
Hello
My idea was to dynamically change the coordinates of the hosts that are monitored. So idea was to get GPS coordinates every few minutes and to change the entry in the notes field, but after that I would need to force Nagios to read from that file. Is there any way I could do that from command line interface?
Any ideas
Re: Dynamic Google maps
Posted: Mon Nov 17, 2014 2:02 pm
by abrist
Changing those values will require a nagios restart. To automate it, you will need to do a db update in nagiosql, or use the static directory and have your script alter the configs outside of the CCM.
Re: Dynamic Google maps
Posted: Tue Nov 18, 2014 12:35 pm
by WillemDH
Interesting idea. We have a bus riding through Ghent offering services to the people of Ghent. Please let us know if you managed to make this work.

Re: Dynamic Google maps
Posted: Tue Nov 18, 2014 2:26 pm
by abrist
The major issue is the required process restarts for updates. You may be better off saving the coordinate info somewhere else so that you do not need to restart nagios.
Re: Dynamic Google maps
Posted: Sun Nov 23, 2014 8:15 pm
by dsturlan
abrist wrote:The major issue is the required process restarts for updates. You may be better off saving the coordinate info somewhere else so that you do not need to restart nagios.
How you mean save somewhere else, the Google Maps plugin always looks into the same place?
Re: Dynamic Google maps
Posted: Sun Nov 23, 2014 8:16 pm
by dsturlan
abrist wrote:Changing those values will require a nagios restart. To automate it, you will need to do a db update in nagiosql, or use the static directory and have your script alter the configs outside of the CCM.
I tried that and it somehow does not work, I changed it and restarted the service, but the changes weren't there.
Re: Dynamic Google maps
Posted: Mon Nov 24, 2014 12:58 pm
by abrist
The google maps component is its own beast. I guess my comments referring to the coordinates in the con figs really only applies to Nagvis.
Re: Dynamic Google maps
Posted: Sun Nov 30, 2014 9:04 pm
by dsturlan
abrist wrote:The google maps component is its own beast. I guess my comments referring to the coordinates in the con figs really only applies to Nagvis.
Do you know where I could get more answers for the Google Maps component?
Re: Dynamic Google maps
Posted: Mon Dec 01, 2014 5:15 pm
by cmerchant
You could look at the code that is in the component directory: (it loops through hosts, looking at the notes field for lat,lon). Maybe look into modifying this code to read your alternate host locations from a db?
Code: Select all
/usr/local/nagiosxi/html/includes/components/googlemap/[b]buildmakers.inc.php[/b]
There is also the integration documentation here:
http://assets.nagios.com/downloads/nagi ... ith_XI.pdf
Hope this helps.
Re: Dynamic Google maps
Posted: Mon Dec 01, 2014 11:07 pm
by dsturlan
cmerchant wrote:You could look at the code that is in the component directory: (it loops through hosts, looking at the notes field for lat,lon). Maybe look into modifying this code to read your alternate host locations from a db?
Code: Select all
/usr/local/nagiosxi/html/includes/components/googlemap/[b]buildmakers.inc.php[/b]
There is also the integration documentation here:
http://assets.nagios.com/downloads/nagi ... ith_XI.pdf
Hope this helps.
Thank you very much I will look through that, if I will be able to make sense

But this is at least something to start with