Module: ZabbixSender
- Defined in:
- lib/zabbix_sender.rb,
lib/zabbix_sender/sender.rb,
lib/zabbix_sender/request.rb,
lib/zabbix_sender/version.rb
Defined Under Namespace
Constant Summary collapse
- MissingConfigFile =
Class.new(StandardError)
- MissingServerActiveConfig =
Class.new(StandardError)
- VERSION =
"0.1.3"
Class Method Summary collapse
- .from_config(config_path = "/etc/zabbix/zabbix_agentd.conf") ⇒ Object
- .new(zabbix_host: "127.0.0.1", zabbix_port: 10051) ⇒ Object
Class Method Details
.from_config(config_path = "/etc/zabbix/zabbix_agentd.conf") ⇒ Object
11 12 13 14 15 16 17 |
# File 'lib/zabbix_sender.rb', line 11 def from_config(config_path = "/etc/zabbix/zabbix_agentd.conf") unless File.exist?(config_path) raise MissingConfigFile, "Missing config file with #{config_path}" end host, port = parse_config(config_path) Sender.new(zabbix_host: host, zabbix_port: port) end |
.new(zabbix_host: "127.0.0.1", zabbix_port: 10051) ⇒ Object
19 20 21 |
# File 'lib/zabbix_sender.rb', line 19 def new(zabbix_host: "127.0.0.1", zabbix_port: 10051) Sender.new(zabbix_host: zabbix_host, zabbix_port: zabbix_port) end |