Hi all I want to monitor my loadtime of an website. If the loadtime is bigger than 30s the apache2 should restart. For the loadtime found this: Code: (time wget -p --no-cache --delete-after www.linuxweblog.com -q ) 2>&1 | awk '/real/ {print $2}' output Code: 0m0.207s How could I do the rest? Thanks admins
I don't know wich Linux Distri do you have but try some like this: Code: #!/bin/sh VAR_TIME="$( TIMEFORMAT='%R';time (wget -p --no-cache --delete-after www.linuxweblog.com -q) 2>&1 1>/dev/null )" float_test() { echo | awk 'END { exit ( !( '"$1"')); }' } float_test "$VAR_TIME > 30.000" && /etc/init.d/apache2 restart save this as a shell file like monitor.sh an then make a cronjob for this... I don't have tried it, so i don't know if it works...