• 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

Issue Not receiving alert emails from Server Health Monitor

fuf

New Pleskian
Hi,

I'm trying to test whether email notifications are successfully sent by the Health Monitor. I downloaded custom-health-config.xml which specifies:

"The "notificationEmail" child element defines an alarm notification recipient. If the element is omitted, the alarm notifications are sent to the Panel admin's e-mail address."

As a test, I changed the alert levels on disk usage for the "/" partition to very low values and re-uploaded the file.

The page at /admin/health/ successfully shows "(!) Problem", as expected.

However, I did not receive an email to the Plesk admin address.

I successfully receive other admin emails like "Notification of creation" and "Application updates" etc.

The only documentation I can find ( https://docs.plesk.com/en-US/12.5/a...s-and-monitoring/server-health-monitor.68886/ ) specifies:

"By default, email notifications are not configured."

It is not clear whether "not configured" means "not enabled", and if so, how to enable them.

What am I doing wrong?

Many thanks.
 
Try to edit /usr/local/psa/var/custom-health-config.xml manually through the command line and then restart the service:

# /etc/init.d/psa-health-monitor-notificationd restart
 
Thanks Igor.

I tried your suggestion:

Code:
Restarting psa-health-monitor-notificationd (via systemctl): psa-health-monitor-notificationd.service.

I can see that the Alerts are being successfully triggered by going to the Server Health page.

But still, no emails.

I guess I could try adding the "notificationEmail" element to the custom-health-config.xml file and specifying an email address explicitly, but I am not sure of the correct format or where in the XML hierarchy that node would go.
 
You can specify it for service, for example:

<service name="MySql" monitor="true">
<alarm level="red" threshold="25" type="percent"/>
<alarm level="yellow" threshold="20" type="percent"/>
<notificationEmail address="[email protected]" name="Health Monitor notification" />
</service>
 
Thanks Igor.

I tried editing /usr/local/psa/var/custom-health-config.xml so it looks like this:

Code:
  <Misc alarmsInterval="5"/>
  <Hdd>
     <TotalUsage>
       <device name="/" monitor="true">
         <alarm level="red" threshold="50" type="percent"/>
         <alarm level="yellow" threshold="50" type="percent"/>
         <notificationEmail address="[email protected]" name="Disk Usage Alarm" />
       </device>
...

When I navigate to admin/health/index?context=health I'm now seeing:

Code:
Error: Configuration file is invalid.
{"redirect":"\/","status":"error","statusMessages":[]}

Update:

The documentation in the file says:
Code:
= Misc =
This element defines how the alarm notification e-mails should be sent.
   The "alarmsInterval" attribute defines how often (in minutes) the health monitor should be checked for new alarms appearance. As soon as such check-up detects a new alarm, a notification e-mail is sent.
 The "notificationSubject" attribute sets the Subject line for alarm notification e-mails.
   
 The "notificationEmail" child element defines an alarm notification recipient. If the element is omitted, the alarm notifications are sent to the Panel admin's e-mail address.
  The "address" attribute defines e-mail address to which the notifications will be sent.
  The "name" attribute defines the recipient name. For example, "John Doe".

This suggests to me that the correct format should be:
Code:
<Misc alarmsInterval="5" notificationSubject="Plesk Health Monitor"/>
       <notificationEmail address="[email protected]" name="Disk Usage Alarm" />
</Misc>

However this also gives me a "Error: Configuration file is invalid." message
 
Last edited:
This file works fo me with the following section Misc:

<Misc alarmsInterval="5" notificationSubject="The server have some problem">
<notificationEmail address="[email protected]" name="MyServerName"/>
</Misc>
 
Thanks Igor.

I'm no longer getting the configuration error, but I'm also still not receiving any emails.

Here's the complete file for clarity. Note the low values for <device name = "/"> and <CPU> total usage. Both of these are definitely triggering alarms.

Code:
<configdata>
<Misc alarmsInterval="5" notificationSubject="Plesk Health Monitor">
<notificationEmail address="[email protected]" name="Parmenides"/>
</Misc>
<Hdd>
<TotalUsage>
<device name="/" monitor="true">
<alarm level="red" threshold="50" type="percent"/>
<alarm level="yellow" threshold="50" type="percent"/>
</device>
<device name="/dev" monitor="true">
<alarm level="red" threshold="90" type="percent"/>
<alarm level="yellow" threshold="80" type="percent"/>
</device>
<device name="/run" monitor="false">
<alarm level="red" threshold="90" type="percent"/>
<alarm level="yellow" threshold="80" type="percent"/>
</device>
<device name="/dev/shm" monitor="false">
<alarm level="red" threshold="90" type="percent"/>
<alarm level="yellow" threshold="80" type="percent"/>
</device>
<device name="/run/lock" monitor="false">
<alarm level="red" threshold="90" type="percent"/>
<alarm level="yellow" threshold="80" type="percent"/>
</device>
<device name="/sys/fs/cgroup" monitor="false">
<alarm level="red" threshold="90" type="percent"/>
<alarm level="yellow" threshold="80" type="percent"/>
</device>
</TotalUsage>
<Bandwidth>
<device name="vda" monitor="true"/>
<device name="vda1" monitor="false"/>
<device name="vda15" monitor="false"/>
</Bandwidth>
</Hdd>
<Ram>
<TotalUsage>
<alarm level="red" threshold="95" type="percent"/>
<alarm level="yellow" threshold="90" type="percent"/>
</TotalUsage>
<SwapUsage>
<alarm level="red" threshold="90" type="percent"/>
<alarm level="yellow" threshold="80" type="percent"/>
</SwapUsage>
<SwapInOut/>
</Ram>
<Cpu>
<TotalUsage>
<alarm level="red" threshold="2" type="percent"/>
<alarm level="yellow" threshold="50" type="percent"/>
</TotalUsage>
<Queue period="shortterm"/>
<Processes/>
</Cpu>
<Network>
<Bandwidth>
<device name="eth0" monitor="true"/>
<device name="eth1" monitor="true"/>
<device name="lo" monitor="false"/>
</Bandwidth>
</Network>
<Services>
<CpuTime>
<service name="Web" monitor="true">
<alarm level="red" threshold="25" type="percent"/>
<alarm level="yellow" threshold="20" type="percent"/>
</service>
<service name="WebProxy" monitor="true">
<alarm level="red" threshold="25" type="percent"/>
<alarm level="yellow" threshold="20" type="percent"/>
</service>
<service name="Mail" monitor="true">
<alarm level="red" threshold="25" type="percent"/>
<alarm level="yellow" threshold="20" type="percent"/>
</service>
<service name="MySql" monitor="true">
<alarm level="red" threshold="25" type="percent"/>
<alarm level="yellow" threshold="20" type="percent"/>
</service>
<service name="Panel" monitor="true">
<alarm level="red" threshold="25" type="percent"/>
<alarm level="yellow" threshold="20" type="percent"/>
</service>
</CpuTime>
<MemoryUsage>
<service name="Web" monitor="true">
<alarm level="red" threshold="25" type="percent"/>
<alarm level="yellow" threshold="20" type="percent"/>
</service>
<service name="WebProxy" monitor="true">
<alarm level="red" threshold="25" type="percent"/>
<alarm level="yellow" threshold="20" type="percent"/>
</service>
<service name="Mail" monitor="true">
<alarm level="red" threshold="25" type="percent"/>
<alarm level="yellow" threshold="20" type="percent"/>
</service>
<service name="MySql" monitor="true">
<alarm level="red" threshold="25" type="percent"/>
<alarm level="yellow" threshold="20" type="percent"/>
</service>
<service name="Panel" monitor="true">
<alarm level="red" threshold="25" type="percent"/>
<alarm level="yellow" threshold="20" type="percent"/>
</service>
</MemoryUsage>
</Services>
</configdata>
 
I finally received a couple of alert emails at 5:23 and 5:33 this morning. I hadn't changed anything since a couple of days ago...

Shouldn't the emails be sent when the alert triggers?
 
Back
Top