Skip to content

Commit 8c2ad77

Browse files
author
Tom Throckmorton
committed
add support for protocols plugin
1 parent 27c81f6 commit 8c2ad77

File tree

3 files changed

+50
-1
lines changed

3 files changed

+50
-1
lines changed

README.md

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@ documentation for each plugin for configurable attributes.
9090
* `ping` (see [collectd::plugin::ping](#class-collectdpluginping) below)
9191
* `postgresql` (see [collectd::plugin::postgresql](#class-collectdpluginpostgresql) below)
9292
* `processes` (see [collectd::plugin:processes](#class-collectdpluginprocesses) below)
93+
* `protocols` (see [collectd::plugin:protocols](#class-collectdpluginprotocols) below)
9394
* `python` (see [collectd::plugin::python](#class-collectdpluginpython) below)
9495
* `redis` (see [collectd::plugin::redis](#class-collectdpluginredis) below)
9596
* `rrdcached` (see [collectd::plugin::rrdcached](#class-collectdpluginrrdcached) below)
@@ -647,6 +648,19 @@ class { 'collectd::plugin::processes':
647648
],
648649
}
649650
```
651+
####Class: `collectd::plugin::protocols`
652+
653+
* `values` is an array of `Protocol` names, `Protocol:ValueName` pairs, or a regex
654+
* see `/proc/net/netstat` and `/proc/net/snmp` for a list of `Protocol` targets
655+
656+
See [collectd.conf documentation] (https://collectd.org/documentation/manpages/collectd.conf.5.shtml#plugin_protocols) for details
657+
658+
```puppet
659+
class { 'collectd::plugin::protocols':
660+
values => ['/^Tcp:*/', '/^Udp:*/', 'Icmp:InErrors' ],
661+
ignoreselected => false,
662+
}
663+
```
650664

651665
####Class: `collectd::plugin::python`
652666

@@ -977,4 +991,4 @@ This module shall not use unsupported configuration directives. Look at [templat
977991

978992
Please make use of the search by branch/tags on the collectd github to see when a function has been first released.
979993

980-
Reading the [collectd.conf.pod](https://github.com/collectd/collectd/blob/master/src/collectd.conf.pod) file is good, validating the presence of the code in the .c files is even better.
994+
Reading the [collectd.conf.pod](https://github.com/collectd/collectd/blob/master/src/collectd.conf.pod) file is good, validating the presence of the code in the .c files is even better.

manifests/plugin/protocols.pp

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# See http://collectd.org/documentation/manpages/collectd.conf.5.shtml#plugin_protocols
2+
class collectd::plugin::protocols (
3+
$ensure = present,
4+
$ignoreselected = false,
5+
$values = []
6+
) {
7+
8+
validate_array(
9+
$values,
10+
)
11+
validate_bool(
12+
$ignoreselected,
13+
)
14+
15+
collectd::plugin {'protocols':
16+
ensure => $ensure,
17+
content => template('collectd/plugin/protocols.conf.erb'),
18+
}
19+
}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<% if @values -%>
2+
<Plugin "protocols">
3+
<%
4+
if @values
5+
@values.each do |value|
6+
-%>
7+
Value "<%= value %>"
8+
<%
9+
end
10+
end
11+
-%>
12+
<% if @ignore_selected != nil -%>
13+
IgnoreSelected <%= @ignore_selected %>
14+
<% end -%>
15+
</Plugin>
16+
<% end -%>

0 commit comments

Comments
 (0)