Create our own plugins for Check_MK and WATO

For a long time I used Nagios Core without Check_MK or any other GUI for configuration. I used pynag for massive changes, but nothing else.

When I needed to check for something specific, I just wrote what I needed on bash, put as many arguments/parameters/variables I wanted and added it to the commands.cfg file.

But with Check_MK and WATO, that’s a little different. We could add whatever we want as script but configure the arguments it’s not so easy (it’s not hard either). Mathias Kettner explains it very well on the documentation, but I wanted to have my own experience on my blog.

I won’t write about how to do a script. I will just give an example about what I did.

Necessary files

We will create 3 files: the plugin itself – the check function – the manual page

/usr/lib/check_mk_agent/plugins/lxc_mem
/usr/share/check_mk/checks/lxc_mem
/usr/share/doc/check_mk/checks/lxc_mem.mem

We also will modify this one:

/usr/share/check_mk/web/plugins/wato/check_parameters.py
Continue Reading

Install Nagios Core 4.3.2 in Debian Stretch Part 2

We already have a Nagios Core installed. Now we want to add some very nice add ons to the platform.

Download additional software

Go to Mathias Kettner web and download the last version of Check_MK.

wget -O /usr/src/check_mk-1.2.8p25.tar.gz http://mathias-kettner.com/download/check_mk-1.2.8p25.tar.gz

We also need Nagvis and PNP4Nagios

wget -O /usr/src/nagvis-1.9.2.tar.gz http://www.nagvis.org/share/nagvis-1.9.2.tar.gz 
wget -O /usr/src/pnp4nagios-0.6.25.tar.gz  http://downloads.sourceforge.net/project/pnp4nagios/PNP-0.6/pnp4nagios-0.6.25.tar.gz?r=https%3A%2F%2Fsourceforge.net%2Fprojects%2Fpnp4nagios%2Ffiles%2FPNP-0.6%2F&ts=1460394997&use_mirror=pilotfiber

PNP4Nagios

Prerequisites

Continue Reading

Install Nagios Core 4.3.2 in Debian Stretch Part 1

About Nagios

Nagios is an enterprise class, open source software that can be used for network and infrastructure monitoring. Using Nagios, we can monitor servers, switches, applications and services etc. It alerts the System Administrator when something goes wrong and also alerts back when the issues have been rectified.

Features

Using Nagios, you can:

  • Monitor your entire IT infrastructure.
  • Identify problems before they occur.
  • Know immediately when problems arise.
  • Share availability data with stakeholders.
  • Detect security breaches.
  • Plan and budget for IT upgrades.
  • Reduce downtime and business losses.

Prerequisites

Make sure your server have installed with fully working LAMP stack. If not, follow the below link to install LAMP server.

Then install the following prerequisites:

apt-get install build-essential libgd2-xpm-dev apache2-utils unzip curl
a2enmod rewrite
a2enmod cgi

Create Nagios User And Group

Create a new nagios user account:

useradd -m nagios
passwd nagios

Create a new

Continue Reading

Install Adagios from Source on Debian Jessie

Adagios is a web based Nagios configuration interface built to be simple and intuitive in design, exposing less of the clutter under the hood of nagios. Additionally adagios has a rest interface for both status and configuration data as well a feature complete status interface that can be used as an alternative to nagios web interface.

If you want to manage all your Nagios Core configuration and you don’t use WATO or Check MK, you could just use Adagios to do it.

Installing Adagios

Install Dependencies

apt-get install git libapache2-mod-wsgi python-django python-simplejson libgmp-dev python-dev python-paramiko

Install pynag

It looks like the version of pynag installed from the repos is an old version (even though pynag hasn’t been touched in a while).

I used these steps to download and install the current version of pynag:

git clone https://github.com/pynag/pynag.git
cd pynag
python setup.py build
python setup.py install

This put all the proper

Continue Reading