Class: SyslogMonitoring
- Inherits:
-
Object
- Object
- SyslogMonitoring
- Defined in:
- lib/monitor/server/syslog/syslog_monitoring.rb
Instance Method Summary collapse
- #active? ⇒ Boolean
- #get_state ⇒ Object
- #get_syslog_ref ⇒ Object
-
#initialize(st, syslog_ref, sev) ⇒ SyslogMonitoring
constructor
A new instance of SyslogMonitoring.
- #raw_severity ⇒ Object
- #severity ⇒ Object
Constructor Details
#initialize(st, syslog_ref, sev) ⇒ SyslogMonitoring
Returns a new instance of SyslogMonitoring.
3 4 5 6 7 8 |
# File 'lib/monitor/server/syslog/syslog_monitoring.rb', line 3 def initialize (st, syslog_ref, sev) @state=st @syslog_ref=syslog_ref #index of $status, 0 is auto map syslog severity @severity=sev end |
Instance Method Details
#active? ⇒ Boolean
18 19 20 |
# File 'lib/monitor/server/syslog/syslog_monitoring.rb', line 18 def active?() return @state==1 end |
#get_state ⇒ Object
14 15 16 |
# File 'lib/monitor/server/syslog/syslog_monitoring.rb', line 14 def get_state() return @state end |
#get_syslog_ref ⇒ Object
10 11 12 |
# File 'lib/monitor/server/syslog/syslog_monitoring.rb', line 10 def get_syslog_ref() return @syslog_ref end |
#raw_severity ⇒ Object
22 23 24 |
# File 'lib/monitor/server/syslog/syslog_monitoring.rb', line 22 def raw_severity() return @severity end |
#severity ⇒ Object
26 27 28 29 30 31 |
# File 'lib/monitor/server/syslog/syslog_monitoring.rb', line 26 def severity() if @severity > 0 return $status[@severity-1] end return nil end |