• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

Setting health monitoring options from shell

MerlijnH

Basic Pleskian
For ease of deployment I wish to set all the values for the health monitoring from the commandline, so I have created the XML you would normally upload through the Plesk Panel, but I cannot find any scripts to import this from the commandline.

I have tried to simply replace the one in /opt/psa/admin/conf/health-config.xml - but this does not seem to change the values shown in the Plesk panel.

Can anyone give me some hints on how to do this?
 
There are 2 config files:
1) /usr/local/psa/admin/conf/health-config.xml describe thresholds, alarms, etc. This config is self explained. (see instruction at the beginning)
2) /etc/sw-collectd/collectd.conf contains hardware configuration. This file should not be changed manually. This file should be regenerated via special utility.
 
Hello IgorG,

I have tried to replace the health-config.xml file (first with the file I can upload correctly, but this gives an XML parse error). When I transfer the health-config.xml from another server where I did upload it manually the Health Monitor page actually works, but it shows the wrong thresholds when you use the mouseover over the (?) field.

What is the correct way to regenerate these?
 
Try to use

# /usr/local/psa/bin/sw-engine-pleskrun /usr/local/psa/admin/plib/scripts/setup-health-monitor.php

but I'm not sure that /usr/local/psa/admin/conf/health-config.xml will be regenerated.
 
Hello IgorG,

Indeed this does seem to regenerate the file and overwrite any changes I make. Do you have any other solution on how to import the XML?

Kind regards,
 
It seems this default xml config file should be generated from /usr/local/psa/admin/plib/Health/Config/custom-health-config.xsd schema file.
 
Hello IgorG,

This is actually the schema used to verify the XML for input, which doesn't help me much.

I did find another file where the custom XML apparently is stored: /usr/local/psa/var/custom-health-config.xml

On a test server I have replaced this file with my own config and afterwards ran the /usr/local/psa/bin/sw-engine-pleskrun /usr/local/psa/admin/plib/scripts/setup-health-monitor.php command. This still has not solved the issue, as in Plesk it still lists the old threshold values.

Kind regards,
 
Most probably services psa-health-monitor-notificationd and sw-collectd should be restarted after config file modifications.
 
Hello IgorG,

I have tried to restart both of them, without results.

In fact it seems the data in /usr/local/psa/var/custom-health-config.xml is overwritten again when running /usr/local/psa/bin/sw-engine-pleskrun /usr/local/psa/admin/plib/scripts/setup-health-monitor.php

So I'm guessing I still don't have the correct place to upload the custom xml data. Do you have any more clues?

Kind regards,
 
Hello IgorG,

Do you still have any suggestions as to what I may try to set these options from the commandline? Currently I am stuck as it seems the files are always overwritten from a place unknown to me.

Cheers,
 
I can suggest only try to reinstall psa-health-monitor package. Very difficult to say what is wrong there without investigation directly on your server. Therefore I suggest you contact Parallels support team if package reinstallation will not help.
 
Hello IgorG,

I have attempted to do this on a freshly installed server, and still was not able to set the values correctly.

Just for clarification - the official way to do this according to you is:

replace /usr/local/psa/var/custom-health-config.xml
run /usr/local/psa/bin/sw-engine-pleskrun /usr/local/psa/admin/plib/scripts/setup-health-monitor.php
restart psa-health-monitor-notificationd and sw-collectd

Is this correct or did I miss something?

Cheers,
 
Due to apc cashing changes in health-config.xml can be reflected much later. You can try to disable it with

apc.enabled = 0

in /usr/local/psa/admin/conf/php.ini but it can lead to decreasing speed of panel operation.
 
Hello IgorG,

It seems that the way I describe in my previous post does not update anything at all. The file I replaced will simply be overwritten, and the changes are simply ignored. For clarity, the APC change does not make any difference at all.

Could you please describe how you managed to do this from the commandline?

Kind regards,
 
Config file can be overwritten only after

# /usr/local/psa/bin/sw-engine-pleskrun /usr/local/psa/admin/plib/scripts/setup-health-monitor.php
 
Hello IgorG,

AH! There we go, so you should NOT run that command at all - and it seems to work fine.

Is there anything I should be wary about regarding updates or this file being overwritten by some action done from Plesk?

Thanks a lot for your help.

Kind regards,
 
I know only about overwriting by mentioned command. Not sure about other reasons.
 
Back
Top