remote_syslog 1.6.14 → 1.6.15

Sign up to get free protection for your applications and to get access to all the features.
data/Gemfile CHANGED
@@ -1,3 +1,3 @@
1
- source :rubygems
1
+ source "https://rubygems.org"
2
2
 
3
3
  gemspec
data/README.md CHANGED
@@ -1,4 +1,14 @@
1
- # remote_syslog Ruby daemon & sender
1
+ # Deprecated. Use [remote_syslog2][] instead of this repo
2
+
3
+ ### remote_syslog Ruby daemon & sender
4
+
5
+ remote_syslog has been rewritten in Go as [remote_syslog2][]. As a
6
+ standalone binary, remote_syslog2 has fewer dependencies. It also
7
+ depends on less code between the daemon and the OS.
8
+
9
+ **Use [remote_syslog2][] instead of this repo**.
10
+
11
+ ## Introduction
2
12
 
3
13
  Lightweight Ruby daemon to tail one or more log files and transmit UDP syslog
4
14
  messages to a remote syslog host (centralized log aggregation).
@@ -85,20 +95,39 @@ to `a.example.com:514`:
85
95
 
86
96
  ### Windows
87
97
 
88
- To run in Windows, start in a DOS Prompt or batch file (does not automatically
89
- run in the background):
90
-
91
- C:\> remote_syslog -D
98
+ Windows is not currently supported, though in certain situations it may work.
92
99
 
93
100
  ## Auto-starting at boot
94
101
 
95
- The gem includes sample [init files]. You may be able to:
102
+ The gem includes sample init files, also [available here]. You may be able to:
96
103
 
97
104
  $ cp examples/remote_syslog.init.d /etc/init.d/remote_syslog
105
+ $ chmod 755 /etc/init.d/remote_syslog
106
+
107
+ And then ensure it's started at boot, either by using:
108
+
109
+ $ sudo update-rc.d remote_syslog defaults
110
+
111
+ or by creating a link manually:
112
+
113
+ $ sudo ln -s /etc/init.d/remote_syslog /etc/rc3.d/S30remote_syslog
98
114
 
99
115
  remote_syslog will daemonize by default.
100
116
 
101
- Init files: [init.d], [launchd], [supervisor], [upstart]
117
+ Init files: [remote_syslog.init.d][] (init.d), OS X [launchd], [supervisor], Ubuntu [upstart]
118
+
119
+ ## Optional: rvm
120
+
121
+ Remember that when using a Ruby version manager such as [rvm](https://rvm.io/),
122
+ your interactive shell and init files need the version manager environment loaded.
123
+ The `rvm` [init.d instructions](https://rvm.io/integration/init-d/) show how to
124
+ create a wrapper script for the init files to run. A typical example is:
125
+
126
+ rvm wrapper ruby-1.9.3-p392 bootup remote_syslog
127
+
128
+ .. where `ruby-1.9.3-p392` is the desired Ruby from `rvm list`. `rvm` will output
129
+ the path to the new wrapper script which it created. Edit the init file to run the
130
+ new wrapper script instead of running `remote_syslog` directly.
102
131
 
103
132
  ## Sending messages securely ##
104
133
 
@@ -107,6 +136,16 @@ pass the `--tls` option when running `remote_syslog`:
107
136
 
108
137
  $ remote_syslog --tls -p 1234 /var/log/mysqld.log
109
138
 
139
+ **Important**: `remote_syslog` depends on I/O code provided by the Ruby
140
+ VM, `eventmachine` library, and OS. There is at least one environment
141
+ and failure case where `remote_syslog` will not reconnect when using the
142
+ `--tls` option. Although we've never been able to reproduce this problem,
143
+ enough Papertrail customers have run into it that we'd suggest looking at
144
+ alternative solutions. One of those is forwarding data to rsyslog and
145
+ then using its TLS capabilities to log to Papertrail. For more
146
+ information on that and other alternatives, please contact
147
+ <support@papertrailapp.com>
148
+
110
149
  ## Configuration
111
150
 
112
151
  By default, the gem looks for a configuration in /etc/log_files.yml.
@@ -314,6 +353,94 @@ Point remote_syslog at unique_name.log. It will use that as the program name.
314
353
 
315
354
  ## Troubleshooting
316
355
 
356
+ ## Installation
357
+
358
+ ### `gem` not found
359
+
360
+ Install a [Ruby distribution](https://www.ruby-lang.org/en/downloads/), which typically takes a minute.
361
+
362
+ ### `g++` not found
363
+
364
+ Install `gcc` and `g++` so this system can compile C/C++ source. Installation
365
+ is typically `sudo yum install gcc-c++` (RPM-based distros) or `sudo apt-get
366
+ install build-essential` (.deb-based distros).
367
+
368
+ ### Getting `Encryption not available...` or `TLS is not supported...`
369
+
370
+ The exact error might appear as:
371
+
372
+ Encryption not available on this event-machine
373
+
374
+ or
375
+
376
+ TLS is not supported by eventmachine installed on this system. The openssl-devel/openssl-dev package must be installed before installing eventmachine.
377
+
378
+ Install the OpenSSL C++ package for your distribution, then reinstall the eventmachine.
379
+ For example:
380
+
381
+ * *.deb distros like Ubuntu:* `sudo apt-get install libssl-dev`
382
+ * *RPM distros like Fedora* `sudo yum install openssl-devel`
383
+
384
+ Then:
385
+
386
+ gem install eventmachine -f
387
+
388
+ ### Getting `no such file to load -- mkmf (LoadError)`?
389
+
390
+ Try these:
391
+
392
+ * *Ubuntu:* determine which Ruby version is active with `ruby -v`.
393
+
394
+ For 1.8.7: `sudo apt-get install build-essential ruby1.8 ruby1.8-dev rubygems`.
395
+ For 1.9.x, including 1.9.1 and 1.9.3: `sudo apt-get install build-essential ruby1.9.1-dev`.
396
+ For 2.0: `sudo apt-get install build-essential ruby2.0-dev`
397
+
398
+ * *Fedora:* `sudo yum install ruby-devel`.
399
+
400
+ * Getting errors about missing header files, like `ssl.cpp`? Try:
401
+ * *CentOS:* `sudo yum install libstdc++-devel ruby-devel`
402
+
403
+ ### Getting `Package ruby1.8 is not available...`
404
+
405
+ The exact error might appear as:
406
+
407
+ Package ruby1.8 is not available, but is referred to by another package.` and/or `Package rubygems is not available, but is referred to by another package.` on Ubuntu 14.04
408
+
409
+ Ubuntu 14.04 changed the name of the ruby 1.8.7 packages. Try this instead:
410
+
411
+ sudo apt-get install build-essential ruby-full ruby
412
+
413
+ ### Freezes at the compilation stage
414
+
415
+ This can happen when the system is low on memory. The installation process starts up
416
+ the compiler, but it gets killed as soon it consumes too much memory.
417
+ Tailing `/var/log/syslog` or `/var/log/messages` will confirm whether or not this is
418
+ occurring.
419
+
420
+ The solution is to temporarily stop any memory intensive tasks, install remote_syslog,
421
+ and then restart them.
422
+
423
+ ## Operations
424
+
425
+ ### Reconnect failures
426
+
427
+ `remote_syslog` depends on I/O code provided by the Ruby VM, `eventmachine` library,
428
+ and OS. There is at least one environment and failure case where `remote_syslog` will
429
+ not reconnect when using the `--tls` option. Although we've never been able to
430
+ reproduce this problem (and known occurrences are correspondingly rare), the dependency
431
+ and problem are worth noting.
432
+
433
+ ### `remote_syslog` not found?
434
+
435
+ It may not be in your path. Run `find / -name remote_syslog` to locate it, then run it
436
+ with the full path (such as `/var/lib/gems/1.8/bin/remote_syslog`).
437
+
438
+ ### The system rebooted and `remote_syslog` didn't start
439
+
440
+ Install an [init file](https://github.com/papertrail/remote_syslog#auto-starting-at-boot).
441
+
442
+ ### Logs not appearing?
443
+
317
444
  Two commands are particularly useful for observing `remote_syslog`
318
445
  behavior. First, its own debugging:
319
446
 
@@ -347,9 +474,11 @@ Once you've made your great commits:
347
474
  5. Create a Pull Request or an [Issue][is] with a link to your branch
348
475
  6. That's it!
349
476
 
477
+ [remote_syslog2]: https://github.com/papertrail/remote_syslog2
350
478
  [sample config]: https://github.com/papertrail/remote_syslog/blob/master/examples/log_files.yml.example
479
+ [available here]: https://github.com/papertrail/remote_syslog/blob/master/examples/
351
480
  [init files]: https://github.com/papertrail/remote_syslog/blob/master/examples/
352
- [init.d]: https://github.com/papertrail/remote_syslog/blob/master/examples/remote_syslog.init.d
481
+ [remote_syslog.init.d]: https://github.com/papertrail/remote_syslog/blob/master/examples/remote_syslog.init.d
353
482
  [launchd]: https://github.com/papertrail/remote_syslog/blob/master/examples/com.papertrailapp.remote_syslog.plist
354
483
  [supervisor]: https://github.com/papertrail/remote_syslog/blob/master/examples/remote_syslog.supervisor.conf
355
484
  [upstart]: https://github.com/papertrail/remote_syslog/blob/master/examples/remote_syslog.upstart.conf
@@ -6,4 +6,4 @@ files:
6
6
  - /var/run/mysqld/mysqld-slow.log
7
7
  destination:
8
8
  host: logs.papertrailapp.com
9
- port: 12345 # Papertrail dest port (default: 514)
9
+ port: 12345 # NOTE: change to your Papertrail port
@@ -6,6 +6,9 @@ files:
6
6
  - /home/**/*.log
7
7
  - /var/log/mysqld.log
8
8
  - /var/run/mysqld/mysqld-slow.log
9
+ exclude_files:
10
+ - old
11
+ - 200\d
9
12
  hostname: www42 # override OS hostname
10
13
  parse_fields: syslog # predefined regex name or double-quoted regex
11
14
  prepend: '0xDEADBEEF: ' # prepend this before every log message
@@ -14,4 +17,5 @@ exclude_patterns:
14
17
  - \d+ things
15
18
  destination:
16
19
  host: logs.papertrailapp.com
17
- port: 12345 # Papertrail dest port (default: 514)¬
20
+ port: 12345 # NOTE: change this to YOUR papertrail port!
21
+ new_file_check_interval: 5 # Check every 5 seconds
@@ -1,5 +1,15 @@
1
1
  #!/bin/bash
2
- #
2
+
3
+ ### BEGIN INIT INFO
4
+ # Provides: remote_syslog
5
+ # Required-Start: $remote_fs $syslog
6
+ # Required-Stop: $remote_fs $syslog
7
+ # Default-Start: 2 3 4 5
8
+ # Default-Stop: 0 1 6
9
+ # Short-Description: Start and Stop
10
+ # Description: Runs remote_syslog
11
+ ### END INIT INFO
12
+
3
13
  # /etc/init.d/remote_syslog
4
14
  #
5
15
  # Starts the remote_syslog daemon
@@ -13,7 +23,7 @@ prog="remote_syslog"
13
23
  config="/etc/log_files.yml"
14
24
  pid_dir="/var/run"
15
25
 
16
- EXTRAOPTIONS="--tls"
26
+ EXTRAOPTIONS=""
17
27
 
18
28
  pid_file="$pid_dir/$prog.pid"
19
29
 
@@ -29,7 +39,7 @@ start(){
29
39
  echo -n $"Starting $prog: "
30
40
 
31
41
  unset HOME MAIL USER USERNAME
32
- $prog -c $config --pid-file $pid_file "$EXTRAOPTIONS"
42
+ $prog -c $config --pid-file=$pid_file $EXTRAOPTIONS
33
43
  RETVAL=$?
34
44
  echo
35
45
  return $RETVAL
@@ -6,4 +6,4 @@ respawn
6
6
 
7
7
  pre-start exec /usr/bin/test -e /etc/log_files.yml
8
8
 
9
- exec /var/lib/gems/1.8/bin/remote_syslog -D --tls
9
+ exec /var/lib/gems/1.8/bin/remote_syslog -D
@@ -1,4 +1,4 @@
1
1
  module RemoteSyslog
2
- VERSION = "1.6.14"
2
+ VERSION = "1.6.15"
3
3
  end
4
4
 
@@ -8,8 +8,8 @@ Gem::Specification.new do |s|
8
8
  ## If your rubyforge_project name is different, then edit it and comment out
9
9
  ## the sub! line in the Rakefile
10
10
  s.name = 'remote_syslog'
11
- s.version = '1.6.14'
12
- s.date = '2013-04-18'
11
+ s.version = '1.6.15'
12
+ s.date = '2015-06-09'
13
13
  s.rubyforge_project = 'remote_syslog'
14
14
 
15
15
  ## Make sure your summary is short. The description may be as long
@@ -40,7 +40,7 @@ Gem::Specification.new do |s|
40
40
  ## List your runtime dependencies here. Runtime dependencies are those
41
41
  ## that are needed for an end user to actually USE your code.
42
42
  #s.add_dependency('DEPNAME', [">= 1.1.0", "< 2.0.0"])
43
- s.add_dependency 'servolux'
43
+ s.add_dependency 'servolux', [ '~> 0.10.0' ]
44
44
  s.add_dependency 'file-tail'
45
45
  s.add_dependency 'eventmachine', [ '>= 0.12.10', '< 1.1' ]
46
46
  s.add_dependency 'eventmachine-tail', [ '>= 0.6.4' ]
metadata CHANGED
@@ -1,119 +1,133 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: remote_syslog
3
- version: !ruby/object:Gem::Version
4
- prerelease: false
5
- segments:
6
- - 1
7
- - 6
8
- - 14
9
- version: 1.6.14
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.6.15
5
+ prerelease:
10
6
  platform: ruby
11
- authors:
7
+ authors:
12
8
  - Troy Davis
13
9
  - Eric Lindvall
14
10
  autorequire:
15
11
  bindir: bin
16
12
  cert_chain: []
17
-
18
- date: 2013-04-18 00:00:00 -07:00
19
- default_executable: remote_syslog
20
- dependencies:
21
- - !ruby/object:Gem::Dependency
13
+ date: 2015-06-09 00:00:00.000000000 Z
14
+ dependencies:
15
+ - !ruby/object:Gem::Dependency
22
16
  name: servolux
23
- prerelease: false
24
- requirement: &id001 !ruby/object:Gem::Requirement
25
- requirements:
26
- - - ">="
27
- - !ruby/object:Gem::Version
28
- segments:
29
- - 0
30
- version: "0"
17
+ requirement: !ruby/object:Gem::Requirement
18
+ none: false
19
+ requirements:
20
+ - - ~>
21
+ - !ruby/object:Gem::Version
22
+ version: 0.10.0
31
23
  type: :runtime
32
- version_requirements: *id001
33
- - !ruby/object:Gem::Dependency
34
- name: file-tail
35
24
  prerelease: false
36
- requirement: &id002 !ruby/object:Gem::Requirement
37
- requirements:
38
- - - ">="
39
- - !ruby/object:Gem::Version
40
- segments:
41
- - 0
42
- version: "0"
25
+ version_requirements: !ruby/object:Gem::Requirement
26
+ none: false
27
+ requirements:
28
+ - - ~>
29
+ - !ruby/object:Gem::Version
30
+ version: 0.10.0
31
+ - !ruby/object:Gem::Dependency
32
+ name: file-tail
33
+ requirement: !ruby/object:Gem::Requirement
34
+ none: false
35
+ requirements:
36
+ - - ! '>='
37
+ - !ruby/object:Gem::Version
38
+ version: '0'
43
39
  type: :runtime
44
- version_requirements: *id002
45
- - !ruby/object:Gem::Dependency
46
- name: eventmachine
47
40
  prerelease: false
48
- requirement: &id003 !ruby/object:Gem::Requirement
49
- requirements:
50
- - - ">="
51
- - !ruby/object:Gem::Version
52
- segments:
53
- - 0
54
- - 12
55
- - 10
41
+ version_requirements: !ruby/object:Gem::Requirement
42
+ none: false
43
+ requirements:
44
+ - - ! '>='
45
+ - !ruby/object:Gem::Version
46
+ version: '0'
47
+ - !ruby/object:Gem::Dependency
48
+ name: eventmachine
49
+ requirement: !ruby/object:Gem::Requirement
50
+ none: false
51
+ requirements:
52
+ - - ! '>='
53
+ - !ruby/object:Gem::Version
56
54
  version: 0.12.10
57
55
  - - <
58
- - !ruby/object:Gem::Version
59
- segments:
60
- - 1
61
- - 1
62
- version: "1.1"
56
+ - !ruby/object:Gem::Version
57
+ version: '1.1'
63
58
  type: :runtime
64
- version_requirements: *id003
65
- - !ruby/object:Gem::Dependency
66
- name: eventmachine-tail
67
59
  prerelease: false
68
- requirement: &id004 !ruby/object:Gem::Requirement
69
- requirements:
70
- - - ">="
71
- - !ruby/object:Gem::Version
72
- segments:
73
- - 0
74
- - 6
75
- - 4
60
+ version_requirements: !ruby/object:Gem::Requirement
61
+ none: false
62
+ requirements:
63
+ - - ! '>='
64
+ - !ruby/object:Gem::Version
65
+ version: 0.12.10
66
+ - - <
67
+ - !ruby/object:Gem::Version
68
+ version: '1.1'
69
+ - !ruby/object:Gem::Dependency
70
+ name: eventmachine-tail
71
+ requirement: !ruby/object:Gem::Requirement
72
+ none: false
73
+ requirements:
74
+ - - ! '>='
75
+ - !ruby/object:Gem::Version
76
76
  version: 0.6.4
77
77
  type: :runtime
78
- version_requirements: *id004
79
- - !ruby/object:Gem::Dependency
80
- name: syslog_protocol
81
78
  prerelease: false
82
- requirement: &id005 !ruby/object:Gem::Requirement
83
- requirements:
79
+ version_requirements: !ruby/object:Gem::Requirement
80
+ none: false
81
+ requirements:
82
+ - - ! '>='
83
+ - !ruby/object:Gem::Version
84
+ version: 0.6.4
85
+ - !ruby/object:Gem::Dependency
86
+ name: syslog_protocol
87
+ requirement: !ruby/object:Gem::Requirement
88
+ none: false
89
+ requirements:
84
90
  - - ~>
85
- - !ruby/object:Gem::Version
86
- segments:
87
- - 0
88
- - 9
89
- - 2
91
+ - !ruby/object:Gem::Version
90
92
  version: 0.9.2
91
93
  type: :runtime
92
- version_requirements: *id005
93
- - !ruby/object:Gem::Dependency
94
- name: em-resolv-replace
95
94
  prerelease: false
96
- requirement: &id006 !ruby/object:Gem::Requirement
97
- requirements:
98
- - - ">="
99
- - !ruby/object:Gem::Version
100
- segments:
101
- - 0
102
- version: "0"
95
+ version_requirements: !ruby/object:Gem::Requirement
96
+ none: false
97
+ requirements:
98
+ - - ~>
99
+ - !ruby/object:Gem::Version
100
+ version: 0.9.2
101
+ - !ruby/object:Gem::Dependency
102
+ name: em-resolv-replace
103
+ requirement: !ruby/object:Gem::Requirement
104
+ none: false
105
+ requirements:
106
+ - - ! '>='
107
+ - !ruby/object:Gem::Version
108
+ version: '0'
103
109
  type: :runtime
104
- version_requirements: *id006
105
- description: Lightweight daemon to tail one or more log files and transmit UDP syslog messages to a remote syslog host (centralized log aggregation). Generates UDP packets itself instead of depending on a system syslog daemon, so it doesn't affect system-wide logging configuration.
106
- email:
110
+ prerelease: false
111
+ version_requirements: !ruby/object:Gem::Requirement
112
+ none: false
113
+ requirements:
114
+ - - ! '>='
115
+ - !ruby/object:Gem::Version
116
+ version: '0'
117
+ description: Lightweight daemon to tail one or more log files and transmit UDP syslog
118
+ messages to a remote syslog host (centralized log aggregation). Generates UDP packets
119
+ itself instead of depending on a system syslog daemon, so it doesn't affect system-wide
120
+ logging configuration.
121
+ email:
107
122
  - troy@sevenscale.com
108
123
  - eric@sevenscale.com
109
- executables:
124
+ executables:
110
125
  - remote_syslog
111
126
  extensions: []
112
-
113
- extra_rdoc_files:
127
+ extra_rdoc_files:
114
128
  - README.md
115
129
  - LICENSE
116
- files:
130
+ files:
117
131
  - Gemfile
118
132
  - LICENSE
119
133
  - README.md
@@ -137,35 +151,30 @@ files:
137
151
  - lib/remote_syslog/udp_endpoint.rb
138
152
  - remote_syslog.gemspec
139
153
  - test/unit/message_generator_test.rb
140
- has_rdoc: true
141
154
  homepage: http://github.com/papertrail/remote_syslog
142
155
  licenses: []
143
-
144
156
  post_install_message:
145
- rdoc_options:
157
+ rdoc_options:
146
158
  - --charset=UTF-8
147
- require_paths:
159
+ require_paths:
148
160
  - lib
149
- required_ruby_version: !ruby/object:Gem::Requirement
150
- requirements:
151
- - - ">="
152
- - !ruby/object:Gem::Version
153
- segments:
154
- - 0
155
- version: "0"
156
- required_rubygems_version: !ruby/object:Gem::Requirement
157
- requirements:
158
- - - ">="
159
- - !ruby/object:Gem::Version
160
- segments:
161
- - 0
162
- version: "0"
161
+ required_ruby_version: !ruby/object:Gem::Requirement
162
+ none: false
163
+ requirements:
164
+ - - ! '>='
165
+ - !ruby/object:Gem::Version
166
+ version: '0'
167
+ required_rubygems_version: !ruby/object:Gem::Requirement
168
+ none: false
169
+ requirements:
170
+ - - ! '>='
171
+ - !ruby/object:Gem::Version
172
+ version: '0'
163
173
  requirements: []
164
-
165
174
  rubyforge_project: remote_syslog
166
- rubygems_version: 1.3.6
175
+ rubygems_version: 1.8.23.2
167
176
  signing_key:
168
177
  specification_version: 2
169
- summary: Monitor plain text log file(s) for new entries and send to remote syslog collector
178
+ summary: Monitor plain text log file(s) for new entries and send to remote syslog
179
+ collector
170
180
  test_files: []
171
-