From 395d42d4c4c5d170e45c803b42d1de201db85987 Mon Sep 17 00:00:00 2001 From: Major Hayden Date: Mon, 10 Apr 2017 09:16:07 -0500 Subject: [PATCH] [Docs] Uptime + process plugins This patch adds a basic structure for plugin docs and provides docs for the uptime and process plugins. Change-Id: Id98e0ed8cd7ba29968ad16a0ce90ababe74498ea --- doc/source/index.rst | 13 ++++++-- doc/source/plugin-process.rst | 60 +++++++++++++++++++++++++++++++++++ doc/source/plugin-uptime.rst | 35 ++++++++++++++++++++ 3 files changed, 106 insertions(+), 2 deletions(-) create mode 100644 doc/source/plugin-process.rst create mode 100644 doc/source/plugin-uptime.rst diff --git a/doc/source/index.rst b/doc/source/index.rst index 8e066af..6c2e119 100644 --- a/doc/source/index.rst +++ b/doc/source/index.rst @@ -7,8 +7,8 @@ that output data in various formats for different monitoring systems. Developers can quickly add new monitoring plugins (along with tests) without worrying about how to format the data. -Documentation sections ----------------------- +Overview +-------- .. toctree:: :maxdepth: 2 @@ -17,3 +17,12 @@ Documentation sections configure usage develop + +Plugins +------- + +.. toctree:: + :maxdepth: 1 + :glob: + + plugin-* diff --git a/doc/source/plugin-process.rst b/doc/source/plugin-process.rst new file mode 100644 index 0000000..dcd8826 --- /dev/null +++ b/doc/source/plugin-process.rst @@ -0,0 +1,60 @@ +``process`` - monitor a running process +======================================= + +The ``process`` plugin searches the list of running processes and checks +whether a particular process is running. + +Usage +----- + +The plugin takes only one argument: the name of the process to check. See the +examples below for more details. + +Example +------- + +In this example, the plugin searches the process list for the ``chronyd`` +process: + +.. code-block:: console + + $ monitorstack process chronyd + +The default JSON output shows that the process was found: + +.. code-block:: json + + { + "variables": { + "chronyd": 1 + }, + "message": "process check is ok", + "meta": { + "platform": "Linux" + }, + "exit_code": 0, + "measurement_name": "process" + } + +Here's another example where the plugin searches for ``nginx``. That process is +not running on this server: + +.. code-block:: console + + $ monitorstack process nginx + +This time, the process is not found: + +.. code-block:: json + + { + "variables": { + "nginx": 0 + }, + "message": "process failed -- Process nginx not found", + "meta": { + "platform": "Linux-4.10.8-200.fc25.x86_64-x86_64-with-fedora-25-Twenty_Five" + }, + "exit_code": 1, + "measurement_name": "process" + } diff --git a/doc/source/plugin-uptime.rst b/doc/source/plugin-uptime.rst new file mode 100644 index 0000000..03fb9cb --- /dev/null +++ b/doc/source/plugin-uptime.rst @@ -0,0 +1,35 @@ +``uptime`` - get system uptime +============================== + +The uptime plugin returns the number of seconds since the server was powered +on. + +Usage +----- + +This plugin takes no arguments. + +Example +------- + +Run the plugin: + +.. code-block:: console + + $ monitorstack uptime + +Example output in JSON format: + +.. code-block:: json + + { + "variables": { + "uptime": "18570.18" + }, + "message": "uptime is ok", + "meta": { + "platform": "Linux-4.10.8-200.fc25.x86_64-x86_64-with-fedora-25-Twenty_Five" + }, + "exit_code": 0, + "measurement_name": "system_uptime" + }