Sha256: 57b14d212d22a68bb206463138b0597ff6637450e3c66165b9f4528c0005b6d7
Contents?: true
Size: 530 Bytes
Versions: 5
Compression:
Stored size: 530 Bytes
Contents
require "socket" require "zabbix_sender_legacy/request" module ZabbixSenderLegacy class Sender attr_reader :zabbix_host, :zabbix_port def initialize(zabbix_host= "127.0.0.1", zabbix_port= 10051) @zabbix_host = zabbix_host @zabbix_port = zabbix_port end def post(host, key, value) request = Request.new(host, key, value) begin socket = TCPSocket.new(zabbix_host, zabbix_port) request.send(socket) ensure socket.close if socket end end end end
Version data entries
5 entries across 5 versions & 1 rubygems