Cacti 0.8 Beginner's Guide
上QQ阅读APP看书,第一时间看更新

Time for action – adding the color areas

Now you are going to add colors to the three areas of the graph.

  1. Add another item.
  2. Select the Host-Resource-Mib: Running Processes as the Data Source.
  3. Select a red color.
  4. Select AREA as the Graph Item Type and put Over Threshold into the Text Format field.
  5. Click on Create.
  6. For the yellow area, you need to add yet another item.
  7. Select AREA as the Graph Item Type, choose a yellow color, and put Near Threshold into the Text Format field.
  8. Select isYellow_45-50 as the CDEF function to use.
  9. Click on Create.
  10. The last one will be the green area, so click on Add again.
  11. Select AREA as the Graph Item Type, choose a green color, and put Under Threshold into the Text Format field.
  12. Select isGreen_0-44 as the CDEF function and check the Insert Hard Return box.
  13. Click on Create. Your graph definition should now look like the following screenshot. Verify that you have defined all of the items in the same way.
    Time for action – adding the color areas

What just happened?

You have now added your three colored areas to the graph. Using the same principle as for the RRDtool graph command, you based the values of the single areas on a CDEF value. This will make sure that only the relevant area shows up on the graph, depending on the data value.

By selecting a data source you can also see that this data source is automatically added to the Graph Item Inputs list.

Adding a legend to the graph

Your graph is now nearly complete, but is missing the legend. So let's add this now to finish your graph template.