class NSCA::Packet

Attributes

hostname[RW]
return_code[RW]
service[RW]
status[RW]
timestamp[RW]

Public Class Methods

new(timestamp, return_code, hostname, service, status) click to toggle source

@param [Time,Integer,nil] timestamp Checked at this time @param [0..3] return_code ‘NSCA::ReturnCode` @param [String(length<64),nil] hostname If nil, local hostname will be used.

Must be known by Nagios.

@param [String(length<128)] service Name of Service. Must be known by Nagios. @param [String(length<512)] status Status-line inclusive optional Performance Data.

# File lib/nsca/packet.rb, line 21
def initialize timestamp, return_code, hostname, service, status
        @timestamp, @return_code, @hostname, @service, @status =
                Time.at( timestamp.to_f), return_code, hostname, service, status
end
register_version( version, klass) click to toggle source
# File lib/nsca/packet.rb, line 13
def self.register_version( version, klass) versions[version] = klass end
versions(version = nil) click to toggle source
# File lib/nsca/packet.rb, line 8
def self.versions version = nil
        @@versions ||= {}
        version ? @@versions[version] : @@versions
end