Project

General

Profile

Assign Service to Host » History » Version 11

chin-yeh, 09/09/2010 02:10 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 7 chin-yeh
* *host name* - the host name of the host to be assigned
9
* *service group* - the group name of the service to be monitored
10 3 chin-yeh
11
List of available services:
12 6 chin-yeh
* [[Assign Service to Host#Assign-DB2-service|DB2]]
13
* [[Assign Service to Host#Assign-Third-Party-Service|Third Party Service]]
14
* [[Assign Service to Host#Assign-eCosway-Service|eCosway Application]]
15
* [[Assign Service to Host#Assign-Jboss-Service|Jboss]]
16
* [[Assign Service to Host#Assign-Server-Resources-Service|Server Resources]] 
17 1 chin-yeh
18
h2. Assign DB2 service
19
20 7 chin-yeh
Assumes that the target DB2 host has a @nagios@ user and the user has the monitor related privileges assigned.
21
22
The currently available commands for DB2 service are:
23
* *db2_connect_cmd* - check the time taken to establish connection to DB2
24
25
You may need the following additional information:
26
* *database name* - the name of the database to be monitored
27
* *warning threshold* - the warning threshold of this service in seconds unit, e.g. 3 for seconds
28
* *critical threshold* - the critical threshold of this service in seconds unit, e.g. 5 for seconds
29
30
h3. Steps
31
32
# login to the nagios server with @nagios@ user
33
# edit the @/usr/local/nagios/etc/ecosway/services/db2_services.cfg@
34
<pre>
35
nagios$ vi /usr/local/nagios/etc/ecosway/services/db2_services.cfg
36
</pre>
37
* Template:
38
<pre>
39
define service{
40
        use                     db2-service
41
        service_description     describe your service here
42
        host_name               host name
43
        check_command           db2_connect_cmd!database name!warning threshold!critical threshold
44
        }
45
</pre>
46
* Example:
47
<pre>
48
define service{
49
        use                     db2-service
50
        service_description     DB2 Connect - MY_STORE database
51
        host_name               cwydb1
52
        check_command           db2_connect_cmd!my_store!3!5
53
        }
54
</pre>
55
56
57 4 chin-yeh
h2. Assign Third Party Service
58
59 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.
60
61
I will assume that you have the following things configured on the remote host and got the @NRPE@ up and running in the background:
62
* Remote Host: @/usr/local/nagios/etc/nrpe.cfg@
63
<pre>
64
... skip 
65
66
# UPS
67 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
68
command[check_ups_rate]=/usr/local/nagios/libexec/check_http -I onlinetools.ups.com -S -u /webservices/Rate -w 10 -c 12
69 8 chin-yeh
70
# Avalara
71 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"
72 8 chin-yeh
73
# Authorize.net
74 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
75 8 chin-yeh
76
... skip
77
</pre>
78
79 10 chin-yeh
h3. Steps
80
81
# login to the nagios server with @nagios@ user
82
# edit @/usr/local/nagios/etc/ecosway/services/ex_services.cfg@
83
<pre>
84
nagios$ vi /usr/local/nagios/etc/ecosway/services/ex_services.cfg
85
</pre>
86
* assume that you'd like to monitor @Avatax@; the @check_avatax@ remote command would be used for this example.
87
* Template:
88
<pre>
89
define service{
90
        use                             ex-service
91
        host_name                       host name
92
        service_description             put your description here
93
        check_command                   check_nrpe!put the remote check command here
94
        }
95
</pre>
96
* Example:
97
<pre>
98
define service{
99
        use                             ex-service
100
        host_name                       cwyapp1
101
        service_description             Avalara - Avatax
102
        check_command                   check_nrpe!check_avatax
103
        }
104
</pre>
105
106 4 chin-yeh
h2. Assign eCosway Service
107
108 11 chin-yeh
This services are configured to run on remote host. However, this services could configure to run on nagios server instead. 
109
110
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:
111
* @/usr/local/nagios/etc/nrpe.cfg@
112
<pre>
113
... skip
114
115
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
116
117
... skip
118
</pre>
119
120
h3. Steps
121
122
# login to the nagios server with @nagios@ user
123
# edit @/usr/local/nagios/etc/ecosway/services/ecos_services.cfg@
124
<pre>
125
nagios$ vi /usr/local/nagios/etc/ecosway/services/ecos_services.cfg
126
</pre>
127
* Template:
128
<pre>
129
define service{
130
        use                             ecos-service
131
        host_name                       host name
132
        service_description             put the description here
133
        check_command                   check_nrpe!the remote check command
134
        }
135
</pre>
136
* Example:
137
<pre>
138
define service{
139
        use                             ecos-service
140
        host_name                       cwyapp1
141
        service_description             Dot Com Mall
142
        check_command                   check_nrpe!check_dotcom
143
        }
144
</pre>
145
146
147 4 chin-yeh
h2. Assign Jboss Service
148 1 chin-yeh
149 4 chin-yeh
h2. Assign Server Resources Service
150 5 chin-yeh
151 7 chin-yeh
TODO