Howto import SAR data into a PostgreSQL database and create graphs in

This is a walkthrough on how to get SAR data into a database, and use to create nice graphs using a JDBC connection to that database, and SUN Report Builder to do the graphs.

In this example I will use SAR's CPU utilisation data.

Software used:

Howto: Log firewall from OpenWrt to a remote rsyslog

This is how I got remote logging from my OpenWrt router to the syslog daemon on the server box.

On the server side, I enabled remote logging over UDP (refer to the rsyslog or syslog-ng documentation).

On the OpenWRT box following steps are needed

Enable remote syslog logging

Edit /etc/config/system and enable remote logging by adding:

option 'log_ip' ''

Now reboot the router and see if it logs correctly.

Bash pattern matching

BASH offers a nice way to replace patterns. Until now I always used basename and a variable.
For example moving all .jpeg files in a folder to .jpg (hey, it's just an example..)

for moo in *.jpeg; do
    newname="`basename $moo .jpeg`.jpg"
    mv $moo $newname

But isn't that just plain ugly? That one is lot nicer:

for i in *.jpeg; do
    mv "$i" "${i%.*}.jpg"