INQ Configuration

Mike Perham edited this page Jul 8, 2015 · 11 revisions

Services

Inspeqtor can monitor services controlled by Upstart, Systemd, runit, traditional init.d or launchctl (Mac OS X).

An .inq file in /etc/inspeqtor/services.d/$NAME.inq corresponds to a service you want to monitor and the set of rules to be verified during each cycle. Note that Inspeqtor will always alert if a service's process disappears or changes PID.

You can add rules using this generic format:

check service $NAME
  if $METRIC $OP $THRESHOLD [for $COUNT cycles] then $ACTIONS

Here's an example:

check service memcached
  if memory:rss > 1200m for 4 cycles then alert
  if cpu:user > 40% for 2 cycles then restart
  • NAME must be the exact name of the service as controlled by your init system.
  • METRIC will be one of the metrics listed on the Metrics or Daemon Specific Metrics pages.
  • OP must be > or <.
  • THRESHOLD is a raw number, percent or suffixed with k, m, g, t, or p
  • COUNT means the rule won't trigger actions unless it fails multiple cycles in a row
  • ACTIONS tell Inspeqtor what to do once the rule fails. There are three available actions: alert, restart or reload.

Host

Inspeqtor reserves /etc/inspeqtor/host.inq for host-specific rules. The syntax is almost identical as with services:

check host
  if $METRIC $OP $THRESHOLD [for $COUNT cycles] then alert

Two differences versus services:

  • The metrics available to check are different (it makes sense to check swap usage, it does not make sense to check memory usage)
  • Inspeqtor cannot restart the host if a rule fails. The only action available is alert

Next: Metrics