From 343c2bfabe30c86a13f4b523874441ae0f3d050e Mon Sep 17 00:00:00 2001 From: Artem Sheremet Date: Fri, 18 May 2012 00:30:54 +0300 Subject: [PATCH 1/3] Adding new error types to ejabberd_scanlog --- .../ejabberd_scanlog/ejabberd_scanlog | 23 ++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/plugins/ejabberd/ejabberd_scanlog/ejabberd_scanlog b/plugins/ejabberd/ejabberd_scanlog/ejabberd_scanlog index f18ab68e..e821871b 100755 --- a/plugins/ejabberd/ejabberd_scanlog/ejabberd_scanlog +++ b/plugins/ejabberd/ejabberd_scanlog/ejabberd_scanlog @@ -65,6 +65,13 @@ LABELS = { :system_ports_limit => 'System limit hit: ports', # check with length(erlang:ports())., set in ejabberdctl config file :system_limit => 'Other system limit hit', # processes? check with erlang:system_info(process_count)., erlang:system_info(process_limit)., set in ejabberdctl cfg :generic_server_terminating => 'Generic server terminating', + :mnesia_table_shrinked => 'Mnesia table shrinked', + :admin_access_failed => 'Admin access failed', + :mysql_sock_timedout => 'MySQL sock timedout', + :config_error => 'Configuration error', + :vcard_error => 'Strange vCard error (vhost)', + :mnesia_overload => 'Mnesia is overloaded', + :mysql_init_recv_failed => 'MySQL: init failed recv data', :UNKNOWN => 'Unknown error/warning' } def log_type(text) @@ -104,6 +111,20 @@ def log_type(text) :system_limit elsif text.include?('Generic server') and text.include?('terminating') :generic_server_terminating + elsif text.include?('shrinking table') + :mnesia_table_shrinked + elsif text.include?('Access of') and text.include?('failed with error') + :admin_access_failed + elsif text.include?('mysql_') and text.include?(': Socket') and text.include?('timedout') + :mysql_sock_timedout + elsif text.include?('{badrecord,config}') + :config_error + elsif text.include?('error found when trying to get the vCard') + :vcard_error + elsif text.include?('Mnesia is overloaded') + :mnesia_overload + elsif text.include?('mysql_conn: init failed receiving data') + :mysql_init_recv_failed else warn "Cannot parse text: #{text}" if $debug_mode :UNKNOWN @@ -128,7 +149,7 @@ File.open(CACHE_FILE, 'w') { |f| f.write log_info.to_yaml } unless $debug_mode if ARGV.first == 'config' puts < Date: Tue, 27 Mar 2012 23:41:26 +0300 Subject: [PATCH 2/3] Although not used, updating from 'export' --- plugins/network/tcp-retransmissions | 41 ++++++++++++++++++----------- 1 file changed, 25 insertions(+), 16 deletions(-) diff --git a/plugins/network/tcp-retransmissions b/plugins/network/tcp-retransmissions index 1b97b6e7..085695a4 100755 --- a/plugins/network/tcp-retransmissions +++ b/plugins/network/tcp-retransmissions @@ -1,27 +1,36 @@ -#!/bin/bash +#!/bin/sh + +# tcp_retries revision 2 (Feb 2012) +# +# TCP retransmission rate. Useful for network debugging. +# +# Required privileges: none +# +# OS: Linux with procfs +# +# Author: Artem Sheremet +# + +#%# family=auto +#%# capabilities=autoconf + +TCPSTAT=/proc/net/tcp case $1 in + autoconf) + [ -r $TCPSTAT -o -r ${TCPSTAT}6 ] && echo "yes" || echo "no" + ;; config) - cat < Date: Tue, 27 Mar 2012 23:40:33 +0300 Subject: [PATCH 3/3] Fixing netstat_bsd_s bug (base is 1000 for bytes) --- plugins/network/netstat_bsd_s_/netstat_bsd_s_ | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/network/netstat_bsd_s_/netstat_bsd_s_ b/plugins/network/netstat_bsd_s_/netstat_bsd_s_ index 42049ffa..b062ac15 100755 --- a/plugins/network/netstat_bsd_s_/netstat_bsd_s_ +++ b/plugins/network/netstat_bsd_s_/netstat_bsd_s_ @@ -1,6 +1,6 @@ #!/usr/bin/env ruby -# netstat_bsd_s revision 1 (Mar 2012) +# netstat_bsd_s revision 2 (Mar 2012) # # This plugin shows various statistics from 'netstat -s' # @@ -62,7 +62,7 @@ class Graph "graph_order #{labels.map(&:escape).join(' ')}" ] - config_options.push "graph_args --base 1024" if unit == 'bytes' + config_options.push "graph_args --base 1024" if unit == :bytes labels.each { |label| label_esc = label.escape