Install Nagios Core 4.1.1 in Debian Jessie Part 4

We already have Nagios working and our optionals clients. Now we have to configure our clients.

Installing Check_MK Agent

Preparing centralized repository

To get all the files together and make easily to deploy new host, I created a directory on my Nagios to put all the installers.

cd /usr/src
tar xvzf mk_agents.tar.gz  -C /var/www/
chown -R www-data:www-data /var/www/mk_agents/

Configuring Apache

To get access to the installer from any host in the network, we have to add this block to our Apache configuration:

vim /etc/apache2/sites-available/mk_agents.conf
Alias /mk_agents "/var/www/mk_agents"

<Directory "/var/www/mk_agents">
#       Require all granted
        AllowOverride None
        Order allow,deny
        Allow from all
        # Use the same value as defined in nagios.conf
        AuthName "MK Agent Download Center"
        AuthType Basic
        AuthUserFile /var/www/mk_agents/htpasswd.users
        Require valid-user
        <IfModule mod_rewrite.c>
                # Turn on URL rewriting
                RewriteEngine On
                Options FollowSymLinks
                # Installation directory
                RewriteBase /mk_agents
                # Protect application and system files from being viewed
                RewriteRule "^(?:application|modules|system)/" - [F]
                # Allow any files or directories that exist to be displayed directly
                RewriteCond "%{REQUEST_FILENAME}" !-f
                RewriteCond "%{REQUEST_FILENAME}" !-d

cd /etc/apache2/sites-enabled
ln -s ../sites-available/mk_agents.conf mk_agents.conf
apache2ctl configtest
Syntax OK

apache2ctl graceful

Installing Check_MK Agent

On client side we have to install our agent. To do that I made a script that detects our Linux version and install the check_mk_agent and its dependencies.

cd /tmp
chmod +x

And then, we could check if Xinetd is running:

netstat -putanl|grep xine
tcp        0      0  *               LISTEN      517/xinetd


NOTE: This script uses an user/password that is already created on /var/www/mk_agents/htpasswd.users. You should change the credentials just in case. is Nagios’s IP.

SNMPD Client


On Centos/Redhat

yum -y install net-snmp net-snmp-utils

On Debian/Ubuntu

apt-get install -y snmpd


We have to edit the snmpd config file:

vim /etc/snmp/snmpd.conf

Here, we need to comment the default listen port:

#agentAddress udp:

And add this two lines to give access using <code>”nagios”</code>  community to our nagios server.

agentAddress udp:161
rocommunity nagios

And restart the service:

service snmpd restart


Adding the new server

Login into Check_MK interface and go to WATO-Configuration => Hosts

Then to “Create New Host”.

Using Check_MK Agent

Now we click on “Save & go to Services”

Using Check_MK Agent

“Save manual check configuration”


And “Apply changes”



Go to “Views” => “Services” => “All services” and you should see the new host and its services.


The yellow star belongs to the PNP4Nagios graphs for that service.

Reference Links:

Print Friendly, PDF & Email

Pablo Javier Furnari

Linux System Administrator at La Plata Linux
I'm a Linux Sysadmin with 8 years of experience. I work with several clients as a consulter here in Argentina and oversea (I have clients in the United States, Mexico, Pakistan and Germany).

I know my strengths and weaknesses. I'm a quick learner, I know how to work with small and big teams. I'm hard worker, proactive and I achieve everything I propose.

Leave a Reply

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

Reload Image