Agenda: exercises-nagios-rt.txt

File exercises-nagios-rt.txt, 5.6 KB (added by admin, 6 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 individuall 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 virtual machine 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
56REALLY - READ THIS! DO NOT remove the root contact entry.
57
58The new contact should look like this (UNDERNEATH the root contact entry):
59
60
61define contact{
62        contact_name                    net
63        alias                           RT Alert Queue
64        service_notification_period     24x7
65        host_notification_period        24x7
66        service_notification_options    c
67        host_notification_options       d
68        service_notification_commands   notify-service-by-email
69        host_notification_commands      notify-host-by-email
70        email                           net@pcX.ws.nsrc.org
71        }
72
73
74Now at the end of the file add the following entry:
75(Note: do not delete or update other entries.)
76
77define contactgroup{
78        contactgroup_name       tickets
79        alias                   email to ticket system for RT
80        members                 net,root
81        }
82
83
84Save and exit from the file.
85
86Notes
87-----
88
89   - the service_notification_option of "c" means only notify once a
90     service is considered "critical" by Nagios (i.e. down). The
91     host_notification_option of "d" means down. By specifying only "c"
92     and "d" this means that notifications will not be sent for other
93     states.
94
95   - Note the email address in use "net@pcX.ws.nsrc.org" - this is important
96     as this was previously defined in the Request Tracker (RT) exercises.
97
98   - You could leave off "root" as a member, but we've left this on to
99     have another user that receives email to help us troubleshoot if
100     there are issues.
101
102
103
1043.) Choose a Service to Monitor that Creates Tickets in RT
105----------------------------------------------------------
106
107To send email to generate tickets in RT if SSH goes down on a box you would edit the
108SSH service check:
109
110        # editor /etc/nagios3/conf.d/services_nagios2.cfg
111   
112Find the service with the hostgroup_name of "ssh-servers" and add the "contact_groups"
113entry at the end of the definition. When you are done your definition should look like this:
114
115
116define service {
117        hostgroup_name                  ssh-servers
118        service_description             SSH
119        check_command                   check_ssh
120        use                             generic-service
121        notification_interval           0 ; set > 0 if you want to be renotified
122        contact_groups                  tickets,admins
123}
124
125
126Save and exit from the file.
127
128Notes
129-----
130
131   - Note the additional item that we now have, "contact_groups." You can do this for other
132     entries as well if you wish.
133
134   - We, also, included the default contact group of admins. You could leave this off if you
135     wish.
136
1374.) Include noc in as members of ssh-server
138
139# editor /etc/nagios3/conf.d/hostgroups_nagios2.cfg
140   
141Find the group with the hostgroup_name of "ssh-servers" and noc to the "members"
142entry at the end of the definition. When you are done your definition should look like this:
143
144# A list of your ssh-accessible servers
145define hostgroup {
146        hostgroup_name  ssh-servers
147                alias           SSH servers
148                members         localhost,noc
149        }
150
151Restart Nagios to verify your changes are correct:
152
153        # service nagios3 restart
154
155If SSH goes down on any of the devices you are monitoring Nagios should generate a new
156ticket in Request Tracker. We will stop the SSH service on the classroom NOC server. If you
157are not monitoring this machine, then you will need to add an entry for NOC in your Nagios
158configuration and add it to the ssh hostgroup defined in the file hostgroups_nagios2.cfg.
159
160
1615. See Nagios Tickets in RT
162---------------------------
163
164   - It will take a bit (up to 5 minutes) for Nagios to report that SSH is "critical".
165     Then you must wait for a total of 4 checks before the SSH service is deemed to be
166     down "hard". At that point Nagios will send an email to net@pcX.ws.nsrc.org and a ticket
167     will be created in RT.
168
169   - Remember to see this go to http://pcX.ws.nsrc.org/rt/ and log in as Username "sysadm"
170     with the password you chose when you created the RT sysadm account. The new
171     ticket should appear in the "10 newest unowned tickets" box in the main login
172     page in RT.