Agenda: exercises-nagios-rt.txt

File exercises-nagios-rt.txt, 4.9 KB (added by admin, 7 years ago)
Line 
1Nagios and Request Tracker Integration
2Creating Tickets
3
4Notes:
5------
6* Commands preceded with "$" imply that you should execute the command as
7  a general user - not as root.
8* Commands preceded with "#" imply that you should be working as root.
9* Commands with more specific command lines (e.g. "RTR-GW>" or "mysql>")
10  imply that you are executing commands on remote equipment, or within
11  another program.
12
13Exercises
14---------
15
16To configure RT and Nagios so that alerts from Nagios automatically
17create tickets requires a few steps:
18
19* Create a proper contact entry for Nagios in
20  /etc/nagios3/conf.d/contacts_nagios2.cfg
21
22* Update either services_nagios2.cfg or an individually host entry to use
23  the new contact group.
24
25These next two items should already be done in RT if you have
26finished the RT exercises.
27
28* Install the rt-mailgate software and configure it properly
29  in your /etc/aliases file for your MTA in use.
30
31* Configure the appropriate queues in RT to receive emails
32  passed to it from Nagios via the rt-mailgate software.
33
34Exercises
35---------------------------------
36
370. Log in to your PC as the sysadm user.
38
39
401.) Configure a Contact in Nagios
41---------------------------------
42
43Become root on your PC:
44
45        $ sudo bash
46
47Edit the file /etc/nagios3/conf.d/contacts_nagios2.cfg
48
49        # editor /etc/nagios3/conf.d/contacts_nagios2.cfg
50
51In this file we will first add a new contact name under
52the default root contact entry.
53
54WARNING: DO NOT remove the root contact entry.
55
56The new contact should look like this:
57
58
59define contact{
60        contact_name                    net
61        alias                           RT Alert Queue
62        service_notification_period     24x7
63        host_notification_period        24x7
64        service_notification_options    c
65        host_notification_options       d
66        service_notification_commands   notify-service-by-email
67        host_notification_commands      notify-host-by-email
68        email                           net@localhost
69        }
70
71
72Now at the end of the file add the following entry:
73
74
75define contactgroup{
76        contactgroup_name       tickets
77        alias                   email to ticket system for RT
78        members                 net,root
79        }
80
81
82Save and exit from the file.
83
84Notes
85-----
86
87   - the service_notification_option of "c" means only notify once a
88     service is considered "critical" by Nagios (i.e. down). The
89     host_notification_option of "d" means down. By specify only "c"
90     and "d" this means that notifications will not be sent for other
91     states.
92
93   - Note the email address in use "net@localhost" - this is important
94     as this was previously defined in the Request Tracker (RT) exercises.
95
96   - You could leave off "root" as a member, but we've left this on to
97     have another user that receives email to help us troubleshoot if
98     there are issues.
99
100
101
1023.) Choose a Service to Monitor that Creates Tickets in RT
103----------------------------------------------------------
104
105To send email to generate tickets in RT if SSH goes down on a box you would edit the
106SSH service check:
107
108        # editor /etc/nagios3/conf.d/services_nagios2.cfg
109   
110Find the service with the hostgroup_name of "ssh-servers" and add the "contact_groups"
111entry at the end of the defition. When you are done your defition should look like this:
112
113
114define service {
115        hostgroup_name                  ssh-servers
116        service_description             SSH
117        check_command                   check_ssh
118        use                             generic-service
119        notification_interval           0 ; set > 0 if you want to be renotified
120        contact_groups                  tickets,admins
121}
122
123
124Save and exit from the file.
125
126Notes
127-----
128
129   - Note the additional item that we now have, "contact_groups." You can do this for other
130     entries as well if you wish.
131
132   - We, also, included the default contact group of admins. You could leave this off if you
133     wish.
134
135Restart Nagios to verify your changes are correct:
136
137        # service nagios3 stop
138        # service nagios3 start
139
140If SSH goes down on any of the devices you are monitoring Nagios should generate a new
141ticket in Request Tracker. We will stop the SSH service on the classroom NOC server. If you
142are not monitoring this machine, then you will need to add an entry for NOC in your Nagios
143configuration and add it to the ssh hostgroup defined in the file hostgroups_nagios2.cfg.
144
145
1465. See Nagios Tickets in RT
147---------------------------
148
149   - It will take a while (up to 5 minutes) for Nagios to report that SSH is
150     "critical". Once that happens it will take another 10 minutes for a ticket to appear
151     in your RT ticket queue.
152
153   - Remember to see this go to http://pcX.ws.nsrc.org/rt/ and log in as Username "sysadm"
154     with the password you chose when you created the RT sysadm account. The new
155     ticket should appear in the "10 newest unowned tickets" box in the main log in
156     page in RT.