Skip to content

Commit

Permalink
Split monitors into separate files
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesoff committed Mar 21, 2021
1 parent 48beed3 commit aa912f0
Show file tree
Hide file tree
Showing 29 changed files with 712 additions and 734 deletions.
738 changes: 4 additions & 734 deletions docs/monitors.rst

Large diffs are not rendered by default.

12 changes: 12 additions & 0 deletions docs/monitors/apcupsd.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
apcupsd - APC UPS status
^^^^^^^^^^^^^^^^^^^^^^^^

Uses an existing and configured ``apcupsd`` installation to check the UPS status. Any status other than ``ONLINE`` is a failure.

.. confval:: path

:type: string
:required: false
:default: none

the path to the :file:`apcaccess` binary. On Windows, defaults to :file:`C:\\apcupsd\\bin`. On other platforms, looks in ``$PATH``.
33 changes: 33 additions & 0 deletions docs/monitors/arlo_camera.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
arlo_camera - Arlo camera battery level
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Checks Arlo camera battery level is high enough.

.. confval:: username

:type: string
:required: true

Arlo username

.. confval:: password

:type: string
:required: true

Arlo password

.. confval:: device_name

:type: string
:required: true

the device to check (e.g. ``Front Camera``)

.. confval:: base_station_id

:type: integer
:required: false
:default: ``0``

the number of your base station. Only required if you have more than one. It's an array index, but figuring out which is which is an exercise left to the reader.
26 changes: 26 additions & 0 deletions docs/monitors/command.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
command - run an external command
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Run a command, and optionally verify its output. If the command exits non-zero, this monitor fails.

.. confval:: command

:type: string
:required: true

the command to run.

.. confval:: result_regexp

:type: string (regular expression)
:required: false
:default: none

if supplied, the output of the command must match else the monitor fails.

.. confval:: result_max

:type: integer
:required: false

if supplied, the output of the command is evaluated as an integer and if greater than this, the monitor fails. If the output cannot be converted to an integer, the monitor fails.
21 changes: 21 additions & 0 deletions docs/monitors/compound.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
compound - combine monitors
^^^^^^^^^^^^^^^^^^^^^^^^^^^

Combine (logical-and) multiple monitors. By default, if any monitor in the list is OK, this monitor is OK. If they all fail, this monitor fails. To change this limit use the ``min_fail`` setting.

.. warning:: Do not specify the other monitors in this monitor's ``depends`` setting. The dependency handling for compound monitors is a special case and done for you.

.. confval:: monitors

:type: comma-separated list of string
:required: true

the monitors to combine

.. confval:: min_fail

:type: integer
:required: false
:default: the number of monitors in the list

the number of monitors from the list which should be failed for this monitor to fail. The default is that all the monitors must fail.
18 changes: 18 additions & 0 deletions docs/monitors/diskspace.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
diskspace - free disk space
^^^^^^^^^^^^^^^^^^^^^^^^^^^

Checks the free space on the given partition/drive.

.. confval:: partition

:type: string
:required: true

the partition/drive to check. On Windows, give the drive letter (e.g. :file:`C:`). Otherwise, give the mountpoint (e.g. :file:`/usr`).

.. confval:: limit

:type: :ref:`bytes<config-bytes>`
:required: true

the minimum allowed amount of free space.
43 changes: 43 additions & 0 deletions docs/monitors/dns.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
dns - resolve record
^^^^^^^^^^^^^^^^^^^^

Attempts to resolve the DNS record, and optionally checks the result. Requires ``dig`` to be installed and on the PATH.

.. confval:: record

:type: string
:required: true

the DNS name to resolve

.. confval:: record_type

:type: string
:required: false
:default: ``A``

the type of record to request

.. confval:: desired_val

:type: string
:required: false

if not given, this monitor simply checks the record resolves.

Give the special value ``NXDOMAIN`` to check the record **does not** resolve.

If you need to check a multivalue response (e.g. MX records), format them like this (note the leading spaces on the continuation lines):

.. code-block:: ini
desired_val=10 a.mx.domain.com
20 b.mx.domain.com
30 c.mx.domain.com
.. confval:: server

:type: string
:required: false

the server to send the request to. If not given, uses the system default.
6 changes: 6 additions & 0 deletions docs/monitors/fail.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
.. _fail:

fail - alawys fails
^^^^^^^^^^^^^^^^^^^

This monitor fails 5 times in a row, then succeeds once. Use for testing. See the :ref:`null<null>` monitor for the inverse.
25 changes: 25 additions & 0 deletions docs/monitors/filestat.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
filestat - file size and age
^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Examines a file's size and age. If neither of the age/size values are given, simply checks the file exists.

.. confval:: filename

:type: string
:required: true

the path of the file to monitor.

.. confval:: maxage

:type: integer
:required: false

the maximum allowed age of the file in seconds. If not given, not checked.

.. confval:: minsize

:type: :ref:`bytes<config-bytes>`
:required: false

the minimum allowed size of the file in bytes. If not given, not checked.
25 changes: 25 additions & 0 deletions docs/monitors/hass_sensor.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
hass_sensor - Home Automation Sensors
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

This monitor checks for the existence of a home automation sensor.

.. confval:: url

:type: string
:required: true

API URL for the monitor

.. confval:: sensor

:type: string
:required: true

the name of the sensor

.. confval:: token

:type: string
:required: true

API token for the sensor
29 changes: 29 additions & 0 deletions docs/monitors/host.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
host - ping a host
^^^^^^^^^^^^^^^^^^

Check a host is pingable.

.. tip:: This monitor relies on executing the ``ping`` command provided by your OS. It has known issues on non-English locales on Windows. You should use the :ref:`ping<ping>` monitor instead. The only reason to use this one is that it does not require SimpleMonitor to run as root.

.. confval:: host

:type: string
:required: true

the hostname/IP to ping

.. confval:: ping_regexp

:type: regexp
:required: false
:default: automatic

the regexp which matches a successful ping. You may need to set this to use this monitor in a non-English locale.

.. confval:: time_regexp

:type: regexp
:required: false
:default: automatic

the regexp which matches the ping time in the output. Must set a match group named ``ms``. You may need to set this as above.
51 changes: 51 additions & 0 deletions docs/monitors/http.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
http - fetch and verify a URL
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Attempts to fetch a URL and makes sure the HTTP return code is (by default) 200/OK. Can also match the content of the page to a regular expression.

.. confval:: url

:type: string
:required: true

the URL to open

.. confval:: regexp

:type: regexp
:required: false
:default: none

the regexp to look for in the body of the response

.. confval:: allowed_codes

:type: comma-separated list of integer
:required: false
:default: `200`

a list of acceptable HTTP status codes

.. confval:: verify_hostname

:type: boolean
:required: false
:default: true

set to false to disable SSL hostname verification (e.g. with self-signed certificates)

.. confval:: timeout

:type: integer
:required: false
:default: ``5``

the timeout in seconds for the HTTP request to complete

.. confval:: headers

:type: JSON map as string
:required: false
:default: ``{}``

JSON map of HTTP header names and values to add to the request
20 changes: 20 additions & 0 deletions docs/monitors/loadavg.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
loadavg - load average
^^^^^^^^^^^^^^^^^^^^^^

Check the load average on the host.

.. confval:: which

:type: integer
:required: false
:default: ``1``

the load average to monitor. ``0`` = 1min, ``1`` = 5min, ``2`` = 15min

.. confval:: max

:type: float
:required: false
:default: ``1.00``

the maximum acceptable load average
11 changes: 11 additions & 0 deletions docs/monitors/memory.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
memory - free memory percent
^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Check free memory percentage.

.. confval:: percent_free

:type: int
:required: true

the minimum percent of available (as per psutils’ definition) memory
8 changes: 8 additions & 0 deletions docs/monitors/null.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
.. _null:

null - always passes
^^^^^^^^^^^^^^^^^^^^

Monitor which always passes. Use for testing. See the :ref:`fail<fail>` monitor for the inverse.

This monitor has no additional parameters.
23 changes: 23 additions & 0 deletions docs/monitors/ping.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
.. _ping:

ping - ping a host
^^^^^^^^^^^^^^^^^^

Pings a host to make sure it’s up. Uses a Python ping module instead of calling out to an external app, but needs to be run as root.

.. confval:: host

:type: string
:required: true

the hostname or IP to ping

.. confval:: timeout

:type: int
:required: false
:default: ``5``

the timeout for the ping in seconds

.. _pkgaudit:
12 changes: 12 additions & 0 deletions docs/monitors/pkgaudit.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
pkgaudit - FreeBSD pkg audit
^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Fails if ``pkg audit`` reports any vulnerable packages installed.

.. confval:: path

:type: string
:required: false
:default: :file:`/usr/local/sbin/pkg`

the path to the ``pkg`` binary
12 changes: 12 additions & 0 deletions docs/monitors/portaudit.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
portaudit - FreeBSD port audit
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Fails if ``portaudit`` reports any vulnerable ports installed.

.. confval:: path

:type: string
:required: false
:default: :file:`/usr/local/sbin/portaudit`

the path to the ``portaudit`` binary
Loading

0 comments on commit aa912f0

Please sign in to comment.