dividing a SNMP value by 10

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

Moderators: Developers, Moderators

Post Reply
kirigoe
Posts: 17
Joined: Fri Aug 27, 2004 5:44 am
Location: sweden
Contact:

dividing a SNMP value by 10

Post by kirigoe »

hi,

I'm creating graphs for a Powerware UPS and it's working great. One of the graphs is displaying voltages, input and output voltages is fine, but for some reason, the battery voltage is ten times the actual value (2640 instead of 264). Is there a simple way of dividing this number by 10 to better align it with the other voltages?

My best guess so far is to create a custom script to retrieve the value and divide it using perl or php, but that seems like a lot of work for such little effect.

thanks in advance,
Daniel
Hip
Posts: 18
Joined: Wed Sep 01, 2004 5:21 am
Location: Switzerland

Post by Hip »

Hi,

The better way to do it is to use a CDEF:

1- Create a CDEF, enter string: "a,10,/" (this is in RPN notation, see rrdtool manual)
2- Apply the CDEF on the graph item representing the battery voltage
kirigoe
Posts: 17
Joined: Fri Aug 27, 2004 5:44 am
Location: sweden
Contact:

Post by kirigoe »

thank you! I'll try that.
Discogalaxy
Posts: 20
Joined: Sat Feb 25, 2006 4:51 am
Location: Germany
Contact:

Post by Discogalaxy »

THX

that worked for me also.

but can someone tell me hwo to get a worth like 32,1 ? now it rounds
User avatar
BSOD2600
Cacti Moderator
Posts: 12171
Joined: Sat May 08, 2004 12:44 pm
Location: USA

Post by BSOD2600 »

In your graph template for a data source, tell it to show exact values. Also, be aware that rrdtool consolidates data.
Discogalaxy
Posts: 20
Joined: Sat Feb 25, 2006 4:51 am
Location: Germany
Contact:

Post by Discogalaxy »

after switching to "normal" all works fine :)
(exact numbers juts showed me rounded)
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

Hip wrote:Hi,

The better way to do it is to use a CDEF:

1- Create a CDEF, enter string: "a,10,/" (this is in RPN notation, see rrdtool manual)
2- Apply the CDEF on the graph item representing the battery voltage
Late, but ...
CDEF should better look like

Code: Select all

CDEF=CURRENT_DATA_SOURCE,10,/
Reinhard
Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests