Creating graphs

In this recipe, we will show you how to build some nice looking graphs from the data that we have gathered from our items.

Getting ready

For this recipe, we need a Zabbix installation and an agent installed on the Zabbix server or another host that we can use. We also need admin rights in Zabbix to be able to create our graph.

How to do it…

  1. First we need an item. For this we will monitor our CPU load as it always gives a nice graph. Add an item system.cpu.load[percpu,avg1]. If you don't know how to do this, have look at Chapter 4, Passive agents or Active agents.
  2. Next go to Configuration | Hosts, then go to Configuration | Template if you would like to create it in a template.
  3. Click on the Graphs link after your host and click Create graph in the upper right corner.
  4. In the Name box we add a name for our graph, example: CPU load.
  5. We can set the Width and the Height of our graph.
  6. Next we select the Graph type. This can be Normal, Stacked, Pie, or Exploded. Normal is with lines, Stacked is layers above each other and Pie / Exploded is a representation in a pie form. Exploded is almost exactly the same except that it shows the individual segments of the pie in an exploded view.
  7. The Show legend will display the graphs legend if marked.
  8. The Show working time box will show the working hours in our graph. (Remember those can be set under Administration | General | Working time).
  9. Percentile line (left | right) will set the percent for the graph left or right. This only works for normal graphs.
  10. Y axis (Min | Max) value will be the maximum or minimum value for our Y axis. This can be changed in Calculated, Fixed, or Item. When choosing Calculated those will be calculated by Zabbix. Fixed will set a fixed min or max value. This can't be done for pie and exploded pie. When we choose X, it will be the last value of the selected item.
  11. When we select pie or exploded pie, we also have the option 3D view which will create a 3D view of our pie.
  12. Next we click on Add in the Items box and we add our item. This we can select from the list of items that will pop up.
  13. Next select the Function here; we can choose avg, max, and min. This will show us the average minimum or maximum values.
  14. Y axis side can be switched from Left to Right.
  15. And in the Colour box, we can choose another color by adding the correct RGB color in hex notation or by clicking on the color box and choosing a new color from the list of colors.
  16. When this is all done we can save our graph.
    How to do it…

How it works

For every item in Zabbix, we can create a graph. For this, we should select the item that the graph should check. We can select more then one item from the item box. Another great feature is that we can mix different items in one graph, example. CPU load, Memory usage, Disk I/O, and so on. This way we could, for instance, see the impact of memory usage on other parts of our system.

There's more...

We can make use of macros in map names but have to do it a bit differently. We have to add it with this syntax: {host:key.function(param)}. In our case, it would look like this, CPU load {{HOST.HOST}:system.cpu.load[percpu,avg1].last(0)}. This example would return a header such as: CPU load 0.5.

Also Zabbix supports some graphs out of the box. That means if you add a Zabbix template to your host, it will probably already contain some graphs.

Since Zabbix 2.4, there is support for ad hoc graphs on several items. When you go to monitor latest data you will have the option Graph behind most of the items. By clicking on this link, you will see a graph built by Zabbix for this item.

There's more...

See also

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.140.186.201