Class: Nagira::Hostgroup
- Inherits:
-
Object
- Object
- Nagira::Hostgroup
- Defined in:
- lib/nagira/hostgroup.rb
Instance Attribute Summary (collapse)
-
- (Object) data
readonly
Returns the value of attribute data.
-
- (Object) hostgroup
readonly
Returns the value of attribute hostgroup.
-
- (Object) name
readonly
Returns the value of attribute name.
-
- (Object) objects
readonly
Returns the value of attribute objects.
-
- (Object) status(mode)
readonly
Returns the value of attribute status.
Instance Method Summary (collapse)
-
- (Object) full
i.e.
- - (Object) host_status
-
- (Hostgroup) initialize(name)
constructor
A new instance of Hostgroup.
- - (Object) members
- - (Object) service_status
Constructor Details
- (Hostgroup) initialize(name)
Returns a new instance of Hostgroup
5 6 7 8 9 10 11 |
# File 'lib/nagira/hostgroup.rb', line 5 def initialize(name) @name = name @objects = $nagios[:objects].objects @status = $nagios[:status].status['hosts'] @hostgroup = @objects[:hostgroup][name] @data = { } end |
Instance Attribute Details
- (Object) data (readonly)
Returns the value of attribute data
3 4 5 |
# File 'lib/nagira/hostgroup.rb', line 3 def data @data end |
- (Object) hostgroup (readonly)
Returns the value of attribute hostgroup
3 4 5 |
# File 'lib/nagira/hostgroup.rb', line 3 def hostgroup @hostgroup end |
- (Object) name (readonly)
Returns the value of attribute name
3 4 5 |
# File 'lib/nagira/hostgroup.rb', line 3 def name @name end |
- (Object) objects (readonly)
Returns the value of attribute objects
3 4 5 |
# File 'lib/nagira/hostgroup.rb', line 3 def objects @objects end |
- (Object) status(mode) (readonly)
Returns the value of attribute status
3 4 5 |
# File 'lib/nagira/hostgroup.rb', line 3 def status @status end |
Instance Method Details
- (Object) full
i.e. both servcie and hoststatus
18 19 20 21 22 23 |
# File 'lib/nagira/hostgroup.rb', line 18 def full members.each do |hostname| data[hostname] = @status[hostname] end data end |
- (Object) host_status
42 43 44 |
# File 'lib/nagira/hostgroup.rb', line 42 def host_status status 'hoststatus' end |
- (Object) members
13 14 15 |
# File 'lib/nagira/hostgroup.rb', line 13 def members hostgroup[:members].split(",") end |
- (Object) service_status
37 38 39 |
# File 'lib/nagira/hostgroup.rb', line 37 def service_status status 'servicestatus' end |