|
5 | 5 | [](https://www.nuget.org/packages/Smdn.Net.MuninNode/)
|
6 | 6 |
|
7 | 7 | # Smdn.Net.MuninNode
|
| 8 | +[](https://www.nuget.org/packages/Smdn.Net.MuninNode/) |
| 9 | + |
8 | 10 | Smdn.Net.MuninNode is a .NET implementation of [Munin-Node](https://guide.munin-monitoring.org/en/latest/node/index.html) and [Munin-Plugin](https://guide.munin-monitoring.org/en/latest/plugin/index.html).
|
9 | 11 |
|
10 | 12 | This library provides Munin-Node implementation for .NET, which enables to you to create custom Munin-Node using the .NET languages and libraries.
|
11 | 13 |
|
12 | 14 | This library also provides abstraction APIs for implementing Munin-Plugin. By using Munin-Plugin APIs in combination with the Munin-Node implementation, you can implement the function of collecting various kind of telemetry data using Munin, with .NET.
|
13 | 15 |
|
14 |
| -This library has two major namespaces. In the [Smdn.Net.MuninNode](./src/Smdn.Net.MuninNode/Smdn.Net.MuninNode/) namespace, there is a `NodeBase` class, which provides abstract Munin-Node implementation. For most purposes, the `LocalNode` class can be used, such as creating a Munin-Node that runs on the same host as the Munin server. |
| 16 | +### `Smdn.Net.MuninNode` namespace |
| 17 | +This library has two major namespaces. In the [Smdn.Net.MuninNode](./src/Smdn.Net.MuninNode/Smdn.Net.MuninNode/) namespace, there is a `NodeBase` class, which provides abstract Munin-Node implementation. |
| 18 | + |
| 19 | +You can use the extension methods from [Smdn.Net.MuninNode.DependencyInjection](./src/Smdn.Net.MuninNode/Smdn.Net.MuninNode.DependencyInjection/) namespace to configure and register the Munin-Node to the `ServiceCollection`. This would support most purposes and use cases. See [this example](./examples/Smdn.Net.MuninNode/getting-started/) for detail. |
15 | 20 |
|
| 21 | +### `Smdn.Net.MuninPlugin` namespace |
16 | 22 | In the [Smdn.Net.MuninPlugin](./src/Smdn.Net.MuninNode/Smdn.Net.MuninPlugin/) namespace, there is a `IPlugin` interfaces, which represents the functionality that should be implemented as Munin-Plugin. By properly implementing `IPlugin` and its relevant interfaces, you can compose the Munin-Plugin which aggregates telemetry data using .NET.
|
17 | 23 |
|
| 24 | +# Smdn.Net.MuninNode.Hosting |
| 25 | +[](https://www.nuget.org/packages/Smdn.Net.MuninNode.Hosting/) |
| 26 | + |
| 27 | +This library provides APIs to run Munin-Node as a background service integrated with .NET Generic Host. |
| 28 | + |
| 29 | +If you want to integrate with .NET Generic Host, especially if you want to implement Munin-Node running as a **Windows Services** or **systemd unit**, you can use this extension library. See [this example](./examples/Smdn.Net.MuninNode.Hosting/getting-started/) for detail. |
18 | 30 |
|
19 |
| -## Usage |
| 31 | +# Usage |
20 | 32 | To use the released packge, add `<PackageReference>` to the project file.
|
21 | 33 |
|
22 | 34 | ```xml
|
23 | 35 | <ItemGroup>
|
24 |
| - <PackageReference Include="Smdn.Net.MuninNode" Version="1.*" /> |
| 36 | + <PackageReference Include="Smdn.Net.MuninNode" Version="2.*" /> |
| 37 | + <!-- Or --> |
| 38 | + <PackageReference Include="Smdn.Net.MuninNode.Hosting" Version="3.*" /> |
25 | 39 | </ItemGroup>
|
26 | 40 | ```
|
27 | 41 |
|
28 | 42 | Then write the your code. See [examples](examples/) to use APIs.
|
29 | 43 |
|
30 |
| -### Munin configurations (`munin.conf`) |
31 |
| -If you want `munin-update` to gather the telemetry data from the Munin-Node you have created and started, you have to add entry defines your node to configuration file `/etc/munin/munin.conf`. The following is an example: |
| 44 | +### Configure Munin master (`munin.conf`) |
| 45 | +If you want `munin-update` process to gather the telemetry data from the Munin-Node you have created and started, you have to add entry defines your node to configuration file `/etc/munin/munin.conf`. The following is an example: |
32 | 46 |
|
33 | 47 | ```conf
|
34 | 48 | [your-node.localdomain]
|
35 | 49 | address 127.0.0.1 # address of your node
|
36 |
| - port 44693 # port number that your node uses |
37 |
| - use_node_name yes # let Munin to use the node name advertised by your node (optional) |
| 50 | + port 4949 # port number that your node uses |
| 51 | + use_node_name yes # (optional) let Munin to use the node name advertised by your node |
38 | 52 | ```
|
39 | 53 |
|
40 | 54 | Multiple instances can also be started by defining multiple nodes with different port numbers if you want.
|
41 | 55 |
|
42 | 56 | For more information about node definitions, please refer to the [Munin documentation for munin.conf](https://guide.munin-monitoring.org/en/latest/reference/munin.conf.html).
|
43 | 57 |
|
44 | 58 |
|
45 |
| -### Testing node |
| 59 | +### Test the node |
46 | 60 | To test the node you have created, run the node first, and connect to the node.
|
47 | 61 |
|
48 | 62 | The following is an example of testing a node using the `telnet` command. Here, the port number should be the one your node is using.
|
49 | 63 |
|
50 | 64 | ```
|
51 |
| -$ telnet 127.0.0.1 9876 |
| 65 | +$ telnet 127.0.0.1 4949 |
52 | 66 | Trying 127.0.0.1...
|
53 | 67 | Connected to localhost.
|
54 | 68 | Escape character is '^]'.
|
55 | 69 | # munin node at your-node.localhost
|
56 |
| -list <-- type 'list' to list field names |
| 70 | +list <-- type `list` to list plugin names |
57 | 71 | uptime sensor1 sensor2
|
58 |
| -fetch uptime <-- type 'fetch <field-name>' to fetch |
59 |
| - the value of the specified field |
| 72 | +fetch uptime <-- type `fetch <plugin-name>` to fetch |
| 73 | + the values of the specified plugin |
60 | 74 | uptime.value 123.4567
|
61 |
| -quit <-- type 'quit' to close connection |
| 75 | +quit <-- type `quit` to close connection |
62 | 76 | Connection closed by foreign host.
|
63 | 77 | ```
|
64 | 78 |
|
|
0 commit comments