Assign Service to Host » History » Version 12
chin-yeh, 09/09/2010 02:36 PM
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 | 12 | chin-yeh | * *host name* - the host name of the host to be assigned; the particular host name must exists in the @/usr/local/nagios/etc/ecosway/hosts/hosts.cfg@ and @/usr/local/nagios/etc/jmx4perl/servers.cfg@ |
9 | 7 | chin-yeh | * *service group* - the group name of the service to be monitored |
10 | 1 | chin-yeh | |
11 | 12 | chin-yeh | |
12 | 3 | chin-yeh | List of available services: |
13 | 6 | chin-yeh | * [[Assign Service to Host#Assign-DB2-service|DB2]] |
14 | * [[Assign Service to Host#Assign-Third-Party-Service|Third Party Service]] |
||
15 | * [[Assign Service to Host#Assign-eCosway-Service|eCosway Application]] |
||
16 | * [[Assign Service to Host#Assign-Jboss-Service|Jboss]] |
||
17 | * [[Assign Service to Host#Assign-Server-Resources-Service|Server Resources]] |
||
18 | 1 | chin-yeh | |
19 | h2. Assign DB2 service |
||
20 | |||
21 | 7 | chin-yeh | Assumes that the target DB2 host has a @nagios@ user and the user has the monitor related privileges assigned. |
22 | |||
23 | The currently available commands for DB2 service are: |
||
24 | * *db2_connect_cmd* - check the time taken to establish connection to DB2 |
||
25 | |||
26 | You may need the following additional information: |
||
27 | * *database name* - the name of the database to be monitored |
||
28 | * *warning threshold* - the warning threshold of this service in seconds unit, e.g. 3 for seconds |
||
29 | * *critical threshold* - the critical threshold of this service in seconds unit, e.g. 5 for seconds |
||
30 | |||
31 | h3. Steps |
||
32 | |||
33 | # login to the nagios server with @nagios@ user |
||
34 | # edit the @/usr/local/nagios/etc/ecosway/services/db2_services.cfg@ |
||
35 | <pre> |
||
36 | nagios$ vi /usr/local/nagios/etc/ecosway/services/db2_services.cfg |
||
37 | </pre> |
||
38 | * Template: |
||
39 | <pre> |
||
40 | define service{ |
||
41 | use db2-service |
||
42 | service_description describe your service here |
||
43 | host_name host name |
||
44 | check_command db2_connect_cmd!database name!warning threshold!critical threshold |
||
45 | } |
||
46 | </pre> |
||
47 | * Example: |
||
48 | <pre> |
||
49 | define service{ |
||
50 | use db2-service |
||
51 | service_description DB2 Connect - MY_STORE database |
||
52 | host_name cwydb1 |
||
53 | check_command db2_connect_cmd!my_store!3!5 |
||
54 | } |
||
55 | </pre> |
||
56 | |||
57 | |||
58 | 4 | chin-yeh | h2. Assign Third Party Service |
59 | |||
60 | 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. |
61 | |||
62 | I will assume that you have the following things configured on the remote host and got the @NRPE@ up and running in the background: |
||
63 | * Remote Host: @/usr/local/nagios/etc/nrpe.cfg@ |
||
64 | <pre> |
||
65 | ... skip |
||
66 | |||
67 | # UPS |
||
68 | 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 |
69 | command[check_ups_rate]=/usr/local/nagios/libexec/check_http -I onlinetools.ups.com -S -u /webservices/Rate -w 10 -c 12 |
||
70 | 8 | chin-yeh | |
71 | # Avalara |
||
72 | 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" |
73 | 8 | chin-yeh | |
74 | # Authorize.net |
||
75 | 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 |
76 | 8 | chin-yeh | |
77 | ... skip |
||
78 | </pre> |
||
79 | |||
80 | 10 | chin-yeh | h3. Steps |
81 | |||
82 | # login to the nagios server with @nagios@ user |
||
83 | # edit @/usr/local/nagios/etc/ecosway/services/ex_services.cfg@ |
||
84 | <pre> |
||
85 | nagios$ vi /usr/local/nagios/etc/ecosway/services/ex_services.cfg |
||
86 | </pre> |
||
87 | * assume that you'd like to monitor @Avatax@; the @check_avatax@ remote command would be used for this example. |
||
88 | * Template: |
||
89 | <pre> |
||
90 | define service{ |
||
91 | use ex-service |
||
92 | host_name host name |
||
93 | service_description put your description here |
||
94 | check_command check_nrpe!put the remote check command here |
||
95 | } |
||
96 | </pre> |
||
97 | * Example: |
||
98 | <pre> |
||
99 | define service{ |
||
100 | use ex-service |
||
101 | host_name cwyapp1 |
||
102 | service_description Avalara - Avatax |
||
103 | check_command check_nrpe!check_avatax |
||
104 | } |
||
105 | </pre> |
||
106 | |||
107 | 4 | chin-yeh | h2. Assign eCosway Service |
108 | |||
109 | 11 | chin-yeh | This services are configured to run on remote host. However, this services could configure to run on nagios server instead. |
110 | |||
111 | 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: |
||
112 | * @/usr/local/nagios/etc/nrpe.cfg@ |
||
113 | <pre> |
||
114 | ... skip |
||
115 | |||
116 | 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 |
||
117 | |||
118 | ... skip |
||
119 | </pre> |
||
120 | |||
121 | h3. Steps |
||
122 | |||
123 | # login to the nagios server with @nagios@ user |
||
124 | # edit @/usr/local/nagios/etc/ecosway/services/ecos_services.cfg@ |
||
125 | <pre> |
||
126 | nagios$ vi /usr/local/nagios/etc/ecosway/services/ecos_services.cfg |
||
127 | </pre> |
||
128 | * Template: |
||
129 | <pre> |
||
130 | define service{ |
||
131 | use ecos-service |
||
132 | host_name host name |
||
133 | service_description put the description here |
||
134 | check_command check_nrpe!the remote check command |
||
135 | } |
||
136 | </pre> |
||
137 | * Example: |
||
138 | <pre> |
||
139 | define service{ |
||
140 | use ecos-service |
||
141 | host_name cwyapp1 |
||
142 | service_description Dot Com Mall |
||
143 | check_command check_nrpe!check_dotcom |
||
144 | } |
||
145 | </pre> |
||
146 | |||
147 | |||
148 | 1 | chin-yeh | h2. Assign Jboss Service |
149 | 12 | chin-yeh | |
150 | This service uses the @Jmx4Perl@ addon. Below is the list of configured check commands (_ask the administrator to add more command when necessary_): |
||
151 | * *j4p_memory_heap* - the utilized memory heap in Jboss instance |
||
152 | * *j4p_perm_gen* - the utilized perm gen in Jboss instance |
||
153 | * *j4p_cpool_used* - the number of utilized connections in Jboss's connection pool |
||
154 | |||
155 | h3. Steps - j4p_memory_heap |
||
156 | |||
157 | # login to nagios server with @nagios@ user |
||
158 | # edit @/usr/local/nagios/etc/ecosway/services/jboss_services.cfg@ |
||
159 | <pre> |
||
160 | nagios$ vi /usr/local/nagios/etc/ecosway/services/jboss_services.cfg |
||
161 | </pre> |
||
162 | * Template: |
||
163 | <pre> |
||
164 | define service{ |
||
165 | use jboss-service |
||
166 | service_description put the description here |
||
167 | host_name add or append the host name here, separate by commas |
||
168 | check_command j4p_cmd!j4p_memory_heap |
||
169 | } |
||
170 | </pre> |
||
171 | * Example: |
||
172 | <pre> |
||
173 | define service{ |
||
174 | use jboss-service |
||
175 | service_description Jboss Heap Memory |
||
176 | host_name cwyrnd3-server,cwydb1,cwyapp1 |
||
177 | check_command j4p_cmd!j4p_memory_heap |
||
178 | } |
||
179 | </pre> |
||
180 | |||
181 | h3. Steps - j4p_perm_gen |
||
182 | |||
183 | # login to nagios server with @nagios@ user |
||
184 | # edit @/usr/local/nagios/etc/ecosway/services/jboss_services.cfg@ |
||
185 | <pre> |
||
186 | nagios$ vi /usr/local/nagios/etc/ecosway/services/jboss_services.cfg |
||
187 | </pre> |
||
188 | * Template: |
||
189 | <pre> |
||
190 | define service{ |
||
191 | use jboss-service |
||
192 | service_description put the description here |
||
193 | host_name add or append host name here, separate by commas |
||
194 | check_command j4p_cmd!j4p_perm_gen |
||
195 | } |
||
196 | </pre> |
||
197 | * Example: |
||
198 | <pre> |
||
199 | define service{ |
||
200 | use jboss-service |
||
201 | service_description Jboss Perm Gen |
||
202 | host_name cwyrnd3-server,cwydb1,cwyapp1 |
||
203 | check_command j4p_cmd!j4p_perm_gen |
||
204 | } |
||
205 | </pre> |
||
206 | |||
207 | h3. Steps - j4p_cpool_used |
||
208 | |||
209 | *SHOULD NOT* reuse the existing service definition as the data source name could be unique across different hosts. |
||
210 | |||
211 | Prepare the following information before continue: |
||
212 | * *data source name* - the name of the database connection pool |
||
213 | |||
214 | # login to nagios server with @nagios@ user |
||
215 | # edit @/usr/local/nagios/etc/ecosway/services/jboss_services.cfg@ |
||
216 | <pre> |
||
217 | nagios$ vi /usr/local/nagios/etc/ecosway/services/jboss_services.cfg |
||
218 | </pre> |
||
219 | * Template: |
||
220 | <pre> |
||
221 | define service{ |
||
222 | use jboss-service |
||
223 | service_description put the description here |
||
224 | host_name host name |
||
225 | check_command j4p_cmd!j4p_cpool_used!data source name |
||
226 | } |
||
227 | </pre> |
||
228 | * Example: |
||
229 | <pre> |
||
230 | define service{ |
||
231 | use jboss-service |
||
232 | service_description Connection Pool - DB2DS |
||
233 | host_name cwyapp1 |
||
234 | check_command j4p_cmd!j4p_cpool_used!DB2DS |
||
235 | } |
||
236 | </pre> |
||
237 | 1 | chin-yeh | |
238 | 4 | chin-yeh | h2. Assign Server Resources Service |
239 | 5 | chin-yeh | |
240 | 7 | chin-yeh | TODO |