Saturday, December 28, 2013

Installing MK Livestatus and Adding to Nagios 3 in Ubuntu

Livestatus is a new approach for accessing Nagios data. It has a lot of advantages over the classical NDO approach. Livestatus make use of Nagios Event Broker API. It loads a binary module into Nagios Process. Livestatus creates a socket from which data can be read whenever required.
Many Nagios addons use Livestatus as the backend like NagVis, Check_MK etc.

Installing Livestatus

  • Download stable version livestatus zipped file from http://mathias-kettner.de/check_mk_download.html. Eg: mk-livestatus-1.2.2p3.tar.gz
  • Unzip the file tar xzf mk-livestatus-1.2.2p3.tar.gz
  • cd mk-livestatus-1.2.2p3
  • ./configure
  • make
  • make install
    Make install command will copy files livestatus.o and livecheck to /usr/local/lib/mk-livestatus, unixcat to /usr/local/bin
  • Now stop Nagios using sudo service nagios3 stop
  • Edit /etc/nagios3/nagios.cfg file, edit/add the following lines

  • broker_module=/usr/local/lib/mk-livestatus/livestatus.o /var/lib/nagios3/rw/live
    event_broker_options=-1
    
  • Now restart the Nagios service using sudo service nagios3 restart
Now if everything is successful, you will see the following logs
[2013-12-28 11:29:52] Event broker module '/usr/local/lib/mk-livestatus/livestatus.o' initialized successfully.
Informational Message[2013-12-28 11:29:52] livestatus: Finished initialization. Further log messages go to /var/log/nagios3/livestatus.log
Informational Message[2013-12-28 11:29:46] livestatus: archive path /var/log/nagios3/archives
Informational Message[2013-12-28 11:29:46] livestatus: Warning: environment_macros are enabled. This might decrease the overall nagios performance
Informational Message[2013-12-28 11:29:46] livestatus: Please visit OMD at http://omdistro.org
Informational Message[2013-12-28 11:29:46] livestatus: Hint: please try out OMD - the Open Monitoring Distribution
Informational Message[2013-12-28 11:29:46] livestatus: Please visit us at http://mathias-kettner.de/
Informational Message[2013-12-28 11:29:46] livestatus: Livestatus 1.2.2p3 by Mathias Kettner. Socket: '/var/lib/nagios3/rw/live'
Informational Message[2013-12-28 11:29:46] LOG VERSION: 2.0
Informational Message[2013-12-28 11:29:46] Local time is Sat Dec 28 11:29:46 IST 2013
Program Start[2013-12-28 11:29:46] Nagios 3.2.0 starting... (PID=21086)

Refer to http://mathias-kettner.de/checkmk_livestatus.html for more details.