#!/bin/bashcpu=`top -b -n 2|grep %id`mem=`top -b -n 1|grep Mem`cpu=`echo $cpu|cut -d \n -f2|cut -d ":" -f2|cut -d "%" -f1| grep -o "[^ ]\+\( \+[^ ]\+\)*"`mem_total=`echo $mem|cut -d ":" -f2|cut -d "k" -f1| grep -o "[^ ]\+\( \+[^ ]\+\)*"`mem_used=`echo $mem|cut -d "," -f2|cut -d "k" -f1| grep -o "[^ ]\+\( \+[^ ]\+\)*"`mem=`awk 'BEGIN{printf "%.2f",('$mem_used'/'$mem_total')*100}'`echo $cpu $memcurl "http://10.204.1.11/system?cpu=$cpu&mem=$mem" --silent