Need help finding something? Start Here

Monit: example file for HHVM monitoring

To monitor HHVM service up state under CentOS 7, create a file (typically in /etc/monit.d/ folder):

vim hhvm

and place the following (example) configuration into it:

check process hhvm with pidfile /var/run/hhvm/hhvm.pid # change the path to PID file to reflect your setup (typically in /etc/hhvm/server.ini file)
  group hhvm
  start program = "/usr/bin/systemctl start hhvm.service" 
  stop program  = "/usr/bin/systemctl stop hhvm.service"
  if failed port 9000 type TCP then restart # Your port may be different, in this example port is 9000
  if 5 restarts with 5 cycles then timeout

The configuration example needs to be adjusted for your paths and settings.

Then restart monit daemon to reload configuration:

systemctl restart monit

check monit is using the new configuraiton

monit status

It is assumed that monit service is configured, up and running.

Was this helpful?: 
5
Average: 5 (1 vote)