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,/

 Cacti User
 Posts: 110
 Joined: Wed Mar 13, 2019 3:37 pm
 Location: toronto
 Contact:
Re: Need Help! CDEF function Convert watts to dbm
I have a similar thing but for Nokia
I am trying to implement this but running into a roadblock
Here is the example equation Nokia is giving me
10 x log10(0.079) = 11.0 dBm"
I just cant get the cdef right I also need to divide the DS value by 1000 to get the value
I am trying to implement this but running into a roadblock
Here is the example equation Nokia is giving me
10 x log10(0.079) = 11.0 dBm"
I just cant get the cdef right I also need to divide the DS value by 1000 to get the value
 TheWitness
 Developer
 Posts: 14855
 Joined: Tue May 14, 2002 5:08 pm
 Location: MI, USA
 Contact:
Re: Need Help! CDEF function Convert watts to dbm
Well, having the 'actual' math would have helped. Glad it's figured out.
True understanding begins only when we realize how little we truly understand...
Life is an adventure, let yours begin with Cacti!
Author of MacTrack, Boost, CLog, SpikeKill, Platform RTM, DSStats, maintainer of Spine, lot's of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Central Plugin Repository
Central Templates Repository
I'm still out there people. Getting excited for Cacti 1.2. I think it will be a great release.
Life is an adventure, let yours begin with Cacti!
Author of MacTrack, Boost, CLog, SpikeKill, Platform RTM, DSStats, maintainer of Spine, lot's of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Central Plugin Repository
Central Templates Repository
I'm still out there people. Getting excited for Cacti 1.2. I think it will be a great release.