Skip to content

Latest commit

 

History

History
89 lines (65 loc) · 2.11 KB

README.rst

File metadata and controls

89 lines (65 loc) · 2.11 KB

Monit SaltStack Formula travis-ci

This formula is made from trexglobal/monit-formula following saltstack-formulas/template-formula

Available states

Installs monit.

Installs monit.

Add initial monit configuration and also supports by service configuration.

Example:

modules:
  nginx:
    process:
      with:
        pidfile: /var/run/nginx.pid
      config:
        group: www
        start: "/etc/init.d/nginx start"
        stop: "/etc/init.d/nginx stop"
      if:
        failed: host 127.0.0.1 port 80 protocol http
        action: restart

It generates the following config:

check process nginx with pidfile /var/run/nginx.pid
  group www
  start program = "/etc/init.d/nginx start"
  stop program = "/etc/init.d/nginx stop"
  if failed host 127.0.0.1 port 80 protocol http then restart

Sometimes you may need more than one configuration block for the same name. If so you can add a custom name.

modules:
  nginx_init:
    process:
      custom:
        name: nginx
      with:
        pidfile: /var/run/nginx.pid
      config:
        group: www
        start: "/etc/init.d/nginx start"
        stop: "/etc/init.d/nginx stop"
      if:
        failed: host 127.0.0.1 port 80 protocol http
        action: restart

The result is exacly the same as the configuration shown before.

Check pillar.example for full usage.

Ensures the monit service is up and running.