BuycPanel Blog

BuycPanel Blog

Latest news and updates

TailWatch

Posted by Allura on 22 08 2018.

Introduction
TailWatch driver is used to monitor a log file and take appropriate actions depending on the observations. This looks into specific services and has in it the instructions needed in performing those actions (as in, the log which needs to be monitored or what to do with the instruction).

There are certain stock drivers in cPanel and WHM version 56:

 	chkservd
 	cpbandwd
 	eximstats
 	jailmanager
 	modseclog
 	recentauthedmailiptracker

TailWatch driver can be enabled or disabled in WHM’s Service Manager Interface (WHM >> Home >> Service Configuration >> Service Manager).

The chkservd Driver
It determines the online availability of a process and whether the process can restart depending on the following actions:

The Actions

 	Connection-based monitoring: The chkservd driver tries out to connect service’s specified port, issue commands, and holds on for a response. As soon as the response is received by the driver, the driver reports it to the service online.
 	Process-based monitoring: Involves the driver to…

Introduction

TailWatch driver is used to monitor a log file and take appropriate actions depending on the observations. This looks into specific services and has in it the instructions needed in performing those actions (as in, the log which needs to be monitored or what to do with the instruction).

There are certain stock drivers in cPanel and WHM version 56:

  • chkservd
  • cpbandwd
  • eximstats
  • jailmanager
  • modseclog
  • recentauthedmailiptracker

TailWatch driver can be enabled or disabled in WHM’s Service Manager Interface (WHM >> Home >> Service Configuration >> Service Manager).

The chkservd Driver

It determines the online availability of a process and whether the process can restart depending on the following actions:

The Actions

  • Connection-based monitoring: The chkservd driver tries out to connect service’s specified port, issue commands, and holds on for a response. As soon as the response is received by the driver, the driver reports it to the service online.
  • Process-based monitoring: Involves the driver to check a specific process and determine the status of the connection.

One can set service’s monitor process in service’s configuration file.

Service’s Status

By default, the driver checks the service in every 5 minutes to get acknowledged about the service’s status.

In That Case,

  • The driver will move on to check the next service, provided the service is online.
  • The driver whereas will handle one of the cPanel restart scripts located at /usr/local/cPanel/scripts/restartsrv_* ,to try to restart the service, if the service is offline.

Formats

The results of the chkservd can be viewed in any of the formats given below:

  • The /var/log/chkservd.log log file which contains result from each check it performs.
  • WHM’s Server Information Interface (WHM >> Home >> Server Status >> Server Information) displaying the results from each check.
  • The system can be configured to email the results from each check.

Add a New Monitor

To add a service for the driver to monitor, one needs to follow the steps:

Steps:

  • Open the /etc/chkserv.d/chkservd.conf file with a text editor.
  • Add service that can monitor the file, a colon (:), and a 1 or 0 to indicate as to whether the system would monitor the new service.
  • Configuration file to be created for new service in the /etc/chkserv.d
  • Open the file and add a line that resemble either command-based monitoring (service[ftpd]=21,QUIT,220,/usr/local/cpar) or process-based monitoring (service[ftpd]=x,x,x,/usr/local/cpanel/scripts/restartsrv-ftpserver,ftp|root)
  • Restart the chkservd driver after entering the service’s configuration information by running the command:

        /etc/init.d/chkservd restart

  • Confirm the service’s appearance in WHM’s Service Manager Interface (WHM >> Home >> Service Configuration >> Service Manager).

Conclusion

TailWatch driver can be used in WHM and cPanel following certain actions, service’s status, formats, and steps to add new monitor.