It's a topic that often comes up, how can you retrieve a Zabbix graph using a command line utility? Often before this would require a custom script which called wget or a similar program.
Now you don't need to write your own script, but rather you can use Zabcon to retrieve the graphs.
During the conference I talked about creating your own custom commands for Zabcon, I figure the best way to show people the power of this approach would be to release this as a Zabcon custom command. Meaning if you already have Zabcon installed you don't need to update your Zabcon install, but rather download the command file and update your zabcon.conf file.
The file can be downloaded here:
Otherwise it can be browsed here:
When installed the command allows the following syntax:
Which will download the graph for item 1234 to the file graph_out.png. If no path is specified the directory in which zabxon was executed is used. The extension is set by mime time returned by Zabbix server, if you need to convert the image to another format ImageMagic is recommended.
width is also an option should you prefer to have the graph have a specified width in pixels.
Now you don't need to write your own script, but rather you can use Zabcon to retrieve the graphs.
During the conference I talked about creating your own custom commands for Zabcon, I figure the best way to show people the power of this approach would be to release this as a Zabcon custom command. Meaning if you already have Zabcon installed you don't need to update your Zabcon install, but rather download the command file and update your zabcon.conf file.
The file can be downloaded here:
Otherwise it can be browsed here:
When installed the command allows the following syntax:
Code:
zabbix get graph itemid=1234 start=now-5h end=now-4h filename=graph_out
width is also an option should you prefer to have the graph have a specified width in pixels.
Comment