Changes
Jump to navigation
Jump to search
← Older edit
Newer edit →
Google charts
(view source)
Revision as of 21:59, 26 November 2015
620 bytes removed
,
21:59, 26 November 2015
no edit summary
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:
−
<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\'
+
<source lang="
html
">#/usr/bin
−
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>
−
−
<source lang="
html4strict
">#/usr/bin
while true
while true
Warren
80
edits
Navigation menu
Personal tools
Log in
Namespaces
Page
Discussion
Variants
Views
Read
View source
View history
More
Search
Koozali SME Server
Main Page
Welcome
Releases
Testimonials
Documentation
SME Server FAQ
Volunteering
Commercial Support
Recent activities
Dashboard
Recent wiki changes
Recent bug changes
Unread Forum posts
Koozali resources
Contribs
How-To's
Forums
Bugzilla
Mailing Lists
Translations
Download
Koozali SME Server wiki
Wiki statistics
Wiki categories
Wiki Help
Koozali Wiki Help
Tools
Special pages
Printable version