CustomMenu

Monit Script

.
.
.

set mailserver smtp.gmail.com port 587
    username "somename@gmail.com" password "somepasswd"
    using tlsv1
    with timeout 30 seconds
.
.
.

set httpd port 2812 and
    allow localhost  
    allow 192.168.0.0/255.255.255.0  
    allow username:password  
.
.
.

check system thenameoftheserver
    if loadavg (1min) > 4 then alert
    if loadavg (5min) > 2 then alert
    if memory usage > 75% then alert
    if swap usage > 25% then alert
    if cpu usage (user) > 70% then alert
    if cpu usage (system) > 30% then alert
    if cpu usage (wait) > 20% then alert
.
.
.

check nodeproxy
  with pidfile /var/www/nodeproxy/pids/nodeproxy.pid
  start program = "/sbin/start node-proxy"
  stop program = "/sbin/stop node-proxy"
.
.
.

check nodeprocess
  with pidfile /var/www/nodeprocess/pids/nodeprocess.pid
  start program = "/sbin/start nodeprocess"
  stop program = "/sbin/stop nodeprocess"
  if failed port 8080 protocol HTTP
       request /alive
       with timeout 10 seconds
       then restart