Hello,
I have a question about Zabbix discovery and Item Prototypes that I've been trying to solve for the past few days, but without much of a luck.. Well, eventually I did it using a workaround, but I'm posting this here in case there is a better solution to my problem. So here it goes..
I'm running Zabbix version 2.0.6 and my goal is to create a new template for monitoring internal systems. The template defines one discovery rule which is set to "externalcheck" and is a script that runs against a service API to produce a JSON object that Zabbix can understand and use. The returned JSON object contains all the macros & values of the information I need.
The discovery rule is working fine. My problem is the Item Prototypes and how to configure them -- as the target system does not run an Agent (not possible) I do not see how to implement an item prototype which passes the macros from the JSON object.
The only workaround I could think of was to set all Item Prototypes to be of type "externalcheck" and as the key to use a simple echo-like script which simply echo'es the macros you pass to it.
Here's an example key of an Item Prototype of type "externalcheck":
And the echo-me.sh script simply does this:
This works, but I don't really like it as it is not a clean solution to the problem. It would be much better if Zabbix was able to process the macros in a cleaner way, but I don't see such an option from the Item Prototypes menu. After all Zabbix already has the macros & values pulled from the discovery rule, so it should be easy to just use them...
My question is -- how can I pass the macros to an Item Prototype in a better way, which does not involve an Agent type of key?
Thanks and regards,
I have a question about Zabbix discovery and Item Prototypes that I've been trying to solve for the past few days, but without much of a luck.. Well, eventually I did it using a workaround, but I'm posting this here in case there is a better solution to my problem. So here it goes..
I'm running Zabbix version 2.0.6 and my goal is to create a new template for monitoring internal systems. The template defines one discovery rule which is set to "externalcheck" and is a script that runs against a service API to produce a JSON object that Zabbix can understand and use. The returned JSON object contains all the macros & values of the information I need.
The discovery rule is working fine. My problem is the Item Prototypes and how to configure them -- as the target system does not run an Agent (not possible) I do not see how to implement an item prototype which passes the macros from the JSON object.
The only workaround I could think of was to set all Item Prototypes to be of type "externalcheck" and as the key to use a simple echo-like script which simply echo'es the macros you pass to it.
Here's an example key of an Item Prototype of type "externalcheck":
Code:
echo-me.sh[{#MY_MACRO_HERE}]
Code:
#!/usr/bin/env sh echo $*
My question is -- how can I pass the macros to an Item Prototype in a better way, which does not involve an Agent type of key?
Thanks and regards,