Gandalf | 4 Dec 2010 00:01

Re: CDEF help

I translated your request into a CDEF. But http://en.wikipedia.org/wiki/DBm 
tells me, that the formulae should look differently (where P is given in W)

Reinhard

On 03.12.2010 22:45, Tim Eberhard wrote:
> So that made the graphs work and now rrdtool can run without errors,
> but it doesn't appear to be correct. My value is 49, from my spine
> debug.
> 12/03/2010 01:26:02 PM - SPINE: Poller[0] Host[977] DS[19214] SCRIPT:
> /usr/bin/python /var/www/html/cacti-0.8.7e/scripts/ekn_light_levels.py
> 10.17.2.52 8 x2, output: 49
>
> Manually plugging that 49/10000 = 0.0049. into a dbm converter
> (http://www.aubraux.com/design/milli-watts-to-dbm-calculator.php)
> gives me a value of 0.0049 milli watt(s) = -23.0980391997 dBm.
>
> Cacti is showing me -52.
>
>
> RRDTool Command:
>
> /usr/bin/rrdtool graph - \
> --imgformat=PNG \
> --start=-86400 \
> --end=-300 \
> --title="TX-HOU9991-EKN-1 - Received level  Slot 8 Port X2" \
> --base=1000 \
> --height=120 \
> --width=500 \
> --alt-autoscale-max \
> --lower-limit=0 \
> --vertical-label="" \
> --slope-mode \
> --font TITLE:8: \
> --font AXIS:8: \
> --font LEGEND:8: \
> --font UNIT:8: \
> DEF:a="/san1/www/html/cacti-0.8.7e/rra/tx-hou9991-ekn-1_ekn_light_lvl_19214.rrd":ekn_light_lvl:LAST
> \
> CDEF:cdefa=a,10000,/,LOG,10,* \
> LINE3:cdefa#FF00FFFF:""  \
> GPRINT:cdefa:LAST:"Current\:%8.0lf"
>
> RRDTool Says:
>
> OK
>
> On Fri, Dec 3, 2010 at 3:07 PM, Gandalf<gandalf <at> cacti.net>  wrote:
>>
>>
>> On 03.12.2010 19:17, Tim Eberhard wrote:
>>> All,
>>>
>>> I'm trying to create this formula for measuring light levels on a DWDM
>>> system. Tx_Pwr(dBm) = 10xlog(AV/10000). AV is the SNMP value
>> try cdef=CURRENT_DATA_SOURCE,10000,/,LOG,10,*
>>
>> Reinhard
>>
>>>
>>> So basically.. I need 10xlog(SNMP_Value/10000). I tried to do this via
>>> a custom CDEF function but it's erroring out. Hopefully someone can
>>> point out my issue as I haven't dealt with any custom cdefs in the
>>> past.
>>>
>>> Item  Item Value
>>> Item #1       Custom String: 10
>>> Item #2       Operator: *
>>> Item #3       Function: LOG
>>> Item #4       Another CDEF: dwdm backend
>>>
>>> Item 4 is this:
>>> Item #1       Special Data Source: CURRENT_DATA_SOURCE
>>> Item #2       Operator: /
>>> Item #3       Custom String: 10000
>>>
>>>
>>> Here is what I get:
>>> RRDTool Command:
>>>
>>> /usr/bin/rrdtool graph - \
>>> --imgformat=PNG \
>>> --start=-86400 \
>>> --end=-300 \
>>> --title="TX-HOU9991-EKN-1 - Received level" \
>>> --base=1000 \
>>> --height=120 \
>>> --width=500 \
>>> --alt-autoscale-max \
>>> --lower-limit=0 \
>>> --vertical-label="" \
>>> --slope-mode \
>>> --font TITLE:8: \
>>> --font AXIS:8: \
>>> --font LEGEND:8: \
>>> --font UNIT:8: \
>>> DEF:a="/san1/www/html/cacti-0.8.7e/rra/tx-hou9991-ekn-1_ekn_light_lvl_19211.rrd":ekn_light_lvl:AVERAGE
>>> \
>>> CDEF:cdefa=10,*,LOG,a,/,10000 \
>>> LINE3:cdefa#FF00FFFF:""  \
>>> GPRINT:a:LAST:"Current\:%8.0lf"
>>>
>>> RRDTool Says:
>>>
>>> ERROR: invalid rpn expression in: 10,*,LOG,a,/,10000
>>>
>>>
>>>
>>> Thanks for your help all,
>>> -Tim Eberhard
>>>
>>> ------------------------------------------------------------------------------
>>> Increase Visibility of Your 3D Game App&    Earn a Chance To Win $500!
>>> Tap into the largest installed PC base&    get more eyes on your game by
>>> optimizing for Intel(R) Graphics Technology. Get started today with the
>>> Intel(R) Software Partner Program. Five $500 cash prizes are up for grabs.
>>> http://p.sf.net/sfu/intelisp-dev2dev
>>> _______________________________________________
>>> cacti-user mailing list
>>> cacti-user <at> lists.sourceforge.net
>>> https://lists.sourceforge.net/lists/listinfo/cacti-user
>>>
>>
>> ------------------------------------------------------------------------------
>> Increase Visibility of Your 3D Game App&  Earn a Chance To Win $500!
>> Tap into the largest installed PC base&  get more eyes on your game by
>> optimizing for Intel(R) Graphics Technology. Get started today with the
>> Intel(R) Software Partner Program. Five $500 cash prizes are up for grabs.
>> http://p.sf.net/sfu/intelisp-dev2dev
>> _______________________________________________
>> cacti-user mailing list
>> cacti-user <at> lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/cacti-user
>>
>
> ------------------------------------------------------------------------------
> Oracle to DB2 Conversion Guide: New IBM DB2 features make compatibility easy.
> Learn about native support for PL/SQL, new data types, scalar functions,
> improved concurrency, built-in packages, OCI, SQL*Plus, data movement tools,
> best practices and more - all designed to run applications on both DB2 and
> Oracle platforms. http://p.sf.net/sfu/oracle-sfdev2dev
> _______________________________________________
> cacti-user mailing list
> cacti-user <at> lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/cacti-user
>

------------------------------------------------------------------------------
Oracle to DB2 Conversion Guide: New IBM DB2 features make compatibility easy. 
Learn about native support for PL/SQL, new data types, scalar functions, 
improved concurrency, built-in packages, OCI, SQL*Plus, data movement tools, 
best practices and more - all designed to run applications on both DB2 and 
Oracle platforms. http://p.sf.net/sfu/oracle-sfdev2dev

Gmane