Fedora Installation Guide

This page details how to install nagrestonf on Fedora 20.

Packages that nagrestconf depends on, such as Nagios and Apache, will be installed automatically.

Before installation

The instructions on this page are for installing nagrestconf and its requirements on a new server,

It is not recommended to follow these instructions on an existing server that is currently being used. It might break other applications on the server since packages might be upgraded.


Installation consists of the following steps:

  • Install using the RPM packages.
  • Configure the Operating System.
  • Test nagrestconf and nagios.
  • Create an initial configuration.
  • Add Plugins.

Install using the RPM packages.

Get the RPM packages for Fedora from the download page then copy them to the server.

Open a terminal window or ssh session then install nagrestconf and all plugins:

yum --nogpg install nagrestconf-1.173-1.noarch.rpm \
    nagrestconf-services-tab-plugin-1.173-1.noarch.rpm \
    nagrestconf-services-bulktools-plugin-1.173-1.noarch.rpm \
    nagrestconf-hosts-bulktools-plugin-1.173-1.noarch.rpm \

Configure the Operating System

Ensure selinux is disabled, instructions here.

Use the two helper scripts 'nagrestconf_install' and 'slc_configure'.

nagrestconf_install -a
slc_configure --folder=local

Supply a wrapper script for init.d since Fedora uses systemd. This is a temporary fix.

[[ ! -e /etc/init.d/nagios ]] && { echo -e '#!/bin/bash\nsystemctl -o verbose $1 nagios.service' >/etc/init.d/nagios; chmod +x /etc/init.d/nagios; }

To enable automatic restart, the cron job needs to be modified to enter the apache namespace. This is a temporary fix.

sed -i '/restart_nagios/d' /var/spool/cron/root

cat >>/var/spool/cron/root <<EnD
* * * * * /usr/bin/nsenter -t \$(ps ax -o ppid,comm,pid | sed -n "s/^ *1 *httpd *\([0-9]*\)/\1/p") -m /usr/bin/restart_nagios_fedora

cat >/usr/bin/restart_nagios_fedora <<EnD
/usr/bin/test -e /tmp/nagios_restart_request && ( /bin/rm /tmp/nagios_restart_request; /usr/bin/restart_nagios; )

chmod +x /usr/bin/restart_nagios_fedora

Create a password for nagiosadmin - for GUI access to nagios.

htpasswd -bc /etc/nagios/htpasswd.users nagiosadmin a_password

Create a password for nagrestconfadmin - for GUI access to nagrestconf.

htpasswd -bc /etc/nagios/nagrestconf.users nagrestconfadmin a_password

Note that, by default, the nagrestconf GUI can only be reached from the host it was installed on, localhost. To enable connecting to nagrestconf from other hosts edit the apache configuration.

For example,

Edit /etc/httpd/conf.d/nagios.conf:

cp /etc/httpd/conf.d/nagios.conf /tmp
sed -i 's#AuthUserFile .*#AuthUserFile /etc/nagios/htpasswd.users#i' \

Edit /etc/httpd/conf.d/nagrestconf.conf:

cp /etc/httpd/conf.d/nagrestconf.conf /tmp
sed -i 's#AuthUserFile .*#AuthUserFile /etc/nagios/nagrestconf.users#i' \
sed -i 's/allow from from all/i' \
sed -i 's/#Require/Require/i'     /etc/httpd/conf.d/nagrestconf.conf
sed -i 's/#Auth/Auth/i'     /etc/httpd/conf.d/nagrestconf.conf

Restart apache

service httpd restart

Test nagrestconf and nagios

The nagrestsconf and nagios web interfaces should be accessible now.

Log into nagrestconf with user 'nagrestconfadmin', and the password that was set above.

The nagrestconf interface, at 'http://server/nagrestconf', will look like the following screen shot.

Log into nagios with user 'nagiosadmin', and the password that was set above.

The nagios interface, at 'http://server/nagios', will look like the following screen shot.

Create an initial configuration

To create a simple test configuration use a script that makes REST calls, or use the 'Backup/Restore' button in the nagrestconf GUI. The latter method will be used in this guide.

Create an initial configuration using 'Backup/Restore'

An example configuration can be downloaded from this link, then log into nagrestconf and use the 'Backup/Restore' button.

Click 'Close' in the 'Backup/Restore' dialog then refresh the page.

The new configuration will not appear in the Nagios Web interface until the 'Apply Changes' button is clicked, and then applied.

Add Plugins

Nagios and Nagrestconf should be installed and working, however, the plugins are probably not installed so Nagios will show errors trying to run the host and service checks.

Install the plugins your distribution provides.

Choose the required plugins or install them all as below.

yum install nagios-plugins-all nagios-plugins-nrpe

That's it!

comments powered by Disqus