Sha256: bc7120978b9adbbd7a761de806843c7988b004f8d07b5364f56cea157132acd8
Contents?: true
Size: 413 Bytes
Versions: 41
Compression:
Stored size: 413 Bytes
Contents
module Perus::Pinger class HD < Command description 'Measures the percentage of disk space currently used on the specified drive.' option :drive metric! def run regex = "/^#{options.drive.gsub("/", "\\/")}/" percent = shell("df -h / | awk '#{regex} {print $5}'") {hd_used: percent.to_i} end end end
Version data entries
41 entries across 41 versions & 1 rubygems