#!/bin/bash

DB_NAME=`cat /opt/warden-server/etc/warden-server.conf | grep DB_NAME | sed 's/[";]//g' |awk '{print $3}'`
DB_USER=`cat /opt/warden-server/etc/warden-server.conf | grep DB_USER | sed 's/[";]//g' |awk '{print $3}'`
DB_PASS=`cat /opt/warden-server/etc/warden-server.conf | grep DB_PASS | sed 's/[";]//g' |awk '{print $3}'`
DB_HOST=`cat /opt/warden-server/etc/warden-server.conf | grep DB_HOST | sed 's/[";]//g' |awk '{print $3}'`

echo "SELECT FROM_UNIXTIME( UNIX_TIMESTAMP( received ) - ( UNIX_TIMESTAMP( received ) % ( 60 ) ) ) AS t, COUNT( id ) FROM events GROUP BY t" | mysql -h $DB_HOST -u $DB_USER $DB_NAME 
apache2ctl status 
echo -n "" 
uptime
echo -n klientu: ; netstat -nlpa | grep :443 | grep ESTA |wc -l; 
echo -n FIN:; netstat | grep WAIT2 | wc -l

