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.
166 167 168 169 |
# File 'lib/nexpose/alert.rb', line 166 def initialize(community, server) @community = community @server = server end |
Instance Attribute Details
#community ⇒ Object
The community string
161 162 163 |
# File 'lib/nexpose/alert.rb', line 161 def community @community end |
#server ⇒ Object
The server to sent this alert
164 165 166 |
# File 'lib/nexpose/alert.rb', line 164 def server @server end |
Class Method Details
.parse(xml) ⇒ Object
171 172 173 |
# File 'lib/nexpose/alert.rb', line 171 def self.parse(xml) new(xml.attributes['community'], xml.attributes['server']) end |
Instance Method Details
#to_xml ⇒ Object
177 178 179 180 181 182 |
# File 'lib/nexpose/alert.rb', line 177 def to_xml xml = '<snmpAlert' xml << %( community="#{replace_entities(community)}") xml << %( server="#{replace_entities(server)}">) xml << '</snmpAlert>' end |