Need Help! CDEF function Convert watts to dbm

Post general support questions here that do not specifically fall into the Linux or Windows categories.

Moderators: Moderators, Developers

Post Reply
Author
Message
senthilka
Posts: 3
Joined: Tue Oct 02, 2012 1:40 am

Need Help! CDEF function Convert watts to dbm

#1 Post by senthilka » Tue Oct 02, 2012 1:49 am

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)

victorantunes
Cacti User
Posts: 111
Joined: Fri Sep 28, 2012 6:52 pm

Re: Need Help! CDEF function Convert watts to dbm

#2 Post by victorantunes » Tue Oct 02, 2012 10:00 am

I don't know the proper parameters for LOG, but try this:

CURRENT_DATA_SOURCE, 1000, /, 10, LOG, 10, *

senthilka
Posts: 3
Joined: Tue Oct 02, 2012 1:40 am

Re: Need Help! CDEF function Convert watts to dbm

#3 Post by senthilka » Thu Oct 11, 2012 4:05 am

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.

victorantunes
Cacti User
Posts: 111
Joined: Fri Sep 28, 2012 6:52 pm

Re: Need Help! CDEF function Convert watts to dbm

#4 Post by victorantunes » Thu Oct 11, 2012 1:35 pm

The '10' is supposed to be the Log base. Told you I wasn't familiar with the Log syntax in RRDtool :P


Try

Code: Select all

CURRENT_DATA_SOURCE, 1000, /, LOG, 10, *

senthilka
Posts: 3
Joined: Tue Oct 02, 2012 1:40 am

Re: Need Help! CDEF function Convert watts to dbm

#5 Post by senthilka » Tue Oct 16, 2012 3:50 am

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.....

slakyari
Posts: 4
Joined: Mon Jul 16, 2018 7:05 am

Re: Need Help! CDEF function Convert watts to dbm

#6 Post by slakyari » Tue May 21, 2019 4:56 pm

Thanks so Below is the final CDEF functions

CURRENT_DATA_SOURCE,0.001,*,LOG,10,*,2.303,/

seanmancini
Cacti User
Posts: 71
Joined: Wed Mar 13, 2019 3:37 pm
Location: toronto
Contact:

Re: Need Help! CDEF function Convert watts to dbm

#7 Post by seanmancini » Mon Dec 02, 2019 3:05 pm

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

User avatar
TheWitness
Developer
Posts: 14834
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Re: Need Help! CDEF function Convert watts to dbm

#8 Post by TheWitness » Mon Dec 02, 2019 4:23 pm

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.

Post Reply