Class: Nexpose::SNMPAlert

Inherits:
Object
  • Object
show all
Includes:
Alert
Defined in:
lib/nexpose/alert.rb

Overview

SNMP Alert

Instance Attribute Summary collapse

Attributes included from Alert

#alert_type, #enabled, #id, #max_alerts, #name, #server, #server_port

Instance Method Summary collapse

Methods included from Alert

create, #delete, json_initializer, list_alerts, load, load_alerts, #save, #to_h, #to_json, #validate

Methods included from TypedAccessor

#typed_accessor

Methods included from JsonSerializer

#deserialize, #serialize, #to_hash

Constructor Details

#initialize(name, community, server, enabled = 1, max_alerts = -1)) ⇒ SNMPAlert

Returns a new instance of SNMPAlert.



209
210
211
212
213
214
215
216
217
# File 'lib/nexpose/alert.rb', line 209

def initialize(name, community, server, enabled = 1, max_alerts = -1)
  raise 'SNMP alerts must have a community defined.' if community.nil?
  @alert_type = 'SNMP'
  @name       = name
  @enabled    = enabled
  @max_alerts = max_alerts
  @community  = community
  @server     = server
end

Instance Attribute Details

#communityObject

Returns the value of attribute community.



207
208
209
# File 'lib/nexpose/alert.rb', line 207

def community
  @community
end