title: Checking the status of my PHP beanstalkd background processes
body: <p>I have a website written in PHP (CakePHP) where certain resource intensive tasks are handled by a background process. This is done through the Beanstalkd message queue. I need some way to retrieve the status of that background process so I can monitor it with Monit.</p>
  
  <p>The background process is a CakePHP Shell (just a PHP CLI script) that communicates with Beanstalkd. It simply does a reserve() on Benastalkd and waits for a new message. When it gets a message, it processes it. I want some way of monitoring this process with <a href="http://mmonit.com/monit/" rel="nofollow noreferrer">Monit</a> so that it can restart the background process if something has gone wrong.</p>
  
  <p>What I have been thinking about so far is writing a PHP CLI script that drops a message in Beanstalkd. The background process picks up the message and somehow communicates it's internal status back to the CLI script. But how? Sockets? Shared memory? Some other IPC method?</p>
  
  <p>Or am I perhaps being too complicated here and is there a much easier way to monitor such a process with Monit?</p>
  
  <p>Thanks in advance!</p>