Project

General

Profile

Assign Service to Host » History » Revision 12

Revision 11 (chin-yeh, 09/09/2010 02:10 PM) → Revision 12/15 (chin-yeh, 09/09/2010 02:36 PM)

{{toc}} 

 h1. Assign Service to Host 

 A service should be grouped under a specify service group to ease the configuration tasks. 

 *[Important]* Prepare the following information before begin: 
 * *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@ assigned 
 * *service group* - the group name of the service to be monitored 


 

 List of available services: 
 * [[Assign Service to Host#Assign-DB2-service|DB2]] 
 * [[Assign Service to Host#Assign-Third-Party-Service|Third Party Service]] 
 * [[Assign Service to Host#Assign-eCosway-Service|eCosway Application]] 
 * [[Assign Service to Host#Assign-Jboss-Service|Jboss]] 
 * [[Assign Service to Host#Assign-Server-Resources-Service|Server Resources]]  

 h2. Assign DB2 service 

 Assumes that the target DB2 host has a @nagios@ user and the user has the monitor related privileges assigned. 

 The currently available commands for DB2 service are: 
 * *db2_connect_cmd* - check the time taken to establish connection to DB2 

 You may need the following additional information: 
 * *database name* - the name of the database to be monitored 
 * *warning threshold* - the warning threshold of this service in seconds unit, e.g. 3 for seconds 
 * *critical threshold* - the critical threshold of this service in seconds unit, e.g. 5 for seconds 

 h3. Steps 

 # login to the nagios server with @nagios@ user 
 # edit the @/usr/local/nagios/etc/ecosway/services/db2_services.cfg@ 
 <pre> 
 nagios$ vi /usr/local/nagios/etc/ecosway/services/db2_services.cfg 
 </pre> 
 * Template: 
 <pre> 
 define service{ 
         use                       db2-service 
         service_description       describe your service here 
         host_name                 host name 
         check_command             db2_connect_cmd!database name!warning threshold!critical threshold 
         } 
 </pre> 
 * Example: 
 <pre> 
 define service{ 
         use                       db2-service 
         service_description       DB2 Connect - MY_STORE database 
         host_name                 cwydb1 
         check_command             db2_connect_cmd!my_store!3!5 
         } 
 </pre> 


 h2. Assign Third Party Service 

 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. 

 I will assume that you have the following things configured on the remote host and got the @NRPE@ up and running in the background: 
 * Remote Host: @/usr/local/nagios/etc/nrpe.cfg@ 
 <pre> 
 ... skip  

 # UPS 
 command[check_ups_sav]=/usr/local/nagios/libexec/check_http -I onlinetools.ups.com -S -u /webservices/XAV -w 10 -c 12 
 command[check_ups_rate]=/usr/local/nagios/libexec/check_http -I onlinetools.ups.com -S -u /webservices/Rate -w 10 -c 12 

 # Avalara 
 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" 

 # Authorize.net 
 command[check_authorize]=/usr/local/nagios/libexec/check_http -I secure.authorize.net -S -u /gateway/transact.dll -w 10 -c 12 

 ... skip 
 </pre> 

 h3. Steps 

 # login to the nagios server with @nagios@ user 
 # edit @/usr/local/nagios/etc/ecosway/services/ex_services.cfg@ 
 <pre> 
 nagios$ vi /usr/local/nagios/etc/ecosway/services/ex_services.cfg 
 </pre> 
 * assume that you'd like to monitor @Avatax@; the @check_avatax@ remote command would be used for this example. 
 * Template: 
 <pre> 
 define service{ 
         use                               ex-service 
         host_name                         host name 
         service_description               put your description here 
         check_command                     check_nrpe!put the remote check command here 
         } 
 </pre> 
 * Example: 
 <pre> 
 define service{ 
         use                               ex-service 
         host_name                         cwyapp1 
         service_description               Avalara - Avatax 
         check_command                     check_nrpe!check_avatax 
         } 
 </pre> 

 h2. Assign eCosway Service 

 This services are configured to run on remote host. However, this services could configure to run on nagios server instead.  

 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: 
 * @/usr/local/nagios/etc/nrpe.cfg@ 
 <pre> 
 ... skip 

 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 

 ... skip 
 </pre> 

 h3. Steps 

 # login to the nagios server with @nagios@ user 
 # edit @/usr/local/nagios/etc/ecosway/services/ecos_services.cfg@ 
 <pre> 
 nagios$ vi /usr/local/nagios/etc/ecosway/services/ecos_services.cfg 
 </pre> 
 * Template: 
 <pre> 
 define service{ 
         use                               ecos-service 
         host_name                         host name 
         service_description               put the description here 
         check_command                     check_nrpe!the remote check command 
         } 
 </pre> 
 * Example: 
 <pre> 
 define service{ 
         use                               ecos-service 
         host_name                         cwyapp1 
         service_description               Dot Com Mall 
         check_command                     check_nrpe!check_dotcom 
         } 
 </pre> 


 h2. Assign Jboss Service 

 This service uses the @Jmx4Perl@ addon. Below is the list of configured check commands (_ask the administrator to add more command when necessary_): 
 * *j4p_memory_heap* - the utilized memory heap in Jboss instance 
 * *j4p_perm_gen* - the utilized perm gen in Jboss instance 
 * *j4p_cpool_used* - the number of utilized connections in Jboss's connection pool 

 h3. Steps - j4p_memory_heap 

 # login to nagios server with @nagios@ user 
 # edit @/usr/local/nagios/etc/ecosway/services/jboss_services.cfg@ 
 <pre> 
 nagios$ vi /usr/local/nagios/etc/ecosway/services/jboss_services.cfg 
 </pre> 
 * Template: 
 <pre> 
 define service{ 
         use                       jboss-service 
         service_description       put the description here 
         host_name                 add or append the host name here, separate by commas 
         check_command             j4p_cmd!j4p_memory_heap 
         } 
 </pre> 
 * Example: 
 <pre> 
 define service{ 
         use                       jboss-service 
         service_description       Jboss Heap Memory 
         host_name                 cwyrnd3-server,cwydb1,cwyapp1 
         check_command             j4p_cmd!j4p_memory_heap 
         } 
 </pre> 

 h3. Steps - j4p_perm_gen 

 # login to nagios server with @nagios@ user 
 # edit @/usr/local/nagios/etc/ecosway/services/jboss_services.cfg@ 
 <pre> 
 nagios$ vi /usr/local/nagios/etc/ecosway/services/jboss_services.cfg 
 </pre> 
 * Template: 
 <pre> 
 define service{ 
         use                       jboss-service 
         service_description       put the description here 
         host_name                 add or append host name here, separate by commas 
         check_command             j4p_cmd!j4p_perm_gen 
         } 
 </pre> 
 * Example: 
 <pre> 
 define service{ 
         use                       jboss-service 
         service_description       Jboss Perm Gen 
         host_name                 cwyrnd3-server,cwydb1,cwyapp1 
         check_command             j4p_cmd!j4p_perm_gen 
         } 
 </pre> 

 h3. Steps - j4p_cpool_used 

 *SHOULD NOT* reuse the existing service definition as the data source name could be unique across different hosts. 

 Prepare the following information before continue: 
 * *data source name* - the name of the database connection pool 

 # login to nagios server with @nagios@ user 
 # edit @/usr/local/nagios/etc/ecosway/services/jboss_services.cfg@ 
 <pre> 
 nagios$ vi /usr/local/nagios/etc/ecosway/services/jboss_services.cfg 
 </pre> 
 * Template: 
 <pre> 
 define service{ 
         use                       jboss-service 
         service_description       put the description here 
         host_name                 host name 
         check_command             j4p_cmd!j4p_cpool_used!data source name 
         } 
 </pre> 
 * Example: 
 <pre> 
 define service{ 
         use                       jboss-service 
         service_description       Connection Pool - DB2DS 
         host_name                 cwyapp1 
         check_command             j4p_cmd!j4p_cpool_used!DB2DS 
         } 
 </pre> 

 h2. Assign Server Resources Service 

 TODO