Class: Nexpose::SNMPAlert
- Inherits:
-
Object
- Object
- Nexpose::SNMPAlert
- Includes:
- Sanitize
- Defined in:
- lib/nexpose/alert.rb
Overview
SNMP Alert This class should only exist as an element of an Alert.
Instance Attribute Summary collapse
-
#community ⇒ Object
The community string.
-
#server ⇒ Object
The server to sent this alert.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(community, server) ⇒ SNMPAlert
constructor
A new instance of SNMPAlert.
- #to_xml ⇒ Object
Methods included from Sanitize
Constructor Details
#initialize(community, server) ⇒ SNMPAlert
Returns a new instance of SNMPAlert.
170 171 172 173 |
# File 'lib/nexpose/alert.rb', line 170 def initialize(community, server) @community = community @server = server end |
Instance Attribute Details
#community ⇒ Object
The community string
165 166 167 |
# File 'lib/nexpose/alert.rb', line 165 def community @community end |
#server ⇒ Object
The server to sent this alert
168 169 170 |
# File 'lib/nexpose/alert.rb', line 168 def server @server end |
Class Method Details
.parse(xml) ⇒ Object
175 176 177 |
# File 'lib/nexpose/alert.rb', line 175 def self.parse(xml) new(xml.attributes['community'], xml.attributes['server']) end |
Instance Method Details
#to_xml ⇒ Object
181 182 183 184 185 186 |
# File 'lib/nexpose/alert.rb', line 181 def to_xml xml = '<snmpAlert' xml << %Q( community="#{replace_entities(community)}") xml << %Q( server="#{replace_entities(server)}">) xml << '</snmpAlert>' end |