Browse Source

[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
Major Hayden 2 years ago
parent
commit
395d42d4c4
No account linked to committer's email address
3 changed files with 106 additions and 2 deletions
  1. 11
    2
      doc/source/index.rst
  2. 60
    0
      doc/source/plugin-process.rst
  3. 35
    0
      doc/source/plugin-uptime.rst

+ 11
- 2
doc/source/index.rst View File

@@ -7,8 +7,8 @@ that output data in various formats for different monitoring systems.
7 7
 Developers can quickly add new monitoring plugins (along with tests) without
8 8
 worrying about how to format the data.
9 9
 
10
-Documentation sections
11
-----------------------
10
+Overview
11
+--------
12 12
 
13 13
 .. toctree::
14 14
    :maxdepth: 2
@@ -17,3 +17,12 @@ Documentation sections
17 17
    configure
18 18
    usage
19 19
    develop
20
+
21
+Plugins
22
+-------
23
+
24
+.. toctree::
25
+   :maxdepth: 1
26
+   :glob:
27
+
28
+   plugin-*

+ 60
- 0
doc/source/plugin-process.rst View File

@@ -0,0 +1,60 @@
1
+``process`` - monitor a running process
2
+=======================================
3
+
4
+The ``process`` plugin searches the list of running processes and checks
5
+whether a particular process is running.
6
+
7
+Usage
8
+-----
9
+
10
+The plugin takes only one argument: the name of the process to check. See the
11
+examples below for more details.
12
+
13
+Example
14
+-------
15
+
16
+In this example, the plugin searches the process list for the ``chronyd``
17
+process:
18
+
19
+.. code-block:: console
20
+
21
+    $ monitorstack process chronyd
22
+
23
+The default JSON output shows that the process was found:
24
+
25
+.. code-block:: json
26
+
27
+    {
28
+      "variables": {
29
+        "chronyd": 1
30
+      },
31
+      "message": "process check is ok",
32
+      "meta": {
33
+        "platform": "Linux"
34
+      },
35
+      "exit_code": 0,
36
+      "measurement_name": "process"
37
+    }
38
+
39
+Here's another example where the plugin searches for ``nginx``. That process is
40
+not running on this server:
41
+
42
+.. code-block:: console
43
+
44
+    $ monitorstack process nginx
45
+
46
+This time, the process is not found:
47
+
48
+.. code-block:: json
49
+
50
+    {
51
+      "variables": {
52
+        "nginx": 0
53
+      },
54
+      "message": "process failed -- Process nginx not found",
55
+      "meta": {
56
+        "platform": "Linux-4.10.8-200.fc25.x86_64-x86_64-with-fedora-25-Twenty_Five"
57
+      },
58
+      "exit_code": 1,
59
+      "measurement_name": "process"
60
+    }

+ 35
- 0
doc/source/plugin-uptime.rst View File

@@ -0,0 +1,35 @@
1
+``uptime`` - get system uptime
2
+==============================
3
+
4
+The uptime plugin returns the number of seconds since the server was powered
5
+on.
6
+
7
+Usage
8
+-----
9
+
10
+This plugin takes no arguments.
11
+
12
+Example
13
+-------
14
+
15
+Run the plugin:
16
+
17
+.. code-block:: console
18
+
19
+    $ monitorstack uptime
20
+
21
+Example output in JSON format:
22
+
23
+.. code-block:: json
24
+
25
+    {
26
+      "variables": {
27
+        "uptime": "18570.18"
28
+      },
29
+      "message": "uptime is ok",
30
+      "meta": {
31
+        "platform": "Linux-4.10.8-200.fc25.x86_64-x86_64-with-fedora-25-Twenty_Five"
32
+      },
33
+      "exit_code": 0,
34
+      "measurement_name": "system_uptime"
35
+    }

Loading…
Cancel
Save