mirror of
https://github.com/munin-monitoring/contrib.git
synced 2025-07-21 18:41:03 +00:00
Modifying ejabberd_scanlog
* added 'reset' option to reset stats and start a new log track * new error type(s)
This commit is contained in:
parent
6c0aee5215
commit
7cac42ed09
1 changed files with 8 additions and 0 deletions
|
@ -42,6 +42,11 @@ else
|
|||
end
|
||||
end
|
||||
|
||||
if ARGV.first == 'reset'
|
||||
log_info = { :start => File.size(LOG_FILE)-1 }
|
||||
puts 'Log reset'
|
||||
end
|
||||
|
||||
new_data = ''
|
||||
File.open(LOG_FILE, 'r') do |flog|
|
||||
flog.seek(log_info[:start])
|
||||
|
@ -72,6 +77,7 @@ LABELS = {
|
|||
:vcard_error => 'Strange vCard error (vhost)',
|
||||
:mnesia_overload => 'Mnesia is overloaded',
|
||||
:mysql_init_recv_failed => 'MySQL: init failed recv data',
|
||||
:tcp_failed => 'TCP Error',
|
||||
:UNKNOWN => 'Unknown error/warning'
|
||||
}
|
||||
def log_type(text)
|
||||
|
@ -125,6 +131,8 @@ def log_type(text)
|
|||
:mnesia_overload
|
||||
elsif text.include?('mysql_conn: init failed receiving data')
|
||||
:mysql_init_recv_failed
|
||||
elsif text.include?('Failed TCP')
|
||||
:tcp_failed
|
||||
else
|
||||
warn "Cannot parse text: #{text}" if $debug_mode
|
||||
:UNKNOWN
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue