Skip to content

Instantly share code, notes, and snippets.

@hewigovens
Created October 6, 2011 07:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save hewigovens/1266796 to your computer and use it in GitHub Desktop.
Save hewigovens/1266796 to your computer and use it in GitHub Desktop.
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