Line 18:
Line 18:
1.Prepare the collection of the relevant parameters that you want to monitor ( in this case, http stats )
1.Prepare the collection of the relevant parameters that you want to monitor ( in this case, http stats )
create a shell script:
create a shell script:
−
F. Edit the ehour config file to use the MySQL database
+
#/usr/bin
−
/opt/ehour/home/conf/ehour.properties
−
−
<source lang="english"> >#/usr/bin
−
while true
while true
do
do
Line 30:
Line 26:
DAY=$(date +"%F"+"%T")
DAY=$(date +"%F"+"%T")
now=$(date +'%Y-%m-%d %H:%M:%S')
now=$(date +'%Y-%m-%d %H:%M:%S')
−
##echo $OUTPUT \'$DAY\'
##echo $OUTPUT \'$DAY\'
echo $OUTPUT \'$DAY\' | awk '{print "INSERT INTO performance (mem_used, process_size, processors_used,period) VALUES ( "$5", "$10", "$13", "$14" );"}' | mysql --user=username --password=password database_name
echo $OUTPUT \'$DAY\' | awk '{print "INSERT INTO performance (mem_used, process_size, processors_used,period) VALUES ( "$5", "$10", "$13", "$14" );"}' | mysql --user=username --password=password database_name
sleep 120
sleep 120
−
done</source>
+
done