[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
This commit is contained in:
parent
57d1fb9651
commit
395d42d4c4
@ -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
|
Developers can quickly add new monitoring plugins (along with tests) without
|
||||||
worrying about how to format the data.
|
worrying about how to format the data.
|
||||||
|
|
||||||
Documentation sections
|
Overview
|
||||||
----------------------
|
--------
|
||||||
|
|
||||||
.. toctree::
|
.. toctree::
|
||||||
:maxdepth: 2
|
:maxdepth: 2
|
||||||
@ -17,3 +17,12 @@ Documentation sections
|
|||||||
configure
|
configure
|
||||||
usage
|
usage
|
||||||
develop
|
develop
|
||||||
|
|
||||||
|
Plugins
|
||||||
|
-------
|
||||||
|
|
||||||
|
.. toctree::
|
||||||
|
:maxdepth: 1
|
||||||
|
:glob:
|
||||||
|
|
||||||
|
plugin-*
|
||||||
|
60
doc/source/plugin-process.rst
Normal file
60
doc/source/plugin-process.rst
Normal file
@ -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"
|
||||||
|
}
|
35
doc/source/plugin-uptime.rst
Normal file
35
doc/source/plugin-uptime.rst
Normal file
@ -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"
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user