Skip to main content

Plesk configuration file monitor (cfgmon)

cfgmon (Configuration file monitor) is a tool that lets you control changes in configuration files of Parallels Plesk Panel.
This tool is pretty like a simplistic revision control system.

What Problems Does This Tool Solve?

First, it’s troubleshooting issues with functioning of Panel and related services. Additionally, the history of changes in configuration files can help with finding local problems, performance regression, and so on.

How It Works

The working principle of the cfgmon tool is pretty simple. It has a list of files that it should monitor. Every time the Daily Maintenance script is executed, it runs cfgmon –save-all. This call compares each file from the list with its stored version and, if differences are found, saves the current version in the storage as well.

This lets you track configuration file changes that led to service malfunctioning no matter how they have been made: by server administrators, third-party scripts, package manager, or the Control Panel itself. You can find the changes by viewing the date of the latest modification or by comparing several revisions if the files were changed regularly.

An Example

Suppose that the FTP service on your server has suddenly stopped working.

Probably, no services are listening on the port 21. However, this port can be served not only by *ftpd, but also by xinetd (default in plesk).
However, xinetd is working:

Let’s use the configuration files monitor:

First, we’re calling the tool with the –save-all key (as Panel itself does it) so that all changes in the configuration files are saved in the storage.

Now, we’re calling the tool with the –list-all option and see the time of the latest modification and path to each configuration file. The list is sorted by the modification date and the files modified most recently are at the end of the list.

Looking at the example, we can guess that the problem is in /etc/xinetd.d/ftp_psa:  Yesterday (2013-05-23) the FTP service worked and now it doesn’t; the file was modified 2013-05-24 – last night.

Now we will use the tool to see the history of the file modifications.

We can see that this file was modified twice. Let’s compare the current revision with the previous one. There is a number of ways to do this; we will use the standard UNIX utility diff.

It seems that one of server administrators wanted to play a joke on us or mixed up the production server with a testing one: The FTP service is disabled.

Let’s open the file in a text editor and change the parameter disable = yes to disable = no.

Now, let’s restart xinetd and check whether FTP is working.

Although this example is artificial, we hope that it explains well the capabilities of the cfgmon tool. Software developers use revision control systems for viewing the history of changes in the code, searching for error causes, rolling back to the latest working revision, and so on. Now Plesk users have a similar tool too. The tool is shipped as a part of the Panel core and you can use it any time.

Leave a Reply

Your email address will not be published. Required fields are marked *

0 Shares
Tweet
Share
Share
Buffer
Reddit
+1