PDA

Bekijk de volledige versie : Help needed adding my own messages to syslog



kantjer
15-05-2006, 11:31
I have managed to connect my Topfield satellite tuner to my network using a Asus WL-500gx running the latest Oleg fw.

I have now setup a few scripts that run on specific intervals as set out in the Crobtab Tutorial.
The last thing I want to do is send the outcome of the scripts to the Asus syslog.

I tried adding the following to my scripts:

Now=$(date "+%B %d %T")
echo "$Now My own message." >>/tmp/syslog.log

If I execute the script manually it adds the message to the syslog, but when executed trough cron it doesn’t seem to work (the script is executed only no message in syslog).

Any tips what I might be doing wrong or forgetting.
Thanks
kantjer

oleo
15-05-2006, 12:01
Use logger utility.

kantjer
15-05-2006, 15:51
Use logger utility.

Thanks, didn't know that function.
Its all working now, and much easier than my solution.

ptnemot
07-03-2007, 08:20
I want to use the syslog-ng package to enable some more advanced logging on my WL-500gP.

Before actually installing the package I read the README.optware file included in the syslog-ng package. There it states the following:

"Before using syslog-ng, you must disable the built-in syslog provided by
Unslung 6.x. To do that, comment the two lines on /etc/inittab that mention
syslogd and klog by adding '#' to the beginning of each line"

Now I don't have these files on my WL-500g with Oleg firmware, and I can't figure out what exactly is triggering the syslog process on the WL)500g. So what should I do to disable syslog? Would there be any issue if I keep syslog running in parallel to syslog-ng?

Thanks for your help.

Peter.

Tamadite
24-06-2008, 22:30
Oleg firmware 1.9.2.7-10 logs an entry like the following every 10 seconds.


ACCEPT IN=lo OUT= MAC=00:00:00:00:00:00:00:00:00:00:00:00:08:00 SRC=127.0.0.1 DST=127.0.0.1 LEN=60 TOS=0x00 PREC=0x00 TTL=64 ID=15709 DF PROTO=TCP SPT=1122 DPT=80
(This entry is triggered by the watchdog process)

In order to avoid this sort of entry in the log I have added the following lines to the post-firewall.


iptables -N NOLOGAC
iptables -A NOLOGAC -j ACCEPT
iptables -I INPUT -p tcp --dport 80 -s 127.0.0.1 -d 127.0.0.1 -j NOLOGAC

On the other hand if you want to avoid entries in your log for packets that are continuously dropped, for instance IGMP traffic from your ISP you can add the following to the post-firewall:


iptables -N NOLOGDP
iptables -A NOLOGDP -j DROP
iptables -I INPUT -i vlan1 -p igmp -j NOLOGDP

Another simple way to restrict the amount of messages in the log is via the level of severity parameter "-l" (syslogd). It is set to "-l 7" by default which is perfect for me.


PS: I guess there are more elegant ways to do the same. Perhaps this HowTo can provide some other ideas.