Filippo Giunchedi has uploaded a new change for review. (
https://gerrit.wikimedia.org/r/337798 )
Change subject: udp2log: fix mirroring of received packets
......................................................................
udp2log: fix mirroring of received packets
As it turns out, log2udp output isn't compatible with udp2log input
because the former is length-prefixed. Use socat instead to relay all
packets received.
Bug: T123728
Change-Id: Id3a4a6daaf78bef23288e75d37f3e1d855f823cc
---
M modules/udp2log/manifests/instance.pp
M modules/udp2log/templates/filters.mw.erb
2 files changed, 7 insertions(+), 1 deletion(-)
git pull ssh://gerrit.wikimedia.org:29418/operations/puppet
refs/changes/98/337798/1
diff --git a/modules/udp2log/manifests/instance.pp
b/modules/udp2log/manifests/instance.pp
index 8d5e651..9a72a1c 100644
--- a/modules/udp2log/manifests/instance.pp
+++ b/modules/udp2log/manifests/instance.pp
@@ -21,6 +21,8 @@
# udp2log_logrotate.erb
# $forward_messages - Whether to forward received messages to other hosts.
# Default: false
+# $mirror_destinations - Mirror received packets onto these hosts, using $port
+# Default: undef
#
define udp2log::instance(
$ensure = present,
@@ -51,6 +53,10 @@
require_package('udplog')
+ if $mirror_destinations {
+ require_package('socat')
+ }
+
base::service_unit { "udp2log-${name}":
ensure => $ensure,
sysvinit => true,
diff --git a/modules/udp2log/templates/filters.mw.erb
b/modules/udp2log/templates/filters.mw.erb
index 9da15c0..829e0e2 100644
--- a/modules/udp2log/templates/filters.mw.erb
+++ b/modules/udp2log/templates/filters.mw.erb
@@ -17,7 +17,7 @@
<% if @mirror_destinations -%>
<% @mirror_destinations.each do |destination| -%>
-pipe 1 /usr/bin/log2udp -h <%= destination %> -p 8420
+pipe 1 /usr/bin/socat - UDP-SENDTO:<%= destination %>:8420
<% end -%>
<% end -%>
--
To view, visit https://gerrit.wikimedia.org/r/337798
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Id3a4a6daaf78bef23288e75d37f3e1d855f823cc
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Filippo Giunchedi <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits