[rrd-users] rrdtool graph help

rrd-users at ficos.de rrd-users at ficos.de
Wed Jul 29 18:25:09 CEST 2009


>>> Hi team,
>>>
>>> Started using rrdtool and it's really nice.
>>>
>>> But I have some problem and hope you help. Am monitoring the usage of 
>>> CPU on my linux box through snmp and getting the values, for example 
>>> UCD-SNMP-MIB::ssCpurawUser ie .1.3.6.1.4.1.2021.11.50.0  that for 
>>> system, nice and idle, into my rrd and using those values to plot my 
>>> graph. My problem is how can I convert those values am getting from
>> snmp 
>>> which are huge figures into Percentage so I can read percentage values
>> 
>>> from my graphs and not the huge values.
>>>
>>> Thanks.
>>>
>>> Yaw.
>> 
>> 
>> You need to use COUNTER rather than GAUGE when creating the rrd.
>> If you're still getting numbers > 100 you probably have more than 1 CPU
>> core.
>> Then you need to divide the value by # of CPUs using CDEF (rpn)
>> 
>> hth
>> 
>> - Karl
>
> Hi karl,
> Yes I use COUNTER for my data source type to create my rrd for each
> individual data source (in my case cpu since they are 4 in no.) ie.
> user, system, nice and idle. Then I used a min and max of 0 to 100 and I
> could see that I wasn't getting any values into my db since the values
> from snmp for cpu's are huge. So I have to change my min and max values
> to 0 to U. 
> Yes again I have more than 1 cpu in the linux box. i have 4 and pls how
> is CDEF used?
> Thanks.
> Yaw.


Hi Yaw,

to verify that it works properly, I'd log *all* the CPU-Values.
So rather than only user, system, nice and idle I'd log
iowait, softrq, irq, system, user, nice & idle.
All of these should add up to 100% (per CPU), so if it's 4 CPUs
it should be 400% all the time.
Once you have verified that the numbers are corrrect, take out
the values you don't need.

For the graph I'd (to divide by 4) use something like this:

    --lower-limit=0
    --rigid
    --title=CPU stats in %
    DEF:iowait=Proc.rrd:iowait:AVERAGE
    DEF:softrq=Proc.rrd:softrq:AVERAGE
    DEF:irq=Proc.rrd:irq:AVERAGE
    DEF:system=Proc.rrd:system:AVERAGE
    DEF:nice=Proc.rrd:nice:AVERAGE
    DEF:user=Proc.rrd:user:AVERAGE
    DEF:idle=Proc.rrd:idle:AVERAGE
    CDEF:IOWAIT=iowait,4,/
    CDEF:SOFTRQ=softrq,4,/
    CDEF:IRQ=irq,4,/
    CDEF:SYSTEM=system,4,/
    CDEF:NICE=nice,4,/
    CDEF:USER=user,4,/
    CDEF:IDLE=idle,4,/
    AREA:IOWAIT#F00000:IOWAIT
    AREA:IRQ#808000:IRQ:STACK
    AREA:SOFTRQ#803000:SOFTRQ:STACK
    AREA:SYSTEM#80F000:SYSTEM:STACK
    AREA:NICE#000030:NICE:STACK
    AREA:USER#0000F0:USER:STACK
    AREA:IDLE#C0F0C0:IDLE:STACK


Another solution of course might be to divide the values by 4
BEFORE recording them.

BTW: this calculation is true for the CPU values coming from 
/proc/stat - not sure about the SNMP stuff ...

- Karl








More information about the rrd-users mailing list