<< Previous Section Making Graphs the Manual Way: Graphs and Data Sources [home] Next Section >>

Graphs

Graphs can be accessed in Cacti by selecting the "Graph Management" menu option under "Graph Setup". Graphs in Cacti are closely modeled after graphs in RRDTool, which is described in the RRDTool Graph manual.

To add a new graph in Cacti, click "Add" in the upper right corner of the window. The first thing you will be prompted for is a graph template and a host. While both of these options provide powerful functionality, you can leave both of these dropdowns set to "None" for now. When you click the "Create" button you will be provided with a bunch of fields:

Title The title of the graph within Cacti and the title that will be printed on the actual graph itself.

Note: You can use the keyword |host_description| in this field, which will be automatically substituted with the current host description.
Image Format Choose whether you would prefer to output your graph images in PNG or GIF. According to the RRDTool manual PNG is preferred because it is both smaller and faster.
Height The height of the graph area in pixels
Width The width of the graph area in pixels
Auto Scale Enable auto scale for the graph. This option must be check to use the next two options. Upper/Lower limit values are ignored when using autoscale since these boundaries are determined automatically.
Auto Scale Options Choose whether you would like to use --alt-autoscale or --alt-autoscale-max on the graph. The RRDTool graph manuals says: "Where --alt-autoscale will modify both the absolute maximum AND minimum values, this option will only affect the maximum value. The minimum value, if not defined on the command line, will be 0. This option can be useful when graphing router traffic when the WAN line uses compression, and thus the throughput may be higher than the WAN line speed.".
Logarithmic Auto Scaling Choose if you want logarithmic y-axis scaling.
Rigid Boundaries Mode From the RRDTool manual "Normally rrdgraph will automatically expand the lower and upper limit if the graph contains a value outside the valid range. With this option you can disable this behavior".
Auto Padding If you have ever created RRDTool-based graphs manually, you may have realized how annoying it can be to get text to line up properly. With this option Cacti will do its best to make the columns on your graph legend line up. This option works best when your graph legend has a consistent number of columns.
Allow Graph Export If you choose to use Cacti's static HTML/image export, you can choose whether you want each individual graph to be exported.
Upper Limit The maximum value that will be displayed on the y-axis. This value is ignored is auto-scaling is turned on.
Lower Limit The minimum value that will be displayed on the y-axis. This value is ignored is auto-scaling is turned on.
Base Value Whether you want to base the y-axis labels on 1000 or 1024. This field will typically be set to 1024 for memory and 1000 for traffic measurements.
Unit Value Sets the unit value for the y-axis. You should probably keep the unit short as to keep it readable.
Unit Exponent Value Sets the 10^e scaling of the y-axis. Valid values for this field are between -18 and 18. For example, you could use 3 to display everything in 'k' (kilo) or -6 to display everything in 'u' (micro).
Vertical Label The text to print on the left edge of the graph. Usually is the units the data on the graph is measured in.

When you have finished filling in all necessary fields, click "Create" at the bottom of the page. You will be redirected back to the edit page, with the graph template/host applied (if applicable). You should now see a new box at the top of the window called "Graph Items". This is where you define what to actually place on the graph, such as lines, data sources, and text.

Graph Items

To create your first graph item, simply click "Add" on the right side of the "Graph Items" box. You will be presented with a list of fields explained below:

Data Source If this graph item is to represent some sort of data, you must select a your data source here. Keep in mind that not all graph items have a data source. Graph item types such as COMMENT, VRULE, and HRULE typically do not.
Color Depending on the graph item type, you can select a color for the graph item. This field only applies to the graph item types AREA, STACK, LINE1, LINE2, and LINE3.
Graph Item Type This field is important because it defines what kind of graph item this is. Types such as AREA, STACK, LINE1, LINE2, and LINE3 are used to represent data on the graph, while COMMENT and GPRINT are used put on the legend. The LEGEND type is specific to Cacti only and can be used if you want to Cacti to automatically create a GPRINT-LAST/GPRINT-AVERAGE/GPRINT-MAXIMUM graph item for you.

Note: You must always put an AREA item before using STACK or your graph will not render.
Consolidation Function This tells RRDTool which consolidation function to use when representing this data on the graph. You will typically use AVERAGE for most things on the graph area, and LAST/MAXIMUM as well for GPRINT items.
CDEF Function If you want to apply a CDEF function to the graph item, select one here. Check out the CDEF section of the manual for more information.
Value This field is only used with the HRULE/VRULE graph item types. Type any valid integer to draw the line at for HRULE or the time of the day HH:MM for VRULE.
GPRINT Type If this item is a GPRINT, you can choose how you want the number to be formatted. You can add your own in the GPRINT Presets section of Cacti.
Text Format You can enter text to be displayed on the legend here. This field is applicable for all graph item types except for the virtual LEGEND type.
Hard Return Check this box to force graph items onto the next line.

When you have finished filling in all necessary fields, click "Create" at the bottom of the page. You will be redirected back to the graph edit page. From here you can continue to add additional graph items, reorder graph items, or remove graph items.