Tuesday, August 20, 2013

playing with logfiles...

After setting up our zabbix system at work to monitor most of the servers, I'm still trying to analyze our database server and logs a bit more. Since the system seems to be under quite a high load recently.

The easiest way todo this, was like always a little awk scripts to analyze some statistics from our log files and point me in the right directions

cat pg_log/postgresql-2013-08-*.log |  grep duration | awk -F ':' '{ print $7, $0 }' | grep execute | awk  '{ total += $1; count++; print $0 } END { print "average query speed: ", total/count, " count of queries: ",  count }'