Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 434893
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T20:19:15+00:00 2026-05-12T20:19:15+00:00

I am trying to figure out how to find the % based on two

  • 0

I am trying to figure out how to find the % based on two data sources from an RRD graph. Below is the code used to create the graph (generated by Cacti)

/usr/bin/rrdtool graph - \
--imgformat=PNG \
--start=1256445701 \
--end=1256532101 \
--title="Message Size" \
--base=1000 \
--height=120 \
--width=500 \
--alt-autoscale-max \
--lower-limit=0 \
COMMENT:"From 2009/10/25 14\:41\:41 To 2009/10/26 14\:41\:41\c" \
COMMENT:"  \n" \
--vertical-label="" \
--slope-mode \
--font TITLE:10: \
--font AXIS:8: \
--font LEGEND:8: \
--font UNIT:8: \
DEF:a="/srv/www/vhosts/cacti/cacti-0.8.7d/rra/5393.rrd":dsAttachmentSize:AVERAGE \
DEF:b="/srv/www/vhosts/cacti/cacti-0.8.7d/rra/5393.rrd":dsSIAttachmentSize:AVERAGE \
CDEF:cdefa=a,1000000,* \
CDEF:cdefe=b,1000000,* \
AREA:cdefa#0000aaFF:"Attach Size"  \
GPRINT:cdefa:LAST:"   Current\:%8.2lf %s"  \
GPRINT:cdefa:AVERAGE:"Average\:%8.2lf %s"  \
GPRINT:cdefa:MAX:"Maximum\:%8.2lf %s\n"  \
AREA:cdefe#FF0000FF:"Attach SI Size"  \
GPRINT:cdefe:LAST:"Current\:%8.2lf %s"  \
GPRINT:cdefe:AVERAGE:"Average\:%8.2lf %s"  \
GPRINT:cdefe:MAX:"Maximum\:%8.2lf %s\n" 

I would like to find the following (A – B) / A * 100 and display it at the bottom of the graph.

I think this question is more programming related then server related (but I am ready to stand corrected), if anyone can point me to some good documentation on RRD to figure this out myself or if anyone can give me a good start it would be greatly appreciated.

Cheers.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-12T20:19:15+00:00Added an answer on May 12, 2026 at 8:19 pm

    This was a relatively easy one in the end. Just create a CDEF function like the following.

    a,b,-,a,/,100,*
    

    And assign that CDEF function to a graph item without a datasource.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to figure out two things: Can Xpath be used to query a
I am trying to figure out a better way to extract data from a
I'm trying to figure out how I can get two input fields populated based
I'm trying to figure out a way to find out which files were affected
I'm trying to figure out an algorithm to find the highest 2 numbers in
Trying to figure out this pseudo code. The following is assumed.... I can only
I'm trying to figure out how to put an annotation on a map based
I'm constructing a geolocation based application and I'm trying to figure out a way
I'm trying to figure out how to detect the type of credit card based
I'm trying to figure out how to use StateT to combine two State state

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.