How to configure service restarts monitoring on a Debian-based container

Created:

2017-04-20 16:16:02 UTC

Modified:

2017-08-08 13:45:38 UTC

0

Was this article helpful?


Have more questions?

Submit a request

How to configure service restarts monitoring on a Debian-based container

Applicable to:

  • Plesk for Linux

Question

How to configure service restarts monitoring on a Debian-based container?

Answer

Inotify tools can be used to monitor, for example, PHP-FPM service:

1. Install the package:

# apt-get install inotify-tools

2. create a log file:

# touch /root/inotify.log

3. start monitoring in background:

# inotifywait -m -q /etc/init.d/plesk-php70-fpm -e open  | while read file event; do ps auxf; echo "$file , $event"; done | tee ~/notify.plesk-php70-fpm.log > inotify.log &

4. Configure the monitoring autostart after server reboot by adding the following lines to /etc/rc.local :

inotifywait -m -q /etc/init.d/plesk-php70-fpm -e open  | while read file event; do ps auxf; echo "$file , $event"; done | tee ~/notify.plesk-php70-fpm.log > inotify.log &

exit 0

Have more questions? Submit a request
Please sign in to leave a comment.