Skip to content

Instantly share code, notes, and snippets.

@fahimbabarpatel
Last active October 29, 2015 06:57
Show Gist options
  • Save fahimbabarpatel/412b62f9c5f659b5057d to your computer and use it in GitHub Desktop.
Save fahimbabarpatel/412b62f9c5f659b5057d to your computer and use it in GitHub Desktop.

sudo nano /etc/.monit.conf for For RHEL

sudo nano /etc/monit/monitrc For Dabian


 set httpd port 2812 and
     allow admin:monit      # require user 'admin' with password 'monit'
     allow @monit           # allow users of group 'monit' to connect (rw)
     allow @users readonly  # allow users of group 'users' to connect readonly
`````````````````````````````````````````````````````````````````````
### Below example for nginx and mongodb.Add then in last of file.

Below hooks for **nginx**
````````````````````````````````````````````````
check process nginx_web_server with pidfile /var/run/nginx.pid
start program = "/etc/init.d/nginx start"
stop program = "/etc/init.d/nginx stop"
````````````````````````````````````````````````


Below hooks for **mongodb**
```````````````````````````````````````````
check process mongodb with pidfile /var/lib/mongo/mongod.lock 
start program = "/etc/init.d/mongod start"
stop program = "/etc/init.d/mongod stop" 
if failed host 127.0.0.1 port 27017 then restart 
if 5 restart within 5 cycles then timeout
``````````````````````````````````
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment