Hi Merlin,
I use logged packets accepted to WOL my server based on a port trigger.
Meaning, if I go to https://MYDOMAIN:8088 it triggers an accepted packet in the logs and a script running in the background WOL the server.
The script I am using is the one in the GitHub FAQ.
Now, the issue is, the ACCEPTED logged packets are so many that syslog is rotating every 5-10 min which causes high usage in CPU or RAM and causes online games to lag out for a few seconds and disconnected.
I checked if the script itself was using high CPU or RAM, but this is not the case.
Is there any way to do this differently or logging the ACCEPTED packets to a different file (in external storage).
Or, is there a different logging I can use?
Thanks in advance.
Router: AC66U
Firmware: Latest BETA: 380.68_beta1
Script:
#!/bin/sh
INTERVAL=5
NUMP=3
OLD=""
TARGET=192.168.1.100
PORT=8088
IFACE=br0
MAC=44:8A:5B:65:11:0C
WOL=/usr/sbin/ether-wake
LOGFILE="/jffs/scripts/ether-wake.log"
while sleep $INTERVAL;do
NEW=`dmesg | awk '/ACCEPT/ && /DST='"$TARGET"'/ && /DPT='"$PORT"'/ {print }' | tail -1`
SRC=`echo $NEW | awk -F'[=| ]' '{print $8}'`
DPORT=`echo $NEW | awk -F'[=| ]' '{print $27}'`
PROTO=`echo $NEW | awk -F'[=| ]' '{print $23}'`
if [ "$NEW" != "" -a "$NEW" != "$OLD" ]; then
if ! ping -qc $NUMP $TARGET >/dev/null; then
echo "WAKE $TARGET requested by $SRC, port $DPORT, protocol $PROTO at" `date`>> $LOGFILE
$WOL -i $IFACE $MAC
sleep 5
fi
OLD=$NEW
fi
done
Cheers,
I use logged packets accepted to WOL my server based on a port trigger.
Meaning, if I go to https://MYDOMAIN:8088 it triggers an accepted packet in the logs and a script running in the background WOL the server.
The script I am using is the one in the GitHub FAQ.
Now, the issue is, the ACCEPTED logged packets are so many that syslog is rotating every 5-10 min which causes high usage in CPU or RAM and causes online games to lag out for a few seconds and disconnected.
I checked if the script itself was using high CPU or RAM, but this is not the case.
Is there any way to do this differently or logging the ACCEPTED packets to a different file (in external storage).
Or, is there a different logging I can use?
Thanks in advance.
Router: AC66U
Firmware: Latest BETA: 380.68_beta1
Script:
#!/bin/sh
INTERVAL=5
NUMP=3
OLD=""
TARGET=192.168.1.100
PORT=8088
IFACE=br0
MAC=44:8A:5B:65:11:0C
WOL=/usr/sbin/ether-wake
LOGFILE="/jffs/scripts/ether-wake.log"
while sleep $INTERVAL;do
NEW=`dmesg | awk '/ACCEPT/ && /DST='"$TARGET"'/ && /DPT='"$PORT"'/ {print }' | tail -1`
SRC=`echo $NEW | awk -F'[=| ]' '{print $8}'`
DPORT=`echo $NEW | awk -F'[=| ]' '{print $27}'`
PROTO=`echo $NEW | awk -F'[=| ]' '{print $23}'`
if [ "$NEW" != "" -a "$NEW" != "$OLD" ]; then
if ! ping -qc $NUMP $TARGET >/dev/null; then
echo "WAKE $TARGET requested by $SRC, port $DPORT, protocol $PROTO at" `date`>> $LOGFILE
$WOL -i $IFACE $MAC
sleep 5
fi
OLD=$NEW
fi
done
Cheers,
Last edited: