Class: Fluent::Plugin::DiskFree

Inherits:
Input
  • Object
show all
Defined in:
lib/fluent/plugin/in_diskfree.rb

Overview

Disk free command plugin class.

Constant Summary collapse

DF_HEADER_COLMUS_LENGTH =

df header cols length Filesystem, 1024-blocks, Used, Available, Capacity, Mounted on


6

Instance Method Summary collapse

Instance Method Details

#configure(conf) ⇒ Object


Fluent plugin configuration method.




49
50
51
52
53
# File 'lib/fluent/plugin/in_diskfree.rb', line 49

def configure(conf)
  super
  # -P: use the POSIX output format
  @execute_command = "df -P #{@option} #{@mounted_path} 2> /dev/null"
end

#multi_workers_ready?Boolean


Fluent plugin multi worker


Returns:

  • (Boolean)


58
59
60
# File 'lib/fluent/plugin/in_diskfree.rb', line 58

def multi_workers_ready?
  true
end

#startObject


Fluent plugin start method.




65
66
67
68
# File 'lib/fluent/plugin/in_diskfree.rb', line 65

def start
  super
  timer_execute(:in_diskfree, @refresh_interval, repeat: true, &method(:run_timer))
end