Hi Guys,
iam trying to input the following formula into cacti to convert watts to dbm
P(dBm) = 10 · log10( P(mW) )
Example
Convert 20mW to dBm:,
P(dBm) = 10 · log10( 20mW ) = 13.0103dBm
Does anyone know how?
i have come out with this. but its not correct.
cdef=CURRENT_DATA_SOURCE,0.001,*,LOG,10,*
cisco is giving me a reading of 33 via snmpwalk.
So i need to divide the value by a 1000 before applying the formula is bold
So the problem happens when i apply the log fuction i get a different value(3.41), then expected (1.48)
Need Help! CDEF function Convert watts to dbm
Moderators: Moderators, Developers

 Cacti User
 Posts: 111
 Joined: Fri Sep 28, 2012 6:52 pm
Re: Need Help! CDEF function Convert watts to dbm
I don't know the proper parameters for LOG, but try this:
CURRENT_DATA_SOURCE, 1000, /, 10, LOG, 10, *
CURRENT_DATA_SOURCE, 1000, /, 10, LOG, 10, *
Re: Need Help! CDEF function Convert watts to dbm
Couldnt work. the problem seems to lie with the way cacti performs the log fuctions. Whats the 10 before the log function meant to be? Cacti is not able to process the formula.
Has anyone else encounter any problems with the way cacti performs log functions?
P.S. Have no idea why Cisco thinks its a good idea to have ASR 9k report in power rather than dbm.
Has anyone else encounter any problems with the way cacti performs log functions?
P.S. Have no idea why Cisco thinks its a good idea to have ASR 9k report in power rather than dbm.

 Cacti User
 Posts: 111
 Joined: Fri Sep 28, 2012 6:52 pm
Re: Need Help! CDEF function Convert watts to dbm
The '10' is supposed to be the Log base. Told you I wasn't familiar with the Log syntax in RRDtool
Try
Try
Code: Select all
CURRENT_DATA_SOURCE, 1000, /, LOG, 10, *
Re: Need Help! CDEF function Convert watts to dbm
OK! Finally figured this out. Cacti does logarithm in natural log. so to convert it to a base 10 log.
we need to divide the solution by 2.303
zzzzz.....
we need to divide the solution by 2.303
zzzzz.....
Re: Need Help! CDEF function Convert watts to dbm
Thanks so Below is the final CDEF functions
CURRENT_DATA_SOURCE,0.001,*,LOG,10,*,2.303,/
CURRENT_DATA_SOURCE,0.001,*,LOG,10,*,2.303,/