]> git.evergreen-ils.org Git - contrib/equinox.git/blob - monitoring/eg-stats/README
b83ec8da436624777a94e665b595ef4e47b9d0d9
[contrib/equinox.git] / monitoring / eg-stats / README
1 ====== ON THE CENTRAL SYSLOG MACHINE ======
2 ==== syslog-ng ====
3
4 - Add the following lines in the appropriate places in /etc/syslog-ng/syslog-ng.conf (edit/replace the filter f_system line don't duplicate it)
5
6  edit /etc/syslog-ng/syslog-ng.conf destination d_external_eg_stats { # f_egstats
7  file("/var/log/evergreen/prod/$YEAR/$MONTH/$DAY/eg_stats.log",
8  template("$YEAR-$MONTH-$DAY $HOUR:$MIN:$SEC $HOST $MSG\n") owner(nagios) group(nagios) template-escape(no)); };
9  
10  filter f_egstats { match("eg-stats") and not match("CRON"); };
11  filter f_system { not facility(local0, local1, local2, local3, local4, local5, local6, local7) and not filter(f_egstats); };
12  
13  log { source(s_all); filter(f_egstats); destination(d_external_eg_stats); };
14
15 Restart syslog:
16
17  /etc/init.d/syslog-ng restart
18
19
20 ==== rsyslog ====
21
22 - Add the following lines in the appropriate places in /etc/rsyslog.d/evergreen-rsyslog.conf [ wget -O evergreen-rsyslog.conf "http://git.evergreen-ils.org/?p=Evergreen.git;a=blob_plain;f=Open-ILS/examples/evergreen-rsyslog.conf" ]
23
24  # Log file templates -------
25  $template egstats,"/var/log/remote/evergreen/%$YEAR%/%$MONTH%/%$DAY%/eg_stats.%$HOUR%.log"
26  
27  if $programname contains 'eg-stats' then
28  {
29  local0.info ?egstats;msgformat
30  & ~
31  }
32
33 Restart rsyslog:
34
35  /etc/init.d/rsyslog restart
36
37 ====== ON THE MACHINES RUNNING EVERGREEN ======
38  cd /usr/share/perl5 && sudo wget -O Logger.pm "http://git.evergreen-ils.org/?p=contrib/equinox.git;a=blob_plain;f=monitoring/eg-stats/Logger.pm
39  cd /usr/bin && sudo wget -O eg-stats-collector-remote-log.pl "http://git.evergreen-ils.org/?p=contrib/equinox.git;a=blob_plain;f=monitoring/eg-stats/eg-stats-collector-remote-log.pl"
40  sudo chmod +x eg-stats-collector-remote-log.pl
41
42 ==== syslog-ng ====
43  cd /usr/bin && sudo wget -O eg-stats-keepalive_syslog-ng.sh "http://git.evergreen-ils.org/?p=contrib/equinox.git;a=blob_plain;f=monitoring/eg-stats/eg-stats-keepalive_syslog-ng.sh"
44  sudo chmod +x eg-stats-keepalive*.sh
45
46 - Add the following lines to the bottom of /etc/syslog-ng/syslog-ng.conf: 
47  #eg-stats-collector
48  source s_file_eg-statslog { file("/var/log/evergreen/prod/$YEAR/$MONTH/$DAY/eg-stats.log" follow_freq(1)); };
49  log { source(s_file_eg-statslog); destination(d_ext); };
50
51 Restart syslog:
52
53  /etc/init.d/syslog-ng restart
54
55 Insert this line into root's crontab: 
56  */1 * * * * /usr/bin/eg-stats-keepalive_syslog-ng.sh >/dev/null 2>&1
57
58
59 ==== rsyslog ====
60  cd /usr/bin && sudo wget -O eg-stats-keepalive_rsyslog.sh "http://git.evergreen-ils.org/?p=contrib/equinox.git;a=blob_plain;f=monitoring/eg-stats/eg-stats-keepalive_rsyslog.sh"
61  sudo chmod +x eg-stats-keepalive*.sh
62
63 - Add the following lines below the RULES section (replace syslog_server with your central syslog machine name or ip):
64  #
65  # Evergreen
66  #
67  local0.*   @syslog_server:514
68  local1.*   @syslog_server:514
69  local2.*   @syslog_server:514
70  local3.*   @syslog_server:514
71  local6.*   @syslog_server:514
72  local7.*   @syslog_server:514
73  local0.*   ~
74  local1.*   ~
75  local2.*   ~
76  local3.*   ~
77  local6.*   ~
78  local7.*   ~
79
80 Restart rsyslog:
81
82  /etc/init.d/rsyslog restart
83
84 Insert this line into root's crontab: 
85
86  */1 * * * * /usr/bin/eg-stats-keepalive_rsyslog.sh >/dev/null 2>&1
87