cacti: Display how much % one data source item has of an other datasource item

家住魔仙堡 提交于 2019-12-12 01:47: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.



来源:https://stackoverflow.com/questions/8262093/cacti-display-how-much-one-data-source-item-has-of-an-other-datasource-item

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!