Class: JmxMonitoring
- Inherits:
-
Object
- Object
- JmxMonitoring
- Defined in:
- lib/monitor/client/jmx/jmx_monitoring.rb
Instance Method Summary collapse
- #active? ⇒ Boolean
- #add_attribute(name, op, val, sev) ⇒ Object
- #attribute_size ⇒ Object
- #clear_attributes ⇒ Object
- #del_attribute(name) ⇒ Object
- #exist_attribute(name) ⇒ Object
- #get_attributes ⇒ Object
- #get_auth ⇒ Object
- #get_port ⇒ Object
- #get_protocol ⇒ Object
- #get_ref ⇒ Object
- #get_state ⇒ Object
-
#initialize(st, jmx_name, proto, pt, ath = nil) ⇒ JmxMonitoring
constructor
A new instance of JmxMonitoring.
- #oper ⇒ Object
- #set_auth(ath) ⇒ Object
- #set_port(pt) ⇒ Object
- #set_protocol(proto) ⇒ Object
- #set_state(st) ⇒ Object
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
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_size ⇒ Object
75 76 77 |
# File 'lib/monitor/client/jmx/jmx_monitoring.rb', line 75 def attribute_size() return @attributes.size end |
#clear_attributes ⇒ Object
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_attributes ⇒ Object
54 55 56 |
# File 'lib/monitor/client/jmx/jmx_monitoring.rb', line 54 def get_attributes() return @attributes end |
#get_auth ⇒ Object
38 39 40 |
# File 'lib/monitor/client/jmx/jmx_monitoring.rb', line 38 def get_auth() return @auth end |
#get_port ⇒ Object
30 31 32 |
# File 'lib/monitor/client/jmx/jmx_monitoring.rb', line 30 def get_port() return @port end |
#get_protocol ⇒ Object
22 23 24 |
# File 'lib/monitor/client/jmx/jmx_monitoring.rb', line 22 def get_protocol() return @protocol end |
#get_ref ⇒ Object
18 19 20 |
# File 'lib/monitor/client/jmx/jmx_monitoring.rb', line 18 def get_ref() return @jmxref end |
#get_state ⇒ Object
46 47 48 |
# File 'lib/monitor/client/jmx/jmx_monitoring.rb', line 46 def get_state() return @state end |
#oper ⇒ Object
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 |