• 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

downtime notification

qualispace

Regular Pleskian
Hello,
I wish to receive notifications by email if a particular service in the server is stopped. Can anybody tell me how to set up the notification?

Regards
Nitesh
 
I'm lazy and use 4PSA's Server Assistant.

It detects if a service is down and restarts it while sending the admin an email.

You can monitor various services including spam assassin in the latest SA release.

regards,
poke
 
Here is a sample of my conf.sim (FC2), also you have to disable EWS because this is for ensim only. If you want to make it fit for Plesk you must make some changes, look below for my examples.

/usr/local/sim
----------------------------------------------------------
# Some global options related to service monitoring

RST="true" # enabled auto-restart of downed services
LAXCHK="true" # set laxed or strict service checks
DISRST="10" # disable autorestart after N events
# event stats are cleared daily
INIT_ARG="restart" # argument to pass to init scripts when service is down

# This section is to enable or disable our Service checks
# The values are either a true/false statment (true=enable, false=disable)
# Service checks by default are disabled

SERV_FTP="false" # FTP Service
SERV_HTTP="true" # HTTP Service
SERV_DNS="true" # DNS Service
SERV_SSH="true" # SSH Service
SERV_MYSQL="false" # MySQL Service
SERV_PGSQL="true" # PGSQL Service
SERV_EWP="true" # Ensim Service
SERV_XINET="true" # XINET Sevice
SERV_SMTP="true" # SMTP Service

# The below values are used to check against the processes list
# and make sure the given service is running

FTP_NAME="proftpd" # name of the FTP service as appears in 'ps'
HTTP_NAME="httpd" # name of HTTP service as appears in 'ps'
DNS_NAME="named" # name of DNS service as appears in 'ps'
SSH_NAME="sshd" # name of SSH service as appears in 'ps'
MYSQL_NAME="mysqld" # name of MySQL service as appears in 'ps'
PGSQL_NAME="postmaster" # name of PGSQL service as appears in 'ps'
EWP_NAME="httpsd" # name of Ensim service as appears in 'ps'
XINET_NAME="couriertcpd" # name of XINET service as appears in 'ps'
SMTP_NAME="qmail-send" # name of SMTP service as appears in 'ps'

# The below values are used to check against the netstat output
# and make sure the given service is operating on the said port

FTP_PORT="21" # TCP/IP port for FTP
HTTP_PORT="80" # TCP/IP port for HTTP
DNS_PORT="53" # TCP/IP port for DNS
SSH_PORT="22" # TCP/IP port for SSH
MYSQL_PORT="3306" # TCP/IP port for MySQL
EWP_PORT="8443" # TCP/IP port for Ensim
XINET_PORT="110" # TCP/IP port for an XINET service
SMTP_PORT="25" # TCP/IP port for SMTP service

# The init paths are what is used to restart a given service
# ("start" is passed to the given init script)

FTP_INIT="/etc/init.d/proftpd" # path to FTP service init script
HTTP_INIT="/etc/init.d/httpd" # path to HTTP service init script
DNS_INIT="/etc/init.d/named" # path to DNS service init script
SSH_INIT="/etc/init.d/sshd" # path to SSH service init script
MYSQL_INIT="/etc/init.d/mysqld" # path to MySQL service init script
PGSQL_INIT="/etc/init.d/postgresql" # path to PGSQL service init script
EWP_INIT="/etc/init.d/psa" # path to Ensim service init script
XINET_INIT="/etc/init.d/courier-imap" # path to XINET service init script
SMTP_INIT="/etc/init.d/qmail" # path to SMTP service init script

---------------------------------------------------------------
Changes if you want to use Plesk monitoring:

In /usr/local/sim/internals/chk/serv/ewp.chk

Disable these lines:

# BWM=`cat $PS_CACHE | grep -iw bandwidth_manager` >> /dev/null 2>&1
#
# if [ "$BWM" == "" ]; then
# echo "$PREFIX Ensim bandwidth manager is offline - restarting" >> $SIMLOG
# BWM="true"
# fi##
#
# if [ "BWM" == "true" ]; then
# BW_INIT="/etc/init.d/bandwidth_manager"
# $BW_INIT stop >> /dev/null 2>&1
# $BW_INIT start >> /dev/null 2>&1
# echo "Ensim bandwidth manager restarted." >> $SIMLOG
# NET_EWP=""
# fi
#

Also you can change in all other files the name "Ensim" to "Plesk", so warnings will not use ensim. Disable ensim bandwith monitor as shown above to prevent false alerts.

Regards,
Bart
 
Back
Top