S
S
Suxoi2016-03-28 20:23:18
PHP
Suxoi, 2016-03-28 20:23:18

Generating a dynamic report with given Zabbix graphs?

There is a script pastebin.com/H5GQbc8S
It works and generates reports, but it is necessary that only certain ones with the name that is specified are generated, the name can change because discovery works with the specified parameters in Zabbix, as an example: there are several hard drives in the system and Disk should be displayed in the report usage C or D, and the letters may change, or the W3W.exe process may use multiple systems
There is an array with
names $valid_graph_names = array ('CPU load' , 'memory usage', 'disk space usage' );
Checking this format works, but not with dynamic data
if(in_array($hostGraphs[$graphkey]['name'],$valid_graph_names)){ .. }
Tried like this
if(in_array($hostGraphs[$graphkey]['name'],$valid_graph_names) OR strnatcasecmp(substr($hostGraphs[$graphkey]['name'],16),'Disk space usage')) {..}
begins to sculpt everything in a row
What am I doing wrong?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Suxoi, 2016-03-31
@Suxoi

if(in_array($hostGraphs[$graphkey]['name'],$valid_graph_names) OR(substr($hostGraphs[$graphkey]['name'],0,4) === "Disk") OR (substr( $hostGraphs[$graphkey]['name'],0,3) === "IIS")){...}
I did it right, this is what the condition should be, it's called read and learn the manual

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question