Create a gist now

Instantly share code, notes, and snippets.

Embed
Simple script for goagent statistic
#!/bin/bash
python_count=0
toggle_count=0
local_count=0
log_list=$(ls /etc/httpd/logs/access_log*)
for log in $log_list
do
tmp=$(cat $log | grep python | wc -l)
((python_count+=tmp))
echo "python2.6 in $log installed $tmp"
tmp=$(cat $log | grep toggle | wc -l)
((toggle_count+=tmp))
echo "toggle in $log installed $tmp"
tmp=$(cat $log | grep goagent-local | wc -l)
((local_count+=tmp))
echo "local in $log installed $tmp"
done
echo "Total:"
echo "python2.6 package installed $python_count times"
echo "goagent toggle package installed $toggle_count times"
echo "goagent local package installed $local_count times"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment