Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added support for the Metric 'conversion' parameter #5

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion lib/puppet/type/snmpcollector_metric.rb
Original file line number Diff line number Diff line change
Expand Up @@ -51,4 +51,10 @@
desc 'Additional Data.'
defaultto ''
end
end

newproperty(:conversion) do
desc 'Conversion value'
defaultto 0
end
end

6 changes: 4 additions & 2 deletions lib/puppet_x/snmpcollector/mapping.rb
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,8 @@ def self.metric
'scale' => 'Scale',
'shift' => 'Shift',
'is_tag' => 'IsTag',
'extra_data' => 'ExtraData',}
'extra_data' => 'ExtraData',
'conversion' => 'Conversion',}
end

def self.measurement
Expand Down Expand Up @@ -101,4 +102,5 @@ def self.measurement_filter
'description' => 'Description',}
end
end
end
end

9 changes: 6 additions & 3 deletions manifests/metric.pp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
Integer $scale = 0,
Integer $shift = 0,
Boolean $is_tag = false,
String $extra_data = ''
String $extra_data = '',
Integer $conversion = 0
)
{
include snmpcollector::reload
Expand All @@ -25,6 +26,8 @@
scale => $scale,
shift => $shift,
is_tag => $is_tag,
extra_data => $extra_data
extra_data => $extra_data,
conversion => $conversion
} ~> Class['snmpcollector::reload']
}
}