summaryrefslogtreecommitdiffstats
path: root/extras
diff options
context:
space:
mode:
authorBala.FA <barumuga@redhat.com>2013-08-09 17:21:56 +0530
committerVijay Bellur <vbellur@redhat.com>2013-08-14 13:05:50 -0700
commitfc82ae5ddf3b1821095de4188fead9a25bc24191 (patch)
treecd6e0f5c8ca83ec39be3871419b91c66d1c0cc04 /extras
parent1d1daa234eac97554103da16a7d6090bc25e5294 (diff)
log: add comments to rsyslog gluster configuration file
Comments are added to rsyslog gluster configuration files to give clear meanings and example email alerting. Change-Id: I23577dc3b39bca89696c46ab6252dc5673d0803f BUG: 928648 Signed-off-by: Bala.FA <barumuga@redhat.com> Reviewed-on: http://review.gluster.org/5621 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
Diffstat (limited to 'extras')
-rw-r--r--extras/gluster-rsyslog-5.8.conf38
-rw-r--r--extras/gluster-rsyslog-7.2.conf34
2 files changed, 71 insertions, 1 deletions
diff --git a/extras/gluster-rsyslog-5.8.conf b/extras/gluster-rsyslog-5.8.conf
index da6232bc..2519999b 100644
--- a/extras/gluster-rsyslog-5.8.conf
+++ b/extras/gluster-rsyslog-5.8.conf
@@ -1,15 +1,51 @@
##### gluster.conf #####
+
+#
+## If you want to log every message to the log file instead of
+## intelligently suppressing repeated messages, set off to
+## RepeatedMsgReduction. This change requires rsyslog restart
+## (eg. run 'service rsyslog restart')
+#
+#$RepeatedMsgReduction off
$RepeatedMsgReduction on
+#
+## The mmcount module provides the capability to count log messages by
+## severity or json property of given app-name. The count value is added
+## into the log message as json property named '$msgid'
+#
$ModLoad mmcount
-$mmcountKey gf_code
+$mmcountKey gf_code # start counting value of gf_code
$template Glusterfsd_dynLogFile,"/var/log/glusterfs/bricks/%app-name%.log"
$template Gluster_dynLogFile,"/var/log/glusterfs/%app-name%.log"
$template GLFS_Template,"%msgid%/%syslogfacility-text:::uppercase%/%syslogseverity-text:::uppercase% [%TIMESTAMP:::date-rfc3339%] %msg:::sp-if-no-1st-sp%%msg:::drop-last-lf%\n"
+#
+## Pass logs to mmcount if app-name is 'gluster'
+#
if $app-name contains 'gluster' then :mmcount:
+
if $app-name contains 'glusterfsd' then ?Glusterfsd_dynLogFile;GLFS_Template
if $app-name contains 'gluster' and not ( $app-name contains 'glusterfsd' ) then ?Gluster_dynLogFile;GLFS_Template
+
+#
+## Sample configuration to send a email alert for every 50th mmcount
+#
+#$ModLoad ommail
+#$ActionMailSMTPServer smtp.example.com
+#$ActionMailFrom rsyslog@example.com
+#$ActionMailTo glusteradmin@example.com
+#$template mailSubject,"50th message of gf_code=9999 on %hostname%"
+#$template mailBody,"RSYSLOG Alert\r\nmsg='%msg%'"
+#$ActionMailSubject mailSubject
+#$ActionExecOnlyOnceEveryInterval 30
+#if $app-name == 'glusterfsd' and $msgid != 0 and $msgid % 50 == 0 \
+#then :ommail:;RSYSLOG_SyslogProtocol23Format
+#
+
+#
+## discard logs where app-name is 'gluster' as we processed already
+#
if $app-name contains 'gluster' then ~
diff --git a/extras/gluster-rsyslog-7.2.conf b/extras/gluster-rsyslog-7.2.conf
index 744acbc9..8b284154 100644
--- a/extras/gluster-rsyslog-7.2.conf
+++ b/extras/gluster-rsyslog-7.2.conf
@@ -1,9 +1,28 @@
##### gluster.conf #####
+#
+## If you want to log every message to the log file instead of
+## intelligently suppressing repeated messages, set off to
+## RepeatedMsgReduction. This change requires rsyslog restart
+## (eg. run 'service rsyslog restart')
+#
+#$RepeatedMsgReduction off
$RepeatedMsgReduction on
$ModLoad mmjsonparse
*.* :mmjsonparse:
+#
+## The mmcount module provides the capability to count log messages by
+## severity or json property of given app-name. The count value is added
+## into the log message as json property named 'mmcount'
+##
+## More info at http://www.rsyslog.com/doc/mmcount.html
+#
+#module(load="mmcount")
+#action(type="mmcount" appname="glusterd" key="!gf_code") # count each value of gf_code of appname glusterd
+#action(type="mmcount" appname="glusterfsd" key="!gf_code") # count each value of gf_code of appname glusterfsd
+#action(type="mmcount" appname="glusterfs" key="!gf_code") # count each value of gf_code of appname glusterfs
+
template (name="Glusterfsd_dynLogFile" type="string" string="/var/log/glusterfs/bricks/%app-name%.log")
template (name="Gluster_dynLogFile" type="string" string="/var/log/glusterfs/%app-name%.log")
@@ -40,3 +59,18 @@ if $app-name contains 'gluster' then {
Template="GLFS_template")
stop
}
+
+#
+## send email for every 50th mmcount
+#$ModLoad ommail
+#if $app-name == 'glusterfsd' and $!mmcount <> 0 and $!mmcount % 50 == 0 then {
+# $ActionMailSMTPServer smtp.example.com
+# $ActionMailFrom rsyslog@example.com
+# $ActionMailTo glusteradmin@example.com
+# $template mailSubject,"50th message of gf_code=9999 on %hostname%"
+# $template mailBody,"RSYSLOG Alert\r\nmsg='%msg%'"
+# $ActionMailSubject mailSubject
+# $ActionExecOnlyOnceEveryInterval 30
+# :ommail:;RSYSLOG_SyslogProtocol23Format
+#}
+#