Skip to content

Commit 5f440b0

Browse files
committed
update README
1 parent 8197007 commit 5f440b0

File tree

1 file changed

+27
-13
lines changed

1 file changed

+27
-13
lines changed

README.md

Lines changed: 27 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5,60 +5,74 @@
55
[![NuGet Smdn.Net.MuninNode](https://img.shields.io/nuget/v/Smdn.Net.MuninNode.svg)](https://www.nuget.org/packages/Smdn.Net.MuninNode/)
66

77
# Smdn.Net.MuninNode
8+
[![NuGet Smdn.Net.MuninNode](https://img.shields.io/nuget/v/Smdn.Net.MuninNode.svg)](https://www.nuget.org/packages/Smdn.Net.MuninNode/)
9+
810
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).
911

1012
This library provides Munin-Node implementation for .NET, which enables to you to create custom Munin-Node using the .NET languages and libraries.
1113

1214
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.
1315

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.
1520

21+
### `Smdn.Net.MuninPlugin` namespace
1622
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.
1723

24+
# Smdn.Net.MuninNode.Hosting
25+
[![NuGet Smdn.Net.MuninNode.Hosting](https://img.shields.io/nuget/v/Smdn.Net.MuninNode.Hosting.svg)](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.
1830

19-
## Usage
31+
# Usage
2032
To use the released packge, add `<PackageReference>` to the project file.
2133

2234
```xml
2335
<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.*" />
2539
</ItemGroup>
2640
```
2741

2842
Then write the your code. See [examples](examples/) to use APIs.
2943

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:
3246

3347
```conf
3448
[your-node.localdomain]
3549
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
3852
```
3953

4054
Multiple instances can also be started by defining multiple nodes with different port numbers if you want.
4155

4256
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).
4357

4458

45-
### Testing node
59+
### Test the node
4660
To test the node you have created, run the node first, and connect to the node.
4761

4862
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.
4963

5064
```
51-
$ telnet 127.0.0.1 9876
65+
$ telnet 127.0.0.1 4949
5266
Trying 127.0.0.1...
5367
Connected to localhost.
5468
Escape character is '^]'.
5569
# munin node at your-node.localhost
56-
list <-- type 'list' to list field names
70+
list <-- type `list` to list plugin names
5771
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
6074
uptime.value 123.4567
61-
quit <-- type 'quit' to close connection
75+
quit <-- type `quit` to close connection
6276
Connection closed by foreign host.
6377
```
6478

0 commit comments

Comments
 (0)