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: Developers, Moderators

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

Need Help! CDEF function Convert watts to dbm

Post by senthilka »

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

Post by victorantunes »

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

Post by senthilka »

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

Post by victorantunes »

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

Post by senthilka »

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: 5
Joined: Mon Jul 16, 2018 7:05 am

Re: Need Help! CDEF function Convert watts to dbm

Post by slakyari »

Thanks so Below is the final CDEF functions

CURRENT_DATA_SOURCE,0.001,*,LOG,10,*,2.303,/
bmfmancini
Cacti User
Posts: 250
Joined: Wed Mar 13, 2019 3:37 pm
Location: toronto
Contact:

Re: Need Help! CDEF function Convert watts to dbm

Post by bmfmancini »

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
Telecom Lifer, Monitoring and performance enthusiast, Father, Husband

Cacti Bug Hunter and Member

www.seanmancini.com
sean(at)seanmancini.com
github.com/bmfmancini

My Cacti scripts and templates ( Non official)
Cacti install wizard https://github.com/bmfmancini/cacti-install-wizard
Cacti templates https://github.com/bmfmancini/Cacti-templates

Always willing to help!
User avatar
TheWitness
Developer
Posts: 17007
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Re: Need Help! CDEF function Convert watts to dbm

Post by TheWitness »

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 dozens of Cacti plugins and customization's. Advocate of LAMP, MariaDB, IBM Spectrum LSF and the world of batch. Creator of IBM Spectrum RTM, author of quite a bit of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Percona Device Packages (no support)
Interesting Device Packages


For those wondering, I'm still here, but lost in the shadows. Yearning for less bugs. Who want's a Cacti 1.3/2.0? Streams anyone?
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest