22. 05. 2025 Juergen Vigna NetEye, Unified Monitoring

Automatic Integration of NagVis Map into Icinga Web 2/NetEye Monitoring

What’s What

NetEye is a comprehensive IT Monitoring and Observability platform developed by Würth Phoenix. It’s based on open-source tools like Icinga, NagVis, Grafana, Elastic Stack, among others, and is tailored for enterprise IT infrastructure monitoring, IT Operations Analytics (ITOA), and IT Service Management (ITSM).

NagVis is an open-source visualization tool that provides graphical representations of IT infrastructure and monitoring data. It works with monitoring systems like Nagios, Icinga, and NetEye, and is especially useful for creating network maps, topology diagrams, dashboards, and service overviews.

Icinga Web 2 is the official web interface for Icinga 2, designed to provide a modern, flexible, and powerful way to view and manage your IT monitoring environment.

Why Integrate?

NagVis Maps was made to help to visualize your IT Infrastructure. Unfortunately, sometimes it’s hard to find certain Host Objects on the available (NagVis) Maps screen, and thus know which maps are associated with a certain host. Therefore the idea of integrating the two is that from the Monitoring Host Overview you can directly see which maps exist, in order to see where the Host-Object is used inside your IT Infrastructure.

How Do You Integrate Them?

I made a small script available that checks all NagVis maps against all hosts on the Monitoring side, and if the host name is found in one of those maps, then that map is added as Action Item for that Host, and the necessary configuration is generated automatically.

You have to start the script on the host where both the icinga-master process and the NagVis Maps are present. The directories you’ll see in the script are the ones used by NetEye. The script uses the “crudini” package, which must already be installed (/usr/bin/crudini).

#! /bin/sh
#
# Script to generate Icingawenb2 Host-Actions Configuration to Link NagVis Maps to Host-Objects
#
# Version: 1.0.0
#
# Author: 2025/04/01 Juergen Vigna <juergen.vigna@wuerth-phoenix.net>
#

TEMPDIR=/tmp
TMPFILE=$(mktemp)
HTMPFILE=$(mktemp)
CLICMD="/usr/bin/icingacli"
HMAPFILE=/neteye/shared/icingaweb2/conf/navigation/host-actions-host-map.ini

trap 'rm -f $TMPFILE $HTMPFILE; exit 1' 1 2 15
trap 'rm -f $TMPFILE $HTMPFILE' 0

if [ "$1" = "-t" -o "$1" = "--test" ]
then
TESTONLY=yes
shift
fi

#
# Nagvis Map Actions
#
MAPDIR="/neteye/shared/nagvis/conf/maps"

ls -1 $MAPDIR/*.cfg | grep -v '^Service_' >$TMPFILE

if [ -e "$HMAPFILE" ]
then
mv "$HMAPFILE" "${HMAPFILE}.bak"
fi
/usr/bin/icingacli director hosts list >$HTMPFILE
if [ ! -s $HTMPFILE ]
then
echo "Cannot read director hosts with icingacli"
exit 1
fi
i=0
while read mapfile
do
MAP=$(basename $mapfile .cfg)
FILTER=""
for host in $(grep host_name $mapfile | cut -d= -f2)
do
if egrep "^$host\$" $HTMPFILE >/dev/null
then
if [ -z "$FILTER" ]
then
FILTER="host_name=$host"
else
FILTER="$FILTER|host_name=$host"
fi
fi
done
if [ -n "$FILTER" ]
then
NAME=$(echo "$MAP" | tr _ ' ')
echo "["$'\302'$'\240'"Map $NAME]" >>$HMAPFILE
echo "type = \"host-action\"" >>$HMAPFILE
echo "target = \"_blank\"" >>$HMAPFILE
echo "url = \"nagvis/show/map?map=$MAP\"" >>$HMAPFILE
echo "filter = \"$FILTER\"" >>$HMAPFILE
echo "icon = \"map\"" >>$HMAPFILE
echo "groups = \"*\"" >>$HMAPFILE
echo "owner = \"root\"" >>$HMAPFILE
echo "" >>$HMAPFILE
fi
done <$TMPFILE

cd /neteye/shared/icingaweb2/conf/navigation
cp -a host-action.ini host-action.ini.bak
# Remove INI File Section for Maps
grep -P "^\[\xa0Map" host-actions.ini | tr -d "[]" > $TMPFILE
while read ll
do
/usr/bin/crudini --del host-action.ini "$ll"
done < $TMPFILE

cat $HMAPFILE >> host-actions.ini

You can call the script above from a cron command say once a day so that new maps and/or hosts are then updated automatically. Afterwards you should then find for every (NagVis) map where a host name is found that a new “Actions” Item on the Host-Detail page in Icinga Web 2 under Problem handling > Actions.

These Solutions are Engineered by Humans

Did you find this article interesting? Does it match your skill set? Our customers often present us with problems that need customized solutions. In fact, we’re currently hiring for roles just like this and others here at Würth Phoenix.

Juergen Vigna

Juergen Vigna

NetEye Solution Architect at Würth Phoenix
I have over 20 years of experience in the IT branch. After first experiences in the field of software development for public transport companies, I finally decided to join the young and growing team of Würth Phoenix. Initially, I was responsible for the internal Linux/Unix infrastructure and the management of CVS software. Afterwards, my main challenge was to establish the meanwhile well-known IT System Management Solution WÜRTHPHOENIX NetEye. As a Product Manager I started building NetEye from scratch, analyzing existing open source models, extending and finally joining them into one single powerful solution. After that, my job turned into a passion: Constant developments, customer installations and support became a matter of personal. Today I use my knowledge as a NetEye Senior Consultant as well as NetEye Solution Architect at Würth Phoenix.

Author

Juergen Vigna

I have over 20 years of experience in the IT branch. After first experiences in the field of software development for public transport companies, I finally decided to join the young and growing team of Würth Phoenix. Initially, I was responsible for the internal Linux/Unix infrastructure and the management of CVS software. Afterwards, my main challenge was to establish the meanwhile well-known IT System Management Solution WÜRTHPHOENIX NetEye. As a Product Manager I started building NetEye from scratch, analyzing existing open source models, extending and finally joining them into one single powerful solution. After that, my job turned into a passion: Constant developments, customer installations and support became a matter of personal. Today I use my knowledge as a NetEye Senior Consultant as well as NetEye Solution Architect at Würth Phoenix.

Leave a Reply

Your email address will not be published. Required fields are marked *

Archive