Skip to content

Instantly share code, notes, and snippets.

@ripienaar
Created June 19, 2020 19:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ripienaar/d0bb66fa1af5558b19fcaec9ed8d8308 to your computer and use it in GitHub Desktop.
Save ripienaar/d0bb66fa1af5558b19fcaec9ed8d8308 to your computer and use it in GitHub Desktop.
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment