Monitor OpenLiteSpeed with monit
To monitor OpenLiteSpeed with monit on Ubuntu Server, create file
1 |
vi /etc/monit/conf-enabled/openlitespeed |
Add following content
1 2 3 |
check process OpenLiteSpeed with pidfile /tmp/lshttpd/lshttpd.pid start program = "/usr/bin/systemctl start lshttpd" stop program = "/usr/bin/systemctl stop lshttpd" |
Reload monit with
1 |
monit reload |
Now monit will monitor OpenLiteSpeed, restart if required. You can check status with
1 |
monit status |
If you want to monitor if web server is responding to request, you can use
1 2 3 4 |
check process OpenLiteSpeed with pidfile /tmp/lshttpd/lshttpd.pid start program = "/usr/bin/systemctl start lshttpd" stop program = "/usr/bin/systemctl stop lshttpd" if failed host localhost port 80 protocol http then restart |