Class: JmxMonitoring

Inherits:
Object
  • Object
show all
Defined in:
lib/monitor/client/jmx/jmx_monitoring.rb

Instance Method Summary collapse

Constructor Details

#initialize(st, jmx_name, proto, pt, ath = nil) ⇒ JmxMonitoring

Returns a new instance of JmxMonitoring.



5
6
7
8
9
10
11
12
# File 'lib/monitor/client/jmx/jmx_monitoring.rb', line 5

def initialize (st, jmx_name, proto, pt, ath=nil)
	@state=st
	@jmxref=jmx_name
	@protocol=proto
	@port=pt
	@auth=ath	
	@attributes=Hash.new
end

Instance Method Details

#active?Boolean

Returns:

  • (Boolean)


79
80
81
# File 'lib/monitor/client/jmx/jmx_monitoring.rb', line 79

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

#add_attribute(name, op, val, sev) ⇒ Object



62
63
64
65
# File 'lib/monitor/client/jmx/jmx_monitoring.rb', line 62

def add_attribute(name, op, val, sev)
	print op,"\n"
	@attributes[name]=JmxAttributeMonitoring.new(name, op, val, sev)
end

#attribute_sizeObject



75
76
77
# File 'lib/monitor/client/jmx/jmx_monitoring.rb', line 75

def attribute_size()
	return @attributes.size
end

#clear_attributesObject



58
59
60
# File 'lib/monitor/client/jmx/jmx_monitoring.rb', line 58

def clear_attributes()
	@attributes=Hash.new
end

#del_attribute(name) ⇒ Object



71
72
73
# File 'lib/monitor/client/jmx/jmx_monitoring.rb', line 71

def del_attribute(name)
	return @attributes.delete(name)
end

#exist_attribute(name) ⇒ Object



67
68
69
# File 'lib/monitor/client/jmx/jmx_monitoring.rb', line 67

def exist_attribute(name)
	return @attributes.include?(name)
end

#get_attributesObject



54
55
56
# File 'lib/monitor/client/jmx/jmx_monitoring.rb', line 54

def get_attributes()
	return @attributes
end

#get_authObject



38
39
40
# File 'lib/monitor/client/jmx/jmx_monitoring.rb', line 38

def get_auth()
	return @auth
end

#get_portObject



30
31
32
# File 'lib/monitor/client/jmx/jmx_monitoring.rb', line 30

def get_port()
	return @port
end

#get_protocolObject



22
23
24
# File 'lib/monitor/client/jmx/jmx_monitoring.rb', line 22

def get_protocol()
	return @protocol
end

#get_refObject



18
19
20
# File 'lib/monitor/client/jmx/jmx_monitoring.rb', line 18

def get_ref()
	return @jmxref
end

#get_stateObject



46
47
48
# File 'lib/monitor/client/jmx/jmx_monitoring.rb', line 46

def get_state()
	return @state
end

#operObject



14
15
16
# File 'lib/monitor/client/jmx/jmx_monitoring.rb', line 14

def oper()
	return TESTOP[@oper]
end

#set_auth(ath) ⇒ Object



42
43
44
# File 'lib/monitor/client/jmx/jmx_monitoring.rb', line 42

def set_auth(ath)
	@auth=ath
end

#set_port(pt) ⇒ Object



34
35
36
# File 'lib/monitor/client/jmx/jmx_monitoring.rb', line 34

def set_port(pt)
	@port=pt
end

#set_protocol(proto) ⇒ Object



26
27
28
# File 'lib/monitor/client/jmx/jmx_monitoring.rb', line 26

def set_protocol(proto)
	@protocol=proto
end

#set_state(st) ⇒ Object



50
51
52
# File 'lib/monitor/client/jmx/jmx_monitoring.rb', line 50

def set_state(st)
	@state=st
end