This is a discussion on [rrd-users] Re: CPU usage RRD-DS Please help within the RRD Users forums, part of the Networking and Network Related category; On Fri, Oct 13, 2006 at 10:05:38AM +0900, Mr. Suhas Ghosh wrote: > Hi all. > I want ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
On Fri, Oct 13, 2006 at 10:05:38AM +0900, Mr. Suhas Ghosh wrote:
> Hi all. > I want to display CPU usage graph(perl script+rrdtool) > 1. 6h > 2. 1day > 3.1week. > 4. 1 month > 5. 1 year. > I want to collect data from /proc/stat. > I am using these command > my $usr = `cat /proc/stat | grep "cpu" --max-count=1 |cut -d" " -f3|cut -d" > " -f2 |sed 's/ //g'`; although this is not perl either may I recommend using: | awk 'BEGIN {printf "%s",systime()}/^cpu[^0-9]+/{printf ":%s:%s:%s:%s:%s:%s:%s",$2,$3,$4,$7,$8,$6,$5} END {printf " "}' /proc/stat -- Unsubscribe mailto:rrd-users-request@list.ee.ethz.ch?subject=unsubscribe Help mailto:rrd-users-request@list.ee.ethz.ch?subject=help Archive http://lists.ee.ethz.ch/rrd-users WebAdmin http://lists.ee.ethz.ch/lsg2.cgi |