Project 11 for CNIT 122 - Using Nagios (15 pts.)

What You Need

Login to the Web Interface

From the Backtrack desktop, click Applications, Internet, Firefox Web Browser.

Go to this URL:

http://localhost/nagios/

Log in with the username nagiosadmin and a password of nagios

You should see the Nagios web administration interface, as shown below:

TROUBLESHOOTING:

If your Web administration interface doesn't load, open the URL localhost to see what is listening on port 80. It should show an Apache default page.

This command may also be helpful to see what process is listening on port 80:

lsof -i :80

My installation failed to start because I have nginx configured to start, and that stopped apache from starting.

These commands fixed that problem:

service nginx stop

/etc/init.d/apache2 restart

/etc/init.d/nagios restart

Creating a Remote Host Configuration File

In a Terminal window, enter this command, and then press Enter:
nano /usr/local/nagios/etc/objects/remote.cfg

In nano, enter this configuration file:

define host{
use generic-host ; Inherit default values from a template
host_name ccsf-web
address 147.144.1.212
max_check_attempts 10
}

define service{
use generic-service ; Inherit default values from a template
host_name ccsf-web
service_description HTTP
check_command check_http
}
Your file should look like the image below:

Save the file with Ctrl+X, Y, Enter.

Telling Nagios to Use the Configuration File

In a Terminal window, enter this command, and then press Enter:
nano /usr/local/nagios/etc/nagios.cfg
Scroll down and find these lines:
# Definitions for monitoring the local (Linux) host
cfg_file=/usr/local/nagios/etc/objects/localhost.cfg
Below those lines, add these lines:
# Definitions for monitoring a remote host
cfg_file=/usr/local/nagios/etc/objects/remote.cfg

Your file should look like the image below:

Save the file with Ctrl+X, Y, Enter.

Checking the Configuration File

In a Terminal window, enter this command, and then press Enter:
/usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg
There will be 1 warning, but there should be no errors.

If you get errors, check your configuration files for errors.

Restarting Nagios

In a Terminal window, enter this command, and then press Enter:
/etc/init.d/nagios restart

Viewing the CCSF Server Status

In Firefox, on the http://localhost/nagios/ page, on the left side, click Hosts.

You should see an entry for ccsf-web, as shown below:

The status shows PENDING.

In the Host column, click ccsf-web.

On the next page, click "View Status Detail For This Host".

The "Service" should say HTTP and the "Status" should be OK, as shown below:

Saving the Screen Image

Make sure the HTTP service shows a status OK, as shown above.

Save a screen capture with a filename of "Proj 11a from YOUR NAME".

Monitoring an FTP Server

Configure Nagios to monitor the CCSF FTP server, at ftp://ftp.ccsf.edu

To see how to do that, look at this tutorial:

http://nagios.sourceforge.net/docs/3_0/monitoring-publicservices.html

I am not giving you exact steps, but here are the things you must do:

Viewing the FTP Server Status

The Hosts section should now show both ccsf-web and ccsf-ftp, as shown below:

Click the ccsf-ftp link. You will see a message saying "This host has not yet been checked, so status information is not available."

Just ignore that message-it's lying.

Click the "View Status Detail For This Host" link.

The "Service" should say FTP and the "Status" should be OK, as shown below.

You may gave to wait a few minutes for the check to complete.

Saving the Screen Image

Make sure the FTP service shows a status OK, as shown above.

Save a screen capture with a filename of "Proj 11b from YOUR NAME".

Turning In Your Project

Email the images to cnit.122sam@gmail.com with a subject of "Project 11 from YOUR NAME".


Sources

http://nagios.sourceforge.net/docs/3_0/monitoring-publicservices.html

http://homepage.mac.com/duling/halfdozen/Nagios-Howto-p1.html




Last modified 10-18-11 5 pm