Nagios Installation

Linux can be a pain to configure.  Here is a pretty simple setup procedure specifically for Nagios.

We’ve used VMWare for the main Nagios host so that’s what we’ll concentrate on here. The install on MS HV has some quirks but will work too.

Get the latest ISO for Fedora (CentOS if you’re using Hyper-V) and attach it to the VM you’re going to install into.  Memory isn’t much of an issue so 512MB is sufficient (768MB is better, 1024MB is best). 20GB for the virtual hard drive is fine.  One CPU is enough.

Do a basic install of Fedora (CentOS). You can choose to do a Web Server or Desktop install. Either will work fine. It is preferred to not install a GUI interface.

After the install configure the static IP address. To do this drop to a console and type setup

This will open a little text based configuration. From in here you’ll set your IP, turn off the firewall and configure the services that start/stop at boot.

The initial setup window looks similar to this:

From here you’re interested in Firewall, Network and System services.

Most settings are pretty obvious. System services however you’ll need to look close. The only major thing is to make sure httpd starts on boot. You want to turn off bluetooth, iptables and ip6tables.

When done, Quit and restart.

From a command line follow these directions:

Install Nagios

Type:

yum install –y nagios

Remove access restrictions from Nagios apache config file:

/etc/httpd/conf.d/nagios.conf

It should look similar to this when done:

ScriptAlias /nagios/cgi-bin/ /usr/lib/nagios/cgi-bin/
<Directory /usr/lib/nagios/cgi-bin/>
   Options ExecCGI
   AuthType Basic
   AuthUserFile /etc/nagios/htpasswd.users
   AuthName "nagios"
   require valid-user
</Directory>
   Alias /nagios/ /usr/share/nagios/html/
<Directory /usr/share/nagios/html/>
   Options None
   AuthType Basic
   AuthUserFile /etc/nagios/htpasswd.users
   AuthName "nagios"
   require valid-user
</Directory>

Restart Apache:

service httpd restart

Setup User Authentication

htpasswd -c /etc/nagios/htpasswd.users nagiosadmin

Enter a password for user nagiosadmin when prompted.

Check Nagios Configuration

The path here assumes you installed via yum under CentOS.

nagios -v /etc/nagios/nagios.cfg

Nagios Paths

These paths assumes you installed via yum under CentOS.

/etc/nagios/nagios.cfg (Main configuration file)
/etc/nagios/objects (location of all files used to configure hosts and services)
/usr/lib64/nagios/plugins (where all plugins for testing services should be)
/usr/share/nagios/html (root of the nagios web site)
/etc/nagios/private (more config files)
Advertisements

Author: Helicopter Jeff

I'm a vinyl decal cutting and designing, Astrophotography and general photography capturing, RC helicopter/quad copter pilot, Arduino and Raspberry Pi hardware/software developer, network, scripting and troubleshooting ninja living in the metro NY area. I am passionate about my hobbies so much I do them for a living. There's nothing better than getting paid to do what you love.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s