Ad Widget

Collapse

Change hardcoded values for Ping/SSH triggers to use macros allow better flexibility

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • weiers
    Junior Member
    • Oct 2022
    • 1

    #1

    Change hardcoded values for Ping/SSH triggers to use macros allow better flexibility

    Hello,

    We've recently started using zabbix and have found some inconsistency's for when a macro vs hardcoded values are used in triggers in the base templates.
    The two we've run across so far are in the ping and ssh templates.
    For examples
    The trigger Unavailable by ICMP ping in the icmp ping template uses the below expression:
    max(/ICMP Ping/icmpping,#3)=0

    The trigger SSH service is down on {HOST.NAME} uses the below express:
    max(/SSH Service/net.tcp.service[ssh],#3)=0

    Now this causes some problems when you want to template out some standard tests like ssh and ping. where all machines must follow the baseline templates values, or they end up with duplicate triggers per host to change the values, or you end up with a nonstandard custom base template.

    If we compare it to the trigger Zabbix agent is not available in the template Linux by Zabbix agent
    The express used is:
    max(/Linux by Zabbix agent/zabbix[host,agent,available],{$AGENT.TIMEOUT})=0

    Instead of having a hardcoded number of times it fails before alerting it is instead changed to a macro that can be more easily overwritten on a host by host basis without having to duplicate triggers or duplicate templates.

    The proposed changes to the two mentioned triggers above would be:
    Change icmp ping to use a macro i.e.
    max(/ICMP Ping/icmpping,{$PING.TIMEOUT})=0

    Change ssh to use a macro i.e.
    max(/SSH Service/net.tcp.service[ssh],{$SSH.TIMEOUT})=0

    This would help keep changes to templates as minimal as possible while allow more flexibility per host without causing duplications in triggers or templates.

    -------------
    Tim Weiers
    IST - System Administration Unix/Linux
    University of Alberta
    Last edited by weiers; 28-10-2022, 20:44.
  • cyber
    Senior Member
    Zabbix Certified SpecialistZabbix Certified Professional
    • Dec 2006
    • 4807

    #2
    You should post your suggestion here https://support.zabbix.com/browse/ZBXNEXT

    Comment

    Working...