Class: CustomMonitoring

Inherits:
Object
  • Object
show all
Defined in:
lib/monitor/client/custom/custom_monitoring.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(st, name, param, sev) ⇒ CustomMonitoring

Returns a new instance of CustomMonitoring.



5
6
7
8
9
10
11
# File 'lib/monitor/client/custom/custom_monitoring.rb', line 5

def initialize (st, name, param, sev)
	@state=st
	@name=name
	#index of $status
	@severity=sev
	@param=param
end

Instance Attribute Details

#nameObject

Returns the value of attribute name.



3
4
5
# File 'lib/monitor/client/custom/custom_monitoring.rb', line 3

def name
  @name
end

#paramObject

Returns the value of attribute param.



3
4
5
# File 'lib/monitor/client/custom/custom_monitoring.rb', line 3

def param
  @param
end

Instance Method Details

#active?Boolean

Returns:

  • (Boolean)


17
18
19
# File 'lib/monitor/client/custom/custom_monitoring.rb', line 17

def active?()
 return @state==1
end

#get_stateObject



13
14
15
# File 'lib/monitor/client/custom/custom_monitoring.rb', line 13

def get_state()
 return @state
end

#raw_severityObject



28
29
30
# File 'lib/monitor/client/custom/custom_monitoring.rb', line 28

def raw_severity()
 return @severity
end

#request(node) ⇒ Object

compute the value



24
25
26
# File 'lib/monitor/client/custom/custom_monitoring.rb', line 24

def request(node)

end

#severityObject



32
33
34
35
# File 'lib/monitor/client/custom/custom_monitoring.rb', line 32

def severity()
        return $status[0] if !@severity
 return $status[@severity]
end

#to_sObject



37
38
39
# File 'lib/monitor/client/custom/custom_monitoring.rb', line 37

def to_s()
   return "name=#{@name} state=#{@state} severity=#{@severity} parameter=#{@param}"
end