Skip to content

Commit

Permalink
Merge pull request #775 from juniorsysadmin/datatypes-network
Browse files Browse the repository at this point in the history
collectd::plugin::network - Add data types
  • Loading branch information
juniorsysadmin committed Apr 4, 2018
2 parents 4e05304 + 96b0705 commit 3e19fed
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 21 deletions.
12 changes: 6 additions & 6 deletions manifests/plugin/network.pp
@@ -1,13 +1,13 @@
# https://collectd.org/wiki/index.php/Plugin:Network
class collectd::plugin::network (
$ensure = 'present',
Enum['present', 'absent'] $ensure = 'present',
Optional[Pattern[/[0-9]+/]] $timetolive = undef,
Optional[Pattern[/[0-9]+/]] $maxpacketsize = undef,
$forward = undef,
$interval = undef,
$reportstats = undef,
$listeners = { },
$servers = { },
Optional[Boolean] $forward = undef,
Optional[Integer[1]] $interval = undef,
Optional[Boolean] $reportstats = undef,
Hash $listeners = {},
Hash $servers = {},
) {

include ::collectd
Expand Down
10 changes: 5 additions & 5 deletions manifests/plugin/network/listener.pp
@@ -1,10 +1,10 @@
#
define collectd::plugin::network::listener (
$ensure = 'present',
$authfile = undef,
$port = undef,
$securitylevel = undef,
$interface = undef,
Enum['present', 'absent'] $ensure = 'present',
Optional[Stdlib::Absolutepath] $authfile = undef,
Optional[Integer] $port = undef,
Optional[Collectd::Network::SecurityLevel] $securitylevel = undef,
Optional[String] $interface = undef,
) {

include ::collectd
Expand Down
16 changes: 8 additions & 8 deletions manifests/plugin/network/server.pp
@@ -1,13 +1,13 @@
#
define collectd::plugin::network::server (
$ensure = 'present',
$username = undef,
$password = undef,
$port = undef,
$securitylevel = undef,
$interface = undef,
$forward = undef,
$resolveinterval = undef,
Enum['present', 'absent'] $ensure = 'present',
Optional[String] $username = undef,
Optional[String] $password = undef,
Optional[Integer] $port = undef,
Optional[Collectd::Network::SecurityLevel] $securitylevel = undef,
Optional[String] $interface = undef,
Optional[Boolean] $forward = undef,
Optional[Integer[1]] $resolveinterval = undef,
) {

include ::collectd
Expand Down
2 changes: 1 addition & 1 deletion spec/defines/collectd_plugin_network_listener_spec.rb
Expand Up @@ -12,7 +12,7 @@
let(:title) { 'mylistener' }
let :params do
{
port: '1234'
port: 1234
}
end

Expand Down
2 changes: 1 addition & 1 deletion spec/defines/collectd_plugin_network_server_spec.rb
Expand Up @@ -12,7 +12,7 @@
let(:title) { 'node1' }
let :params do
{
port: '1234',
port: 1234,
interface: 'eth0',
securitylevel: 'Encrypt',
username: 'foo',
Expand Down
2 changes: 2 additions & 0 deletions types/network/securitylevel.pp
@@ -0,0 +1,2 @@
#
type Collectd::Network::SecurityLevel = Enum['Encrypt', 'Sign', 'None']

0 comments on commit 3e19fed

Please sign in to comment.