The Daily Shaarli
When receiving messages using the UDP protocol, increase the size of the UDP receive buffer on the receiver host (that is, the syslog-ng OSE server or relay receiving the messages). Note that on certain platforms, for example, on Red Hat Enterprise Linux 5, even low message load (~200 messages per second) can result in message loss, unless the so_rcvbuf() option of the source is increased. In such cases, you will need to increase the net.core.rmem_max parameter of the host (for example, to 1024000), but do not modify net.core.rmem_default parameter.
As a general rule, increase the so_rcvbuf() so that the buffer size in kilobytes is higher than the rate of incoming messages per second. For example, to receive 2000 messages per second, set the so_rcvbuf() at least to 2 097 152 bytes.
Prenons un bash qui ouput sur sa sortie standard (stdout) et sur sa sortie d'erreur (stderr) :
echo good
echo bad >&2
echo vanish >&2
echo good!
Comment faire pour rediriger la sortie standard vers un fichier (ou /dev/null pour l'exemple) et filter la sortie d'erreur pour retirer la ligne "vanish" ?
Pour ça il faut utiliser un process substitution :
/root/test.bash 2> >(grep -v vanish >&2) >/dev/null
Bien pratique dans un crontab pour recevoir un peu moins de mail lorsqu'on a des "erreurs" acceptables (rsync vanished par exemple)
SHELL=/bin/bash
Pour en savoir plus sur les process substitution : http://tldp.org/LDP/abs/html/process-sub.html
