CentLinux | Learn How to Install CentOS/Rocky Linux Servers

Monday, September 12, 2016

Install Lilac Configurator for Nagios Core on CentOS 7

Install Lilac Configurator for Nagios Core on CentOS 7

Nagios is an Industry Standard Server Monitoring Solution. It is very simple, lightweight and easy to configure. Its configurations are defined in plain text files by an Administrator (according to his Infrastructure) for each Host, Service, Command, Contact, etc. These configurations are not a big deal unless we are monitoring a large Infrastructure, where we have to frequently update definitions of devices, add new hosts, replace a faulty switch, etc. The task of maintaining configurations can be a nightmare, if we are not properly planned to organize our Nagios configurations.

Fortunately, there are some web-based configurators such as Fruity, Lilac Reloaded, NConf, etc. are available, that can ease the task of Nagios configuration management.

In this post, we will install the Lilac Reloaded Configurator on our Nagios Core Server over CentOS 7. Lilac Reloaded uses MySQL as its database backend, and it is written in PHP.

Before moving forward, it is required to have basic concepts of Nagios Core 4. Therefore, it is highly recommended that you should have Learning Nagios - Third Edition. It will be really helpful for you during your Nagios journey.

Install Lilac Configurator for Nagios Core on CentOS 7

System Specification:

A working instance of Nagios monitoring Server on CentOS 7.

  • Hostname - nagios03.example.com
  • IP Address -
  • Nagios Version - Nagios Core 4.4

Read Also: Install & Configure Nagios Core 4.4 on CentOS 7
  Install & Configure Nagios Core 4.2 on CentOS 6


Installing Lilac Reloaded Configurator for Nagios Core on CentOS 7:

Login to Nagios Monitoring Server using Putty and install MySQL Database Server.

# yum install –y mariadb-server

Start and enable mariadb service.

# systemctl start mariadb.service
# systemctl enable mariadb.service

Configure MySQL Server.

# /usr/bin/mysql_secure_installation


In order to log into MySQL to secure it, we'll need the current
password for the root user.  If you've just installed MySQL, and
you haven't set the root password yet, the password will be blank,
so you should just press enter here.

Enter current password for root (enter for none):
OK, successfully used password, moving on...

Setting the root password ensures that nobody can log into the MySQL
root user without the proper authorisation.

Set root password? [Y/n] Y
New password:
Re-enter new password:
Password updated successfully!
Reloading privilege tables..
 ... Success!

By default, a MySQL installation has an anonymous user, allowing anyone
to log into MySQL without having to have a user account created for
them.  This is intended only for testing, and to make the installation
go a bit smoother.  You should remove them before moving into a
production environment.

Remove anonymous users? [Y/n] Y
 ... Success!

Normally, root should only be allowed to connect from 'localhost'.  This
ensures that someone cannot guess at the root password from the network.

Disallow root login remotely? [Y/n] Y
 ... Success!

By default, MySQL comes with a database named 'test' that anyone can
access.  This is also intended only for testing, and should be removed
before moving into a production environment.

Remove test database and access to it? [Y/n] Y
 - Dropping test database...
 ... Success!
 - Removing privileges on test database...
 ... Success!

Reloading the privilege tables will ensure that all changes made so far
will take effect immediately.

Reload privilege tables now? [Y/n] Y
 ... Success!

Cleaning up...

All done!  If you've completed all of the above steps, your MySQL
installation should now be secure.

Thanks for using MySQL!

Create database and user for Lilac Reloaded.

# mysql –u root -p
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 14
Server version: 5.1.73 Source distribution

Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> create database lilac;
Query OK, 1 row affected (0.00 sec)

mysql> create user 'lilac'@'localhost' identified by 'lilac';
Query OK, 0 rows affected (0.00 sec)

mysql> grant all on lilac.* to 'lilac'@'localhost';
Query OK, 0 rows affected (0.00 sec)

mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)

mysql> exit

Verify PHP version.

# php -v
PHP 5.3.3 (cli) (built: Aug 11 2016 20:33:53)
Copyright (c) 1997-2010 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2010 Zend Technologies

Lilac Reloaded required PHP 5.5, therefore, to update PHP, I add the Webtatic yum repository to acquire PHP 5.5 packages.

# rpm -Uvh https://mirror.webtatic.com/yum/el6/latest.rpm
Retrieving https://mirror.webtatic.com/yum/el6/latest.rpm
warning: /var/tmp/rpm-tmp.NZFWFl: Header V4 DSA/SHA1 Signature, key ID cf4c4ff9: NOKEY
Preparing...                ########################################### [100%]
   1:webtatic-release       ########################################### [100%]

Upgrade to PHP 5.5.

# yum search php55
# yum remove php php-common
# yum install php55w php55w-pear php55w-pdo php55w-mysql
# service httpd restart

Check PHP version Again.

# php -v
PHP 5.5.38 (cli) (built: Jul 21 2016 12:51:12)
Copyright (c) 1997-2015 The PHP Group
Zend Engine v2.5.0, Copyright (c) 1998-2015 Zend Technologies

Lilac required nmap for auto discovery of Network devices, therefore install it.

# yum install nmap

Download Lilac Reloaded from https://sourceforge.net/projects/lilac--reloaded/

# cd /soft
# wget https://sourceforge.net/projects/lilac--reloaded/files/latest/download
# tar xvf download

Move the lilac-reloaded directory to /var/www/html and change ownership of directory.

# mv lilac-reloaded/ /var/www/html/
# chown -R apache.apache /var/www/html/lilac-reloaded/

Like Nagios, Lilac Reloaded also don’t have any User Authentication Method of its own, so enable Basic HTTP Authentication, and use the same htpassword file, that we used with our Nagios Server.

# cat  >> /etc/httpd/conf.d/lilac.conf << EOF
>  <directory "/var/www/html/lilac-reloaded">
>  AuthType Basic
>  AuthName "Restricted Content"
>  AuthUserFile /usr/local/nagios/etc/htpasswd.users
>  Require valid-user
>  </directory>

# systemctl restart httpd.service

Browse to http://nagios03.example.com/lilac-reloaded/

Lilac Configurator Dependency Check

If this page show any dependency error, pls resolve it and click on Continue to Configuration….

Lilac Configurator Database Settings

Define database and access credentials and click on Continue.

Lilac Configurator - Import Nagios Settings

Click on Import Nagios Settings to import the configurations in lilac database.

Lilac Configurator - Import Job

Create an import job and click on Begin Import.

Lilac Configurator - Import Job Status

Nagios configurations have been imported.

Lilac Reloaded Configurator for Nagios Core on CentOS 7 is installed and ready for use now.

If you find this article useful? Consider supporting us by Buy Me A Coffee


  1. hi Sir after adding host by lilac-reloaded but it is not reflect in nagios. please help & suggest

    1. Thanks for reading this article.
      You may restart nagios service and check again.

  2. hello srir nagios 4.X.X will support lilac-reloaded

    1. Yes. Indeed we are installing it for Nagios Core 4.2.

  3. Lilac Configuration has been done & able to import Nagios Configuration into Lilac. But, I want to import Lilac Discovered data into Nagios Configuration & subsequent web interface. It means, whatever I do in Lilac, it should automatically append in nagios config file.

    Is it possible?

    1. Hi, You can export the Nagios Configuration from Lilac reloaded, the same way you have imported. However, Lilac is a very old Nagios plugin with limited community support. In my opinion, you should try to use a newer alternative for longer future sustainability.


© 2023 CentLinux. All Rights Reserved.