Hi,
We have a few custom items that run against a windows client with some powershell. The powershell script queries a service on the machine and provides some output. This is all done with discovered items and works very well. I'm amazed how nicely this can work with zabbix!
We have a small trigger on the value return, to detect when the value changes. These values are like variables and we just need to be notified if they are changed. The values are Text.
However, we've also found that if the script throws an error message (because, for example, the service is not available). This of course is returned as a bit of text and now the text is different and therefor our triggers go off. Because this is a discovered item, we suddenly get loads of triggers going of because 1 service is not available.
I've thought about a few solutions for this:
1) Make the trigger do an additional check to see if the service is up - this would mean that you have two items that are dependend on each other. I don't fully like this.
2) Make the powershell script on the remote machine better so it returns the same value as before, if the script fails (this is not great)
3) Make the powershell script cause a 'NoData' as a return when it fails.
I believe the last option (get a NoData back) would allow zabbix to not throw the trigger, or we would be able to make the trigger so that it doesn't go off because there was no data. However, i do not know how to do this. Is there a way for a item to return a specific value to indicate NoData?
We have a few custom items that run against a windows client with some powershell. The powershell script queries a service on the machine and provides some output. This is all done with discovered items and works very well. I'm amazed how nicely this can work with zabbix!
We have a small trigger on the value return, to detect when the value changes. These values are like variables and we just need to be notified if they are changed. The values are Text.
However, we've also found that if the script throws an error message (because, for example, the service is not available). This of course is returned as a bit of text and now the text is different and therefor our triggers go off. Because this is a discovered item, we suddenly get loads of triggers going of because 1 service is not available.
I've thought about a few solutions for this:
1) Make the trigger do an additional check to see if the service is up - this would mean that you have two items that are dependend on each other. I don't fully like this.
2) Make the powershell script on the remote machine better so it returns the same value as before, if the script fails (this is not great)
3) Make the powershell script cause a 'NoData' as a return when it fails.
I believe the last option (get a NoData back) would allow zabbix to not throw the trigger, or we would be able to make the trigger so that it doesn't go off because there was no data. However, i do not know how to do this. Is there a way for a item to return a specific value to indicate NoData?