Module: ZabbixRubyClient::Plugins
- Extended by:
- Plugins
- Included in:
- Plugins
- Defined in:
- lib/zabbix-ruby-client/plugins.rb,
lib/zabbix-ruby-client/plugins/apt.rb,
lib/zabbix-ruby-client/plugins/cpu.rb,
lib/zabbix-ruby-client/plugins/who.rb,
lib/zabbix-ruby-client/plugins/disk.rb,
lib/zabbix-ruby-client/plugins/load.rb,
lib/zabbix-ruby-client/plugins/ovpn.rb,
lib/zabbix-ruby-client/plugins/mysql.rb,
lib/zabbix-ruby-client/plugins/nginx.rb,
lib/zabbix-ruby-client/plugins/redis.rb,
lib/zabbix-ruby-client/plugins/apache.rb,
lib/zabbix-ruby-client/plugins/memory.rb,
lib/zabbix-ruby-client/plugins/network.rb,
lib/zabbix-ruby-client/plugins/sysinfo.rb,
lib/zabbix-ruby-client/plugins/postgres.rb,
lib/zabbix-ruby-client/plugins/rabbitmq.rb,
lib/zabbix-ruby-client/plugins/mysqlcommand.rb
Defined Under Namespace
Modules: Apache, Apt, Cpu, Disk, Load, Memory, Mysql, Mysqlcommand, Network, Nginx, Ovpn, Postgres, Rabbitmq, Redis, Sysinfo, Who
Instance Method Summary
collapse
Instance Method Details
#load(plugin) ⇒ Object
27
28
29
30
31
32
33
34
35
36
37
|
# File 'lib/zabbix-ruby-client/plugins.rb', line 27
def load(plugin)
if @loaded[plugin]
true
else
if @available[plugin]
ZabbixRubyClient.send :load, @available[plugin]
else
nil
end
end
end
|
#loaded ⇒ Object
19
20
21
|
# File 'lib/zabbix-ruby-client/plugins.rb', line 19
def loaded
@loaded ||= {}
end
|
#register(plugin, klass) ⇒ Object
23
24
25
|
# File 'lib/zabbix-ruby-client/plugins.rb', line 23
def register(plugin, klass)
@loaded[plugin] = klass
end
|
#reset ⇒ Object
39
40
41
42
|
# File 'lib/zabbix-ruby-client/plugins.rb', line 39
def reset
@loaded = {}
@available = {}
end
|
#scan_dirs(dirs) ⇒ Object
7
8
9
10
11
12
13
14
15
16
17
|
# File 'lib/zabbix-ruby-client/plugins.rb', line 7
def scan_dirs(dirs)
@available = {}
@loaded = {}
dirs.each do |d|
Dir.glob(File.join(d,"*.rb")).reduce(@available) { |a,x|
name = File.basename(x,".rb")
a[name] = x
a
}
end
end
|