1 Nagios and Request Tracker Integration

2 Creating Tickets

3 Introduction

3.1 Goals

3.2 Notes

4 Exercises

To configure RT and Nagios so that alerts from Nagios automatically create tickets requires a few steps:

These next two items should already be done in RT if you have finished the RT exercises.

5 Exercises

Log in to your virtual machine as the sysadm user.

6 Configure a Contact in Nagios

Become root on your PC:

$ sudo -s

Edit the file /etc/nagios3/conf.d/contacts_nagios2.cfg

# editor /etc/nagios3/conf.d/contacts_nagios2.cfg

In this file we will first add a new contact name under the default root contact entry.

WARNING: DO NOT remove the root contact entry.

REALLY - READ THIS! DO NOT remove the root contact entry.

The new contact should look like this (UNDERNEATH the root contact entry):

define contact{
        contact_name                    net
        alias                           RT Alert Queue
        service_notification_period     24x7
        host_notification_period        24x7
        service_notification_options    c 
        host_notification_options       d 
        service_notification_commands   notify-service-by-email
        host_notification_commands      notify-host-by-email
        email                           net@pcX.ws.nsrc.org
        }

Now at the end of the file add the following entry: (Note: do not delete or update other entries.)

define contactgroup{
        contactgroup_name       tickets
        alias                   email to ticket system for RT
        members                 net,root
        }

Save and exit from the file.

6.1 Notes

7 Choose a Service to Monitor that Creates Tickets in RT

To send email to generate tickets in RT if SSH goes down on a box you would edit the SSH service check:

# editor /etc/nagios3/conf.d/services_nagios2.cfg

Find the service with the hostgroup_name of "ssh-servers" and add the "contact_groups" entry at the end of the definition. When you are done your definition should look like this:

define service {
  hostgroup_name                  ssh-servers
  service_description             SSH
  check_command                   check_ssh
  use                             generic-service
  notification_interval           0 ; set > 0 if you want to be renotified
  contact_groups                  tickets,admins
}

Save and exit from the file.

7.1 Notes

8 Include noc in as members of ssh-server

# editor /etc/nagios3/conf.d/hostgroups_nagios2.cfg

Find the group with the hostgroup_name of "ssh-servers" and noc to the "members" entry at the end of the definition. When you are done your definition should look like this:

# A list of your ssh-accessible servers
define hostgroup {
        hostgroup_name  ssh-servers
                alias           SSH servers
                members         localhost,noc
        }

Restart Nagios to verify your changes are correct:

# service nagios3 restart

If SSH goes down on any of the devices you are monitoring Nagios should generate a new ticket in Request Tracker. We will stop the SSH service on the classroom NOC server. If you are not monitoring this machine, then you will need to add an entry for NOC in your Nagios configuration and add it to the ssh hostgroup defined in the file hostgroups_nagios2.cfg.

9 See Nagios Tickets in RT