Skip to main content

Posts

Showing posts from February, 2010

samplicator system-v startup scripts

Samplicator looks like a great UDP fan-out tool for Linux/Unix. Unfortunately, it doesn't have proper startup/shutdown scripts. Here are, for your convenience such startup scripts adapted from apmd (currently tested only on Linux). Dependencies are: GNU grep and perl (to emulate a PID mechanism). #!/bin/sh # # chkconfig: 2345 26 74 # description: samplicator is a daemon to fanout UPD packets # processname: samplicator-syslog # Source function library. . /etc/init.d/functions RETVAL=0 SERVICE="syslog" UDPLISTENPORT=514 SOURCEIP="10.0.250.131" DESTINATIONS="10.0.250.132/514 10.0.250.61/514"; PIDFILE="samplicator-$SERVICE.pid" start() { echo -n $"Starting up samplicator-$SERVICE daemon: " daemon --check samplicator-$SERVICE /usr/bin/samplicate -f -p $UDPLISTENPORT -s $SOURCEIP -b 8388608 -S $DESTINATIONS; netstat -upan | grep -P "$SOURCEIP:$UDPLISTENPORT.*samplicate" | perl -e 'my $line= ; $line=~/([0-9]+)\/