Project

General

Profile

Assign Service to Host » History » Version 15

chin-yeh, 09/13/2010 09:19 AM

1 3 chin-yeh
{{toc}}
2
3 2 chin-yeh
h1. Assign Service to Host
4 1 chin-yeh
5
A service should be grouped under a specify service group to ease the configuration tasks.
6 2 chin-yeh
7 1 chin-yeh
*[Important]* Prepare the following information before begin:
8 15 chin-yeh
* *host name* - the host name of the host to be assigned; the particular host name must exists in
9
** @/usr/local/nagios/etc/ecosway/hosts/hosts.cfg@
10
** @/usr/local/nagios/etc/jmx4perl/servers.cfg@
11 7 chin-yeh
* *service group* - the group name of the service to be monitored
12 1 chin-yeh
13 12 chin-yeh
14 3 chin-yeh
List of available services:
15 6 chin-yeh
* [[Assign Service to Host#Assign-DB2-service|DB2]]
16
* [[Assign Service to Host#Assign-Third-Party-Service|Third Party Service]]
17
* [[Assign Service to Host#Assign-eCosway-Service|eCosway Application]]
18
* [[Assign Service to Host#Assign-Jboss-Service|Jboss]]
19
* [[Assign Service to Host#Assign-Server-Resources-Service|Server Resources]] 
20 1 chin-yeh
21
h2. Assign DB2 service
22
23 7 chin-yeh
Assumes that the target DB2 host has a @nagios@ user and the user has the monitor related privileges assigned.
24
25
The currently available commands for DB2 service are:
26
* *db2_connect_cmd* - check the time taken to establish connection to DB2
27
28
You may need the following additional information:
29
* *database name* - the name of the database to be monitored
30
* *warning threshold* - the warning threshold of this service in seconds unit, e.g. 3 for seconds
31
* *critical threshold* - the critical threshold of this service in seconds unit, e.g. 5 for seconds
32
33
h3. Steps
34
35
# login to the nagios server with @nagios@ user
36
# edit the @/usr/local/nagios/etc/ecosway/services/db2_services.cfg@
37
<pre>
38
nagios$ vi /usr/local/nagios/etc/ecosway/services/db2_services.cfg
39
</pre>
40
* Template:
41
<pre>
42
define service{
43
        use                     db2-service
44
        service_description     describe your service here
45
        host_name               host name
46
        check_command           db2_connect_cmd!database name!warning threshold!critical threshold
47
        }
48
</pre>
49
* Example:
50
<pre>
51
define service{
52
        use                     db2-service
53
        service_description     DB2 Connect - MY_STORE database
54
        host_name               cwydb1
55
        check_command           db2_connect_cmd!my_store!3!5
56
        }
57
</pre>
58
59
60 4 chin-yeh
h2. Assign Third Party Service
61
62 8 chin-yeh
This service is using *NRPE* addon and *check_http* command. Therefore, you may refer to the [[Documentation#Install-NRPE-optional|NRPE]] for the configuration details.
63
64
I will assume that you have the following things configured on the remote host and got the @NRPE@ up and running in the background:
65
* Remote Host: @/usr/local/nagios/etc/nrpe.cfg@
66
<pre>
67
... skip 
68
69
# UPS
70 9 chin-yeh
command[check_ups_sav]=/usr/local/nagios/libexec/check_http -I onlinetools.ups.com -S -u /webservices/XAV -w 10 -c 12
71
command[check_ups_rate]=/usr/local/nagios/libexec/check_http -I onlinetools.ups.com -S -u /webservices/Rate -w 10 -c 12
72 8 chin-yeh
73
# Avalara
74 9 chin-yeh
command[check_avatax]=/usr/local/nagios/libexec/check_http -I avatax.avalara.net -S -u / -w 10 -c 12 -e "HTTP/1.1 403 Forbidden"
75 8 chin-yeh
76
# Authorize.net
77 9 chin-yeh
command[check_authorize]=/usr/local/nagios/libexec/check_http -I secure.authorize.net -S -u /gateway/transact.dll -w 10 -c 12
78 8 chin-yeh
79
... skip
80
</pre>
81
82 10 chin-yeh
h3. Steps
83
84
# login to the nagios server with @nagios@ user
85
# edit @/usr/local/nagios/etc/ecosway/services/ex_services.cfg@
86
<pre>
87
nagios$ vi /usr/local/nagios/etc/ecosway/services/ex_services.cfg
88
</pre>
89
* assume that you'd like to monitor @Avatax@; the @check_avatax@ remote command would be used for this example.
90
* Template:
91
<pre>
92
define service{
93
        use                             ex-service
94
        host_name                       host name
95
        service_description             put your description here
96
        check_command                   check_nrpe!put the remote check command here
97
        }
98
</pre>
99
* Example:
100
<pre>
101
define service{
102
        use                             ex-service
103
        host_name                       cwyapp1
104
        service_description             Avalara - Avatax
105
        check_command                   check_nrpe!check_avatax
106
        }
107
</pre>
108
109 4 chin-yeh
h2. Assign eCosway Service
110
111 11 chin-yeh
This services are configured to run on remote host. However, this services could configure to run on nagios server instead. 
112
113
To monitor this, the @NRPE@ addon and @check_http@ commnd will be used. You could refer to the [[Documentation#Install-NRPE-optional|NRPE]] for the configuration details. Besides that, the following configuration must exist on the remote host:
114
* @/usr/local/nagios/etc/nrpe.cfg@
115
<pre>
116
... skip
117
118
command[check_dotcom]=/usr/local/nagios/libexec/check_http -H 192.168.2.66 -I 127.0.0.1 -u /ecosway/mall_main.jsp -w 5 -c 7
119
120
... skip
121
</pre>
122
123
h3. Steps
124
125
# login to the nagios server with @nagios@ user
126
# edit @/usr/local/nagios/etc/ecosway/services/ecos_services.cfg@
127
<pre>
128
nagios$ vi /usr/local/nagios/etc/ecosway/services/ecos_services.cfg
129
</pre>
130
* Template:
131
<pre>
132
define service{
133
        use                             ecos-service
134
        host_name                       host name
135
        service_description             put the description here
136
        check_command                   check_nrpe!the remote check command
137
        }
138
</pre>
139
* Example:
140
<pre>
141
define service{
142
        use                             ecos-service
143
        host_name                       cwyapp1
144
        service_description             Dot Com Mall
145
        check_command                   check_nrpe!check_dotcom
146
        }
147
</pre>
148
149
150 1 chin-yeh
h2. Assign Jboss Service
151 12 chin-yeh
152
This service uses the @Jmx4Perl@ addon. Below is the list of configured check commands (_ask the administrator to add more command when necessary_):
153 13 chin-yeh
* [[Assign_Service_to_Host#Steps-j4p_memory_heap|j4p_memory_heap]] - the utilized memory heap in Jboss instance
154
* [[Assign_Service_to_Host#Steps-j4p_perm_gen|j4p_perm_gen]] - the utilized perm gen in Jboss instance
155
* [[Assign_Service_to_Host#Steps-j4p_cpool_used|j4p_cpool_used]] - the number of utilized connections in Jboss's connection pool
156 12 chin-yeh
157
h3. Steps - j4p_memory_heap
158
159
# login to nagios server with @nagios@ user
160
# edit @/usr/local/nagios/etc/ecosway/services/jboss_services.cfg@
161
<pre>
162
nagios$ vi /usr/local/nagios/etc/ecosway/services/jboss_services.cfg
163
</pre>
164
* Template:
165
<pre>
166
define service{
167
        use                     jboss-service
168
        service_description     put the description here
169
        host_name               add or append the host name here, separate by commas
170
        check_command           j4p_cmd!j4p_memory_heap
171
        }
172
</pre>
173
* Example:
174
<pre>
175
define service{
176
        use                     jboss-service
177
        service_description     Jboss Heap Memory
178
        host_name               cwyrnd3-server,cwydb1,cwyapp1
179
        check_command           j4p_cmd!j4p_memory_heap
180
        }
181
</pre>
182
183
h3. Steps - j4p_perm_gen
184
185
# login to nagios server with @nagios@ user
186
# edit @/usr/local/nagios/etc/ecosway/services/jboss_services.cfg@
187
<pre>
188
nagios$ vi /usr/local/nagios/etc/ecosway/services/jboss_services.cfg
189
</pre>
190
* Template:
191
<pre>
192
define service{
193
        use                     jboss-service
194
        service_description     put the description here
195
        host_name               add or append host name here, separate by commas
196
        check_command           j4p_cmd!j4p_perm_gen
197
        }
198
</pre>
199
* Example:
200
<pre>
201
define service{
202
        use                     jboss-service
203
        service_description     Jboss Perm Gen
204
        host_name               cwyrnd3-server,cwydb1,cwyapp1
205
        check_command           j4p_cmd!j4p_perm_gen
206
        }
207
</pre>
208
209
h3. Steps - j4p_cpool_used
210
211
*SHOULD NOT* reuse the existing service definition as the data source name could be unique across different hosts.
212
213
Prepare the following information before continue:
214
* *data source name* - the name of the database connection pool
215
216
# login to nagios server with @nagios@ user
217
# edit @/usr/local/nagios/etc/ecosway/services/jboss_services.cfg@
218
<pre>
219
nagios$ vi /usr/local/nagios/etc/ecosway/services/jboss_services.cfg
220
</pre>
221
* Template:
222
<pre>
223
define service{
224
        use                     jboss-service
225
        service_description     put the description here
226
        host_name               host name
227
        check_command           j4p_cmd!j4p_cpool_used!data source name
228
        }
229
</pre>
230
* Example:
231
<pre>
232
define service{
233
        use                     jboss-service
234
        service_description     Connection Pool - DB2DS
235
        host_name               cwyapp1
236
        check_command           j4p_cmd!j4p_cpool_used!DB2DS
237
        }
238
</pre>
239 1 chin-yeh
240
h2. Assign Server Resources Service
241 13 chin-yeh
242 1 chin-yeh
This service is using @NRPE@ addon to monitor remote hosts' services, e.g. average load, swap files, and etc.
243 13 chin-yeh
244 15 chin-yeh
List of configured remote services:
245 14 chin-yeh
* Average Load - check the system current load
246 1 chin-yeh
* Swap File Used - check the swap space used
247
* Disk Space Used - check the amount of disk space used
248 15 chin-yeh
249
*[Important]* The NRPE addon must be configured and running on the particular remote machine(s).
250
# login to the Nagios server using @nagios@ user
251
# edit the @/usr/local/nagios/etc/ecosway/services/os_services.cfg@
252
<pre>
253
vi /usr/local/nagios/etc/ecosway/services/os_services.cfg
254
</pre>
255
* *reuse the existing service definition if exists*
256
* list of available *check command*:
257
** check_load
258
** check_swap
259
** check_hda1
260
* Template:
261
<pre>
262
define service{
263
        use                             os-service
264
        host_name                       cwydb1,put the host name here
265
        service_description             Current Load
266
        check_command                   check_nrpe!check_load
267
        }
268
269
define service{
270
        use                             os-service         
271
        host_name                       cwydb1,put the host name here
272
        service_description             Swap Usage
273
        check_command                   check_nrpe!check_swap
274
        }
275
276
define service{
277
        use                             os-service         
278
        host_name                       cwydb1,put the host name here
279
        service_description             Root Partition
280
        check_command                   check_nrpe!check_hda1
281
        }
282
</pre>
283
* Example:
284
<pre>
285
define service{
286
        use                             os-service         
287
        host_name                       cwydb1,cwyapp1
288
        service_description             Current Load
289
        check_command                   check_nrpe!check_load
290
        }
291
292
define service{
293
        use                             os-service         
294
        host_name                       cwydb1,cwyapp1
295
        service_description             Swap Usage
296
        check_command                   check_nrpe!check_swap
297
        }
298
299
define service{
300
        use                             os-service         
301
        host_name                       cwydb1,cwyapp1
302
        service_description             Root Partition
303
        check_command                   check_nrpe!check_hda1
304
        }
305
</pre>