Skip to content
This repository has been archived by the owner on Sep 26, 2019. It is now read-only.

Commit

Permalink
Report DF metrics as percentage too
Browse files Browse the repository at this point in the history
This change includes a workaround for a bug [1] found in the upstream
puppet-collectd module.

[1] voxpupuli/puppet-collectd#162

Change-Id: I560e0436cfefb026d2c7a979091208a399bbe2fd
  • Loading branch information
Simon Pasquier committed Aug 4, 2015
1 parent 0806877 commit fa2da1a
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,10 @@ function process_message ()
local entity
if sample['type'] == 'df_inodes' then
entity = 'inodes'
elseif sample['type'] == 'percent_inodes' then
entity = 'inodes_percent'
elseif sample['type'] == 'percent_bytes' then
entity = 'space_percent'
else -- sample['type'] == 'df_complex'
entity = 'space'
end
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Copyright 2015 Mirantis, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.

# Workaround because the puppet-collectd module cannot detect the collectd's
# version until the package is installed.
#
# See https://github.com/pdxcat/puppet-module-collectd/issues/162 for details.
Facter.add("collectd_version") do
setcode do
case Facter.value('osfamily')
when /(?i)(debian)/
"5.4.0-3ubuntu2"
when /(?i)(redhat)/
"5.4.1-5.mira1.mira1"
end
end
end
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,8 @@

# TODO: pass this list as a parameter or add a custom fact
class { 'collectd::plugin::df':
mountpoints => ['/', '/boot'],
mountpoints => ['/', '/boot'],
valuespercentage => true,
}

$block_devices = join(split($::blockdevices, ','), '|')
Expand Down

0 comments on commit fa2da1a

Please sign in to comment.