Class: Nagira::Servicegroup::Member
- Inherits:
-
Object
- Object
- Nagira::Servicegroup::Member
- Defined in:
- lib/nagira/servicegroup.rb
Overview
Single member of servicegroup. In Nagios configuration it is defined as “<hostname>,<service>”. Contructor takes straing as argument.
Instance Attribute Summary collapse
-
#hostname ⇒ Object
readonly
Returns the value of attribute hostname.
-
#servicename ⇒ Object
readonly
Returns the value of attribute servicename.
Instance Method Summary collapse
-
#initialize(string) ⇒ Member
constructor
A new instance of Member.
- #service ⇒ Object
- #state ⇒ Object
- #status ⇒ Object
Constructor Details
#initialize(string) ⇒ Member
Returns a new instance of Member.
10 11 12 13 14 |
# File 'lib/nagira/servicegroup.rb', line 10 def initialize(string) member = string.split "," @hostname = member.first @servicename = member.last end |
Instance Attribute Details
#hostname ⇒ Object (readonly)
Returns the value of attribute hostname.
15 16 17 |
# File 'lib/nagira/servicegroup.rb', line 15 def hostname @hostname end |
#servicename ⇒ Object (readonly)
Returns the value of attribute servicename.
15 16 17 |
# File 'lib/nagira/servicegroup.rb', line 15 def servicename @servicename end |
Instance Method Details
#service ⇒ Object
17 18 19 |
# File 'lib/nagira/servicegroup.rb', line 17 def service @service ||= Nagira::HostService.new(hostname,servicename) end |
#state ⇒ Object
24 25 26 |
# File 'lib/nagira/servicegroup.rb', line 24 def state service.state end |
#status ⇒ Object
20 21 22 |
# File 'lib/nagira/servicegroup.rb', line 20 def status service.status end |