Skip to content

Instantly share code, notes, and snippets.

@eclecticmiraclecat
Created February 13, 2018 12:36
Show Gist options
  • Save eclecticmiraclecat/529d0ca25b1f982408505d9c106ffad2 to your computer and use it in GitHub Desktop.
Save eclecticmiraclecat/529d0ca25b1f982408505d9c106ffad2 to your computer and use it in GitHub Desktop.
monit script to check number of apache processes
check program apache2 with path "/bin/bash -c '[ $(/bin/ps auxwww | /bin/grep apache | /bin/grep -v grep | /usr/bin/wc -l) -gt 2 ]'"
start program = "/etc/init.d/apache2 start"
stop program = "/etc/init.d/apache2 stop"
restart program = "/etc/init.d/apache2 restart"
if status != 0 then restart
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment