Dynamic Google maps

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
dsturlan
Posts: 9
Joined: Wed Nov 12, 2014 11:38 pm

Dynamic Google maps

Post 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
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: Dynamic Google maps

Post 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.
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
User avatar
WillemDH
Posts: 2320
Joined: Wed Mar 20, 2013 5:49 am
Location: Ghent
Contact:

Re: Dynamic Google maps

Post 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. :)
Nagios XI 5.8.1
https://outsideit.net
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: Dynamic Google maps

Post 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.
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
dsturlan
Posts: 9
Joined: Wed Nov 12, 2014 11:38 pm

Re: Dynamic Google maps

Post 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?
dsturlan
Posts: 9
Joined: Wed Nov 12, 2014 11:38 pm

Re: Dynamic Google maps

Post 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.
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: Dynamic Google maps

Post 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.
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
dsturlan
Posts: 9
Joined: Wed Nov 12, 2014 11:38 pm

Re: Dynamic Google maps

Post 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?
cmerchant
Posts: 546
Joined: Wed Sep 24, 2014 11:19 am

Re: Dynamic Google maps

Post 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.
dsturlan
Posts: 9
Joined: Wed Nov 12, 2014 11:38 pm

Re: Dynamic Google maps

Post 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
Locked