cacti: Display how much % one data source item has

2019-09-02 15:37发布

问题:

I want to create a graph template in which it is displayed how much percentage a data source item has of another data source item.

I assumed I'd need to use CDEF functions for that and according to that question CDEF Function to find % value in Cacti it isn't even a difficult one.

However, I have no idea how to actually use the given CDEF function within the graph template web interface, how to choose which data source items should serve as input for the CDEF function, how to get the CDEF functions output as input for drawing a graph item of (e.g of type LINE1).

Nowhere does the documentation mentions such things, or if, I didn't find or get it.

回答1:

The way to find out what datasource is what letter value is by going into Console -> Graph Management -> Pick the Graph you are working on -> Turn On Debug Mode

What you are looking for are the lines that start with DEF a=, b= etc.

From there you build the CDEF function using reverse polish notation as shown in my question you have referenced above.

To use the value in a graph eg a LINE add a new item in the graph template then just dont select a datasource and select your prebuilt CDEF function like below.

That should do exactly what you are looking for. In my example I used an AREA but that is just what was best suited for the graph in question.



标签: cacti