[rrd-users] Re: CPU usage RRD-DS Please help

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 ...


Go Back   Usenet Forums > Networking and Network Related > RRD Users

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 10-13-2006
Fabien Wernli
 
Posts: n/a
Default [rrd-users] Re: CPU usage RRD-DS Please help

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

Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 04:32 PM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0