name: check_httpd
version: 1.0.0
initial_state: unknown

watchers:
  # check httpd every  minute
  - name: check
    type: nagios
    interval: 1m
    properties:
      plugin: /usr/lib64/nagios/plugins/check_procs
      args:
        - "-C"
        - "httpd"
        - "-c"
        - "1:25"

  # if its critical we remediate using a restart
  # if it stays critical for 10 minutes we will try
  # again to remediate etc
  - name: remediate
    type: exec
    state_match: [critical]
    interval: 10m
    properties:
      command: /sbin/service httpd restart
     
# boilerplate all the nagios ones will look like this
# however one can add things like a maintenance mode that
# disables checks etc
transitions:
  - name: UNKNOWN
    from: [unknown, ok, warning, critical]
    destination: unknown

  - name: OK
    from: [unknown, ok, warning, critical]
    destination: ok

  - name: WARNING
    from: [unknown, ok, warning, critical]
    destination: warning

  - name: CRITICAL
    from: [unknown, ok, warning, critical]
    destination: critical