Github Mirror / telegraf-plugins: 3a758fae




Tidy up

Tidy up

Commit 3a758fae.

Authored 2022-03-13T13:41:02.000+00:00 by B Tasker in project Github Mirror / telegraf-plugins

+38 lines -4 lines

Commit Signature

Changes

diff --git a/i2pd-statistics/README.md b/i2pd-statistics/README.md
--- a/i2pd-statistics/README.md
+++ b/i2pd-statistics/README.md
# @@ -5,6 +5,7 @@ This is an exec based plugin for Telegraf designed to monitor an [i2pd](https://
# My website is now [available as an eepsite](https://www.bentasker.co.uk/posts/blog/privacy/bentaskercouk-now-available-on-i2p.html) and I wanted to be able to monitor the daemon.
#
#
# +----
#
# ### Dependencies
#
# @@ -43,6 +44,38 @@ Stats extraction, then, is inavoidably reliant on screen scraping - so if the wa
#
# The plugin is also not currently coded particularly defensively - I wanted to get stats collection up and running quickly (so I could move onto building dashboards), with an aim to refactoring later (it also needs some DRY work).
#
# +----
# +
# +### Statistics Collected
# +
# +**Tags**
# +
# +* `url`: The URL used to reach the webconsole (basically, the value of `I2PD_CONSOLE`
# +* `version`: The reported version of `i2pd`
# +* `network_status`: The reported status of i2pd (values [here](https://github.com/PurpleI2P/i2pd/blob/openssl/daemon/HTTPServer.cpp#L223))
# +* * `network_status_v6`: The reported status of i2pd for IPv6 (values [here](https://github.com/PurpleI2P/i2pd/blob/openssl/daemon/HTTPServer.cpp#L223))
# +* `statspage_status`: The status of the page at `url`, one of `available`,`unavailable`
# +
# +
# +**Fields**
# +
# +* `uptime`: the uptime reported by the daemon, in seconds
# +* `tunnel_creation_success_rate`: the percentage success rate of tunnel creation
# +* `in_bytes` / `out_bytes`: the number of bytes received/sent
# +* `in_avg_bps` / `out_avg_bps`: the average bitrate in/out
# +* `transit_bytes`: the number of bytes sent out for transit tunnels
# +* `transit_avg_bps`: the average transmit rate for transit tunnels
# +* `routers`: Number of routers
# +* `floodfills`: Number of floodfills
# +* `leasesets`: Number of LeaseSets
# +* `clienttunnels`: Number of client tunnels
# +* `transittunnels`: Number of Transit tunnels
# +* `inbound_tunnel_count` / `outbound_tunnel_count`: Total number of tunnels
# +* `inbound_tunnel_expiring` / `outbound_tunnel_expiring`: Total number of tunnels currently in an expiring state
# +* `inbound_tunnel_established` / `outbound_tunnel_established`: Total number of tunnels currently in an established state
# +* `inbound_tunnel_exploratory` / `outbound_tunnel_exploratory`: Total number of tunnels currently in an established but exploratory state
# +* `inbound_tunnel_building` / `outbound_tunnel_building`: Total number of tunnels currently building
# +* `inbound_tunnel_failed` / `outbound_tunnel_failed`: Total number of tunnels currently in an failed state
#
# ### Example Line Protocol
#
#
diff --git a/i2pd-statistics/i2pd-statistics.py b/i2pd-statistics/i2pd-statistics.py
--- a/i2pd-statistics/i2pd-statistics.py
+++ b/i2pd-statistics/i2pd-statistics.py
# @@ -154,7 +154,7 @@ except:
# )
#
# lp = "{measurement},{tags} failed=1".format(
# - measurement = I2PD_MEASUREMENT,
# + measurement = MEASUREMENT,
# tags = tags
# )
# print(lp)
# @@ -291,15 +291,16 @@ fields = "{fields},outbound_tunnel_count={outbound_tunnels}i,outbound_tunnels_ex
# outbound_tunnels_failed = outbound['failed']
# )
#
# -tags = "url={url},version={version},network_status={network_status},network_status_v6={network_status_v6}".format(
# +tags = "url={url},version={version},network_status={network_status},network_status_v6={network_status_v6},statspage_status={stats_status}".format(
# url = HOST,
# version = version,
# network_status = network_status,
# - network_status_v6 = network_status_v6
# + network_status_v6 = network_status_v6,
# + stats_status = stats_status
# )
#
# lp = "{measurement},{tags} {fields}".format(
# - measurement = I2PD_MEASUREMENT,
# + measurement = MEASUREMENT,
# tags = tags,
# fields = fields
# )
#