Changes

From SME Server
Jump to navigationJump to search
617 bytes removed ,  21:28, 26 November 2015
no edit summary
Line 19: Line 19:  
create a shell script:
 
create a shell script:
   −
{| class="wikitable"
+
yum install java dejavu*
|-
  −
| <nowiki>
  −
#/usr/bin
  −
 
  −
while true
  −
do
  −
LOG=outlog.txt
  −
OUTPUT=$(ps -ylC httpd | awk '{x += $8;y += 1} END {print "Apache Memory Usage (MB): "x/1024; print ":Average Proccess Size (MB): "x/((y-1)*1024)}' && echo -n ':Apache Processes: ' && ps -C httpd --no-headers | wc -l  )
  −
#DAY=$(date +"%F %H:%M:%S")
  −
DAY=$(date +"%F"+"%T")
  −
now=$(date +'%Y-%m-%d %H:%M:%S')
  −
 
  −
##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
  −
sleep 120
  −
done</nowiki>
  −
|}
 
80

edits

Navigation menu