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.
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.
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.
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.