NagVis in Motion: Creating Dynamic Weather Status Maps

Picture of Shamas Demoret
Shamas Demoret
Technical Content Manager
A NagVis map in Nagios XI with a dynamic NWS radar map background.

You might already be familiar with NagVis, an awesome open source tool preloaded in Nagios XI that transforms your monitoring data into interactive visual status representations.

But did you know you can use URLs as the background for your maps? In this article, we’ll explore a cool use case for this capability by overlaying a National Weather Service radar map with active object status icons in Nagios XI in a few simple steps.

1. Creating a Map

First, create a fresh Regular map. If you’re new to NagVis, you can find basic instructions here:

Full instructions can be found in this guide:

No need to add anything to it yet. First we’ll get the background loaded.

2. Config File Setup

To use a URL as the background of a map, establish a terminal session with your Nagios XI server, and open the map’s.cfg file with a text editor. In this example, we’ll use vi.

First, move to the maps directory:


cd /usr/local/nagvis/etc/maps/

Next, open the .cfg file of the target map, replacing mapname in this command with the actual map filename:

vi mapname.cfg

In the global section add this line, replacing URL with the URL to use as the background. Note that the square brackets are required; your URL will go between them.


map_image=[URL]

That section should look something like the following after you edit it (you can use the URL shown here to use an NWS radar map, or add the URL of your choice) :

define global {
object_id=0
map_image=[https://radar.weather.gov/ridge/standard/CONUS-LARGE_loop.gif]
grid_show=0
}

Save your changes to the file to finalize this step.

3. Add Your Icons

Now you can head back to your map in Nagios XI and start adding icons and lines, for a final result similar to this:

A NagVis map in Nagios XI with a dynamic NWS radar map background.
Watch the weather roll across your nodes on NagVis maps.

Tips

  • The zoombar function is a handy feature to enable on large backgrounds such as a country-wide radar map. To enable it, go to Edit Map > Map Options > Appearance tab, check the zoombar box and choose Yes in the dropdown, then click Save. You’ll now see a zoombar on the upper left of your map which you can use to zoom in and out of your map.
  • You may see a map_image setting error as shown in the screenshot below when using a URL, but this can be disregarded.
Screenshot of the map options for a NagVis map with a weather radar background.
Zoom is handy on large NagVis backgrounds.

Try It Out

If you haven’t tried out Nagios XI yet, you can learn more about its robust monitoring, alerting, graphing, and reporting capabilities and find the fully functional free trial version here:

Happy mapping!

Share: