le1t0-deprec 2.1.6.050 → 2.1.6.051

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG CHANGED
@@ -1,5 +1,9 @@
1
1
  # deprec changelog
2
2
 
3
+ = 2.1.6.051 (Aug 4, 2010)
4
+
5
+ * fixed syslog config writing
6
+
3
7
  = 2.1.6.050 (Aug 4, 2010)
4
8
 
5
9
  * fixed syslog_ng script
@@ -53,7 +53,7 @@ Capistrano::Configuration.instance(:must_exist).load do
53
53
  set :syslog_ng_sources, {
54
54
  :s_all => [
55
55
  "internal()",
56
- "unix-stream(/dev/log)",
56
+ "unix-stream(\"/dev/log\")",
57
57
  "file(\"/proc/kmsg\" log_prefix(\"kernel: \"))"
58
58
  ]
59
59
  }
@@ -86,7 +86,7 @@ Capistrano::Configuration.instance(:must_exist).load do
86
86
  :f_messages => "level(info,notice,warn) and not facility(auth,authpriv,cron,daemon,mail,news)",
87
87
  :f_emerg => "level(emerg)",
88
88
  :f_xconsole => "facility(daemon,mail) or level(debug,info,notice,warn) or (facility(news) and level(crit,err,notice))",
89
- :f_daemons => "program(\"(rails|apache|postfix|haproxy|mysql|keepalived|sphinx|firewall)-.*\")"
89
+ :f_daemons => "program(\"(rails-|apache-|.*mysqld|Keepalived).*\")"
90
90
  }
91
91
  set :syslog_ng_destinations, {
92
92
  :df_auth => "file(\"/var/log/auth.log\")",
@@ -119,6 +119,7 @@ Capistrano::Configuration.instance(:must_exist).load do
119
119
  :df_messages => "file(\"/var/log/messages\")",
120
120
  :dp_xconsole => "pipe(\"/dev/xconsole\")",
121
121
  :du_all => "usertty(\"*\")",
122
+ :df_kernel => "file(\"/var/log/daemons/kernel-$HOST/$YEAR$MONTH/$DAY/kernel-$HOST-$YEAR$MONTH$DAY\")",
122
123
  :df_daemons => "file(\"/var/log/daemons/$PROGRAM/$YEAR$MONTH/$DAY/$PROGRAM-$YEAR$MONTH$DAY\")"
123
124
  }
124
125
 
@@ -1,36 +1,31 @@
1
- options {<% syslog_ng_options.merge(syslog_ng_is_server && syslog_ng_server && syslog_use_default_dynamic_settings ? {
1
+ options {
2
+ <%
3
+ _options = syslog_ng_options.merge(syslog_ng_is_server && syslog_ng_server && syslog_use_default_dynamic_settings ? {
2
4
  :keep_hostname => :yes
3
- } : {}).each do |key, value| %>
4
- <%= value.nil? ? "" : "#{key}(#{value.is_a?(String) ? "\"#{value}\"" : value.to_s});" %>
5
- <% end %>};
5
+ } : {})
6
+ _options.keys.sort { |a,b| a.to_s <=> b.to_s }.each do |key| value = _options[key]
7
+ %><%= value.nil? ? "" : " #{key}(#{value.is_a?(String) ? "\"#{value}\"" : value.to_s});\n" %><% end %>};
6
8
 
7
- <% syslog_ng_sources.merge(syslog_ng_is_server && syslog_ng_server && syslog_use_default_dynamic_settings ? {
9
+ <% _sources = syslog_ng_sources.merge(syslog_ng_is_server && syslog_ng_server && syslog_use_default_dynamic_settings ? {
8
10
  :s_net => "tcp(ip(#{syslog_ng_server}) port(#{syslog_ng_server_port || 5140}) max-connections(#{syslog_ng_server_max_connections || 10}));"
9
- } : {}).each do |name, syslog_ng_source_list| %>
10
- source <%= name %> {
11
- <% [syslog_ng_source_list].flatten.each do |syslog_ng_source| %>
12
- <%= syslog_ng_source.gsub(/;$/, '') %>;
13
- <% end %>
14
- };
15
- <% end %>
11
+ } : {})
12
+ _sources.keys.sort { |a,b| a.to_s <=> b.to_s }.each do |name| syslog_ng_source_list = _sources[name]
13
+ %>source <%= name %> {
14
+ <% [syslog_ng_source_list].flatten.sort { |a,b| a.to_s <=> b.to_s }.each do |syslog_ng_source|
15
+ %><%= " #{syslog_ng_source.gsub(/;$/, '')};\n" %><% end %>};
16
16
 
17
- <% syslog_ng_filters.each do |name, syslog_ng_filter_list| %>
18
- filter <%= name %> {
19
- <% [syslog_ng_filter_list].flatten.each do |syslog_ng_filter| %>
20
- <%= syslog_ng_filter.gsub(/;$/, '') %>;
21
- <% end %>
22
- };
23
- <% end %>
17
+ <% end %><% syslog_ng_filters.keys.sort { |a,b| a.to_s <=> b.to_s }.each do |name| syslog_ng_filter_list = syslog_ng_filters[name]
18
+ %>filter <%= name %> {
19
+ <% [syslog_ng_filter_list].flatten.sort { |a,b| a.to_s <=> b.to_s }.each do |syslog_ng_filter|
20
+ %><%= " #{syslog_ng_filter.gsub(/;$/, '')};\n" %><% end %>};
24
21
 
25
- <% syslog_ng_destinations.merge(syslog_ng_server.nil? || syslog_ng_is_server || !syslog_use_default_dynamic_settings ? {} : { :d_log_server => "tcp(\"#{syslog_ng_server}\" port(#{syslog_ng_server_port || 5140}));" }).each do |name, syslog_ng_destination_list| %>
26
- destination <%= name %> {
27
- <% [syslog_ng_destination_list].flatten.each do |syslog_ng_destination| %>
28
- <%= syslog_ng_destination.gsub(/;$/, '') %>;
29
- <% end %>
30
- };
31
- <% end %>
22
+ <% end %><% _destinations = syslog_ng_destinations.merge(syslog_ng_server.nil? || syslog_ng_is_server || !syslog_use_default_dynamic_settings ? {} : { :d_log_server => "tcp(\"#{syslog_ng_server}\" port(#{syslog_ng_server_port || 5140}));" })
23
+ _destinations.keys.sort { |a,b| a.to_s <=> b.to_s }.each do |name| syslog_ng_destination_list = _destinations[name]
24
+ %>destination <%= name %> {
25
+ <% [syslog_ng_destination_list].flatten.sort { |a,b| a.to_s <=> b.to_s }.each do |syslog_ng_destination|
26
+ %><%= " #{syslog_ng_destination.gsub(/;$/, '')};\n" %><% end %>};
32
27
 
33
- <% syslog_ng_logs.merge(syslog_ng_is_server && syslog_use_default_dynamic_settings ? {
28
+ <% end %><% _logs = syslog_ng_logs.merge(syslog_ng_is_server && syslog_use_default_dynamic_settings ? {
34
29
  # on syslog master/central server daemon
35
30
  :s_net => {
36
31
  :df_daemons => {
@@ -70,7 +65,9 @@ destination <%= name %> {
70
65
  :flags => :final
71
66
  }
72
67
  }
73
- } : {}).each do |source_name, destinations_filters|
68
+ } : {})
69
+ _logs.keys.sort { |a,b| a.to_s <=> b.to_s }.each do |source_name|
70
+ destinations_filters = _logs[source_name]
74
71
  if source_name == :s_all && syslog_ng_server && syslog_use_default_dynamic_settings && !syslog_ng_is_server
75
72
  # on syslog client daemon
76
73
  destinations_filters.merge!(
@@ -85,17 +82,15 @@ destination <%= name %> {
85
82
  [ :df_local7, :d_log_server ] => { :filters => :f_local7, :flags => :final }
86
83
  )
87
84
  end
88
- destinations_filters.each do |destinations, filters| %>
89
- log {
85
+ destinations_filters.keys.sort { |a,b| a.to_s <=> b.to_s }.each do |destinations| filters = destinations_filters[destinations]
86
+ %>log {
90
87
  source(<%= source_name %>);
91
- <% [filters.is_a?(Hash) ? filters[:filters] : filters].flatten.each do |syslog_filter| %>
92
- filter(<%= syslog_filter %>);
93
- <% end %>
94
- <% [destinations].flatten.each do |destination| %>
95
- destination(<%= destination %>);
96
- <% end %>
97
- <% [filters.is_a?(Hash) ? filters[:flags] : []].flatten.each do |flag| %>
98
- flags(<%= flag %>);
99
- <% end %>
100
- };
101
- <% end end %>
88
+ <% [filters.is_a?(Hash) ? filters[:filters] : filters].flatten.sort { |a,b| a.to_s <=> b.to_s }.each do |syslog_filter|
89
+ %> filter(<%= syslog_filter %>);
90
+ <% end %><% [destinations].flatten.sort { |a,b| a.to_s <=> b.to_s }.each do |destination|
91
+ %> destination(<%= destination %>);
92
+ <% end %><% [filters.is_a?(Hash) ? filters[:flags] : []].flatten.sort { |a,b| a.to_s <=> b.to_s }.each do |flag|
93
+ %> flags(<%= flag %>);
94
+ <% end %>};
95
+
96
+ <% end end %>
metadata CHANGED
@@ -6,8 +6,8 @@ version: !ruby/object:Gem::Version
6
6
  - 2
7
7
  - 1
8
8
  - 6
9
- - 50
10
- version: 2.1.6.050
9
+ - 51
10
+ version: 2.1.6.051
11
11
  platform: ruby
12
12
  authors:
13
13
  - Le1t0