Ad Widget

Collapse

Is it possible to conditionally check one item based on the value of another?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • sscotter
    Junior Member
    • Jan 2022
    • 7

    #1

    Is it possible to conditionally check one item based on the value of another?

    Hi,

    Long time Zabbix user, first time poster!

    I have a situation where I want to have a single template to monitor two different bits of time keeping software (chrony and ntp), however only one bit of software will ever be present on a machine.

    Here's a visual representation of the problem. This particular host has chrony installed and I'm getting chrony related stats back. All the ntp items are coming back unsupported (understandable).


    Click image for larger version

Name:	2022-01-05 16_53_27.png
Views:	415
Size:	85.5 KB
ID:	437748

    What I would ideally like is if the /usr/bin/ntpq existence item comes back with a zero then to skip the ntp.stat[*] checks. Likewise, if the /usr/bin/chronyc existence item comes back with a zero then it would skip the chrony.stat[*].

    I looked at Dependant Items but have since realised I'm barking up the wrong tree with that one.

    I understand I could create two templates and assign each host the correct one, however in our environment we have a combination of ntp and chrony and over a hundred hosts so will be difficult to implement and manage. I also want to cater for situation where a host has neither (ie, trigger an alert).

    Any help gratefully received!

    Regards

    Steve
Working...