[rrd-users] Help for GPRINT

2006-10-10 Thread [EMAIL PROTECTED]
Hi
I use rrdtool with mrtg on a windows server, no problems for creating 
rrdtool graphs, but i have a little problem with the GPRINT comand:

rrdtool graph test.png --imgformat=PNG --start=-86400 --end=-300 
--title=Localhost - CPU Utilization - CPU0 --rigid --base=1000 --height=120 
--width=500 --alt-autoscale-max --lower-limit=0 --vertical-label=percent 
--slope-mode DEF:a=cpu.rrd:ds1:AVERAGE AREA:a#FF:CPU Utilization 
GPRINT:a:LAST:Current\:%8.0lf GPRINT:a:AVERAGE:Average\:%8.0lf 
GPRINT:a:MAX:Maximum\:%8.0lf 



I have this error:

ERROR: bad format for GPRINT in 'Current:.0lf'


If someone can help me, thanks


--
Unsubscribe mailto:[EMAIL PROTECTED]
Helpmailto:[EMAIL PROTECTED]
Archive http://lists.ee.ethz.ch/rrd-users
WebAdminhttp://lists.ee.ethz.ch/lsg2.cgi



[rrd-users] Re: cpu usage please help

2006-10-10 Thread Andreas Maus
Hi.
On Tue, Oct 10, 2006 at 09:47:01AM +0900, Mr. Suhas Ghosh wrote:
 Hi,
  please some one tell me how to get the cpu usasge ?
  Is it possible from proc to get  it?
Sure.
What OS you are talking about?
Linux? If you use Linux which kernel version?
2.4.x? 2.6.x? Which architecture? x86? x86_64? ia64?

   I want to draw the graph of cpu usage of my machine. I am giving my
   DS design.
   So please help me how to  put  the  data  in to  it  from proc
   or any other way.
The solution is in man 5 proc for Kernel 2.4.x:

[... snipp ...]
   /proc/stat
  kernel/system statistics.  Varies with architecture.  Common 
entries include:

  cpu  3357 0 4313 1362393
 The amount of time, measured in units of USER_HZ (1/100ths 
of a second on most architectures), that the system spent in user mode, user 
mode with low priority (nice), system
 mode, and the idle task, respectively.  The last value 
should be USER_HZ times the second entry in the uptime pseudo-file.

 In Linux 2.6 this line includes three additional columns: 
iowait - time waiting for I/O to complete (since 2.5.41); irq -  time  
servicing  interrupts  (since  2.6.0-test4);
 softirq - time servicing softirqs (since 2.6.0-test4).

[... snipp ...]

and for Kernel 2.6.x:

[... snipp ...]
   /proc/stat
  kernel/system statistics.  Varies with architecture.  Common 
entries include:

  cpu  3357 0 4313 1362393
 The number of jiffies (1/100ths of a second) that the 
system spent in user mode, user mode with low priority (nice), system mode, and 
the idle task, respectively.  The  last
 value should be 100 times the second entry in the uptime 
pseudo-file.
[... snipp ...]

   I am not using SNMP.
Do you collect the data using a Shellscript? Perl?
Using the information from /proc/stat you should change
your GAUGE declarations to COUNTER (or save the last
values, fetch the new one and calculate the difference,
so it is far much easier to use COUNTERs).

If you change the GAUGEs to COUNTERs you can use:

 - with Kernel 2.4:

# Get user:nice:system:idle
cpudata=`grep '^cpu ' /proc/stat  | sed -e 's/^cpu */N:/' -e 's/ /:/g'`
rrdtool upadte $rrd/cpu.rrd $cpudata

 - with Kernel 2.6 (I will count the iowait,irq,softirq and values as system 
values):
cpudata=`grep '^cpu ' /proc/stat | awk '{print N:$2:$3:$4+$6+$7:$5;}'`
rrdtool update $rrd/cpu.rrd $cpudata

HTH,

Andreas.

-- 
Dipl.-Ing. Andreas Maus science+computing ag
System Administration   Hagellocher Weg 73
mail: [EMAIL PROTECTED]   72070 Tuebingen, Germany
tel.: +49 7071 9457 456 www.science-computing.de

-- Binary/unsupported file stripped by Ecartis --
-- Err : No filename to use for decode, file stripped.
-- Type: application/pgp-signature


--
Unsubscribe mailto:[EMAIL PROTECTED]
Helpmailto:[EMAIL PROTECTED]
Archive http://lists.ee.ethz.ch/rrd-users
WebAdminhttp://lists.ee.ethz.ch/lsg2.cgi



[rrd-users] Re: Help for GPRINT

2006-10-10 Thread Alex van den Bogaerdt
On Tue, Oct 10, 2006 at 08:52:00AM +0200, [EMAIL PROTECTED] wrote:

 I use rrdtool with mrtg on a windows server, no problems for creating 
 rrdtool graphs, but i have a little problem with the GPRINT comand:

Nope, you have a problem with command.com or cmd.exe :)


 rrdtool graph test.png --imgformat=PNG --start=-86400 --end=-300 
 --title=Localhost - CPU Utilization - CPU0 --rigid --base=1000 --height=120 
 --width=500 --alt-autoscale-max --lower-limit=0 --vertical-label=percent 
 --slope-mode DEF:a=cpu.rrd:ds1:AVERAGE AREA:a#FF:CPU Utilization 
 GPRINT:a:LAST:Current\:%8.0lf GPRINT:a:AVERAGE:Average\:%8.0lf 
 GPRINT:a:MAX:Maximum\:%8.0lf 

Try single quotes, and/or try double percent sign.  You may need to experiment
a bit:

GPRINT:a:LAST:'Current:%8.0lf'
GPRINT:a:LAST:'Current\:%8.0lf'
GPRINT:a:LAST:'Current\:\%8.0lf'
GPRINT:a:LAST:'Current\:%%8.0lf'

that sort of stuff.  The problem is not RRDtool.  RRDtool never gets to
see that '%'.  Your OS changes %8 into the 8th parameter for your script.

HTH
-- 
Alex van den Bogaerdt
http://www.vandenbogaerdt.nl/rrdtool/

--
Unsubscribe mailto:[EMAIL PROTECTED]
Helpmailto:[EMAIL PROTECTED]
Archive http://lists.ee.ethz.ch/rrd-users
WebAdminhttp://lists.ee.ethz.ch/lsg2.cgi



[rrd-users] Splitting RRD files

2006-10-10 Thread Alcides Junior
Hi there,

I am trying to split my 5-hour RRD into 5 RRDs of 1hour each.
I was not able to to that using XPORT, since it has no way to restore
the exported .xml file, and DUMP, since it dumps the hole database.

Could anyone please help me?

--
Unsubscribe mailto:[EMAIL PROTECTED]
Helpmailto:[EMAIL PROTECTED]
Archive http://lists.ee.ethz.ch/rrd-users
WebAdminhttp://lists.ee.ethz.ch/lsg2.cgi