CentOS linux 內鍵的 logger 作不到,所以重新編譯 logger
wget https://mirrors.edge.kernel.org/pub/linux/utils/util-linux/v2.32/util-linux-2.32.tar.gz tar zxvf util-linux-2* cd util-linux-2* ./configure make
再
./logger -d -i -n 1.1.1.1 -P 514 --tag "testtag" "testmessages" -p local7.debug
其實 nc 也可以作得到
echo -n "testmessages" | nc -4u -w1 1.1.1.1 514
留言