Nagios/NagVis

From Segfault
Jump to: navigation, search

Installation

Install some prerequisites:

sudo apt-get install php5-gd php-net-socket php5-sqlite sqlite3 libgraphviz-perl

Before we can install NagVis, we need to install MK Livestatus:

git clone http://git.mathias-kettner.de/check_mk.git check_mk-git
cd check_mk-git/livestatus

aclocal && autoheader && automake -a && autoconf
./configure --prefix=/opt/mk-livestatus
make
sudo make install

Configure Nagios to use MK Livestatus. In /etc/nagios3/nagios.cfg, set:

broker_module        = /opt/mk-livestatus/lib/mk-livestatus/livestatus.o /var/lib/nagios3/rw/live.sock
event_broker_options = -1 

After Nagios is restarted, the socket should be in place:

[] Nagios 3.4.1 starting... (PID=13276)
[] Local time is Mon Jan 07 03:09:16 PST 2013
[] LOG VERSION: 2.0
[] livestatus: Livestatus 1.2.0p3 by Mathias Kettner. Socket: '/var/lib/nagios3/rw/live.sock'
[] livestatus: Please visit us at http://mathias-kettner.de/
[] livestatus: Hint: please try out OMD - the Open Monitoring Distribution
[] livestatus: Please visit OMD at http://omdistro.org
[] livestatus: Finished initialization. Further log messages go to /var/log/nagios3/livestatus.log
[] Event broker module '/opt/mk-livestatus/lib/mk-livestatus/livestatus.o' initialized successfully.
[] Finished daemonizing... (New PID=13277)

Now we can install NagVis:

git clone git://nagvis.git.sourceforge.net/gitroot/nagvis/nagvis nagvis-git
cd nagvis-git 
sudo ./install.sh -n /usr/share/nagios3 -b /opt/nagvis/bin -p /opt/nagvis -u www-data -g www-data \
             -l /var/lib/nagios3/rw/live.sock

Check if the backend is configured correctly:

$ grep -v ^\; /opt/nagvis/etc/nagvis.ini.php | grep live
[backend_live_1]
backendtype="mklivestatus"
socket="unix:/var/lib/nagios3/rw/live.sock"

Usage

NagVis should now be accessible via http://www.example.org/nagvis. The initial admin credentials are admin/admin.

Links