[HOWTO] Always notice a graph is rescaled (add black h.line)

If you figure out how to do something interesting/cool in Cacti and want to share it with the community, please post your experience here.

Moderators: Developers, Moderators

Post Reply
User avatar
white-jeroen
Posts: 25
Joined: Sat Mar 22, 2008 10:35 am

[HOWTO] Always notice a graph is rescaled (add black h.line)

Post by white-jeroen »

At our company, we look over the graphs of our servers every morning.
We have configured the "Upper Limit" values of most of the graphs at such a number that:
  • - Graph height 25% = completely normal
    - Graph height 50% = the server is quite busy
    - Graph height 100% = alarm!
This way we can quickly look over all graphs and if everything is below 25% of the graph height, nothing is wrong.

Sometimes a big peak happens, causing the graph to rescale.
If you don't notice the graph is rescaled, and you use the 25% height rule, you might misinterpret the graph.

I have fixed this by an easy solution:
I have added a black horizontal line on at the normal upper limit of the graph.
If the graph is rescaled, the black line comes down, and you can see the part below the graph as 100%, and use the 25% rule again.

In this topic I want to explain how to add that black line.

This is what the graph looks like when it has been rescaled and the black line has come down:

Image

This server has 2 processors, so I have set the graph maximum to 4, so 50% (quite busy) = a load of 2.

You need to take the following steps to add such a black upper limit line:

1) Create a special CDEF
  • - Log in to Cacti as admin.
    - Go to the "Console" tab
    - Choose "Graph Magement" from the left menu
    - Choose "CDEFs" from the left menu
    - Click "Add" on the right top of the page
    - Enter the name: "Graph Maximum Line"
    - Click "Create"
    - Click "Add" right on the page
    - Choose "Special Data Source"
    - Choose "All Data Sources (Don't include Duplicates)"
    - Click "Create"
    - Click "Add" right on the page
    - Choose "Custom String"
    - Enter "0"
    - Click "Create"
    - Click "Add" right on the page
    - Choose "Operator" and " * " (star = multiply)
    - Click "Create"
    - Click "Add" right on the page
    - Choose "Special Data Source" and "Graph: Upper Limit"
    - Click "Create"
    - Click "Add" right on the page
    - Choose "Operator" and " + "
    - Click "Create"
    - Click "Save"
This is what it should look like:

Image

2) Add the the line to the Graph Template
  • - Choose "Graph Templates" from the left menu"
    - Click the tempate you wish to add the black maximum line to
    - Click "Add" on the right top of the page
    - Set the "Data Source" to "none" (the first option)
    - Set the "Color" to 000000 / Black (the last option)
    - Set the "Graph Item Type" to "LINE1"
    - Set the "CDEF function" to the "Graph Maximum Line" you created
    - Click "Create"
This is what the settings look like:

Image

3) Set a "Upper Limit" for the graph
You can set an upper limit for all the graphs based on a graph template, or you can set it per host.
  • - Click "Graph Templates" from the left menu
    - Click the graph you want to set the maximum for
    - Scoll the page down to the options
    - "Auto Scale" should be set off
    - "Auto Scale Options" should be set to "Use --alt-autoscale-max (accepting a lower limit)"
    - Set the "Upper Limit" to the number you want the graph to scale to by default, for example "4" or "8" for a load graph and "104857600" for a 100 mbit network graph.
    - If you want to set an upper limit per separate host, you need to check the checkbox "Use Per-Graph Value" below "Upper Limit"
    - Click "Save"
These are my settings:

Image

If you have choosen "Use Per-Graph Value", you can set the per-host value this way:
  • -Choose "Graph Management" for the left menu
    - Click the graph
    - Set the "Upper Limit"
    - Click "Save"
Repeat this for all of your hosts.

If you have done all this, you can directly go to the "Graphs" tab and check if the black line appears on top of the graph, or somewhere in the middle if it is rescaled.

Have fun!
God bless you,
Jeroen Vermeulen
Jeroen Vermeulen BVBA - freelance PHP, Perl & Magento expert - http://www.jeroenvermeulen.eu/
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests