[rrd-users] COUNTER and values saved on database file

Valter Douglas Lisbôa Jr. douglas at trenix.com.br
Tue Jul 22 23:45:05 CEST 2008


I create a database and feed it with the perl code bellow:

--------------------------------------------------
    RRDs::create(
      $dbName,
      "--step=60",
      "DS:user:COUNTER:120:0:U",        
      "DS:nice:COUNTER:120:0:U",        
      "DS:system:COUNTER:120:0:U",      
      "DS:idle:COUNTER:120:0:U",        
      "DS:kernel:COUNTER:120:0:U",      
      "DS:wait:COUNTER:120:0:U",        
      "DS:irq:COUNTER:120:0:U",         
      "DS:softirq:COUNTER:120:0:U",     
      "RRA:AVERAGE:0.5:1:43200",        
      "RRA:AVERAGE:0.5:15:8640",        
      "RRA:AVERAGE:0.5:30:8640",        
      "RRA:AVERAGE:0.5:60:8640"         
    );

    RRDs::update(
      $dbName,
      "N:$user:$nice:$system:$idle:$kernel:$wait:$int:$softInt"
    );
-------------------------------------------------------------------------------

When I retrive the data via fetch, I see that rrdtool does not save the raw 
value passed by RRDs::update. For instance:

* Values obtained by SNMP
user    nice    system  idle      kernel  wait   irq softirq
629609  0       239181  53499516  0       270355 0   4404

* Values retrived in fecth
user		  nice	system	          idle	             kernel	
0,438622267926239 0	0,348252111349062 98,700818840945600 0	  
wait	          irq	softirq
0,003673411505597 0     0

How does rrd obtain this values? 

I need this because I need to calculate the CPU percent usage by fetching n 
minutes ago (to load the values in memory when my daemon comes up) and after 
with the values based on SNMP responses (to avoid disk I/O for constantly 
fetching from RRD database file).

-- 
Valter Douglas Lisbôa Jr.
Sócio-Diretor
Trenix - IT Solutions
"Nossas Idéias, suas Soluções!"
www.trenix.com.br
contato at trenix.com.br
Tel. +55 19 3402.2957
Cel. +55 19 9183.4244



More information about the rrd-users mailing list