Ad Widget

Collapse

Zabbix Host Tagging

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • MRedbourne
    Senior Member
    • Feb 2023
    • 103

    #1

    Zabbix Host Tagging

    Hey folks,

    We're working to custom tag our hosts in Zabbix. It's necessary because the hosts aren't always named in a manner that makes them easily identifiable. Ideally, any time a problem is encountered (and it generates an email to us), I'd like the custom tag to be injected into the email. What I've done is:
    1. Gone to Monitoring -> Hosts -> Config -> Tags and defined a keypair of: CLIENT:<VALUE>
    2. Gone to Administration -> Media Types -> Message Templates and modified the following types:
      1. Problem
      2. Problem Recovery
      3. Problem Update
      4. I've set each subject to "<TYPE>: {EVENT.NAME} on {HOST.CLIENT}"
    All that happens now is I get the literal "{HOST.CLIENT}" injected into the subject, not the actual tag value.

    Click image for larger version

Name:	image.png
Views:	1189
Size:	9.0 KB
ID:	464689
    Click image for larger version

Name:	image.png
Views:	1117
Size:	20.4 KB
ID:	464690
    In the above case at problem generation for a downed SSH daemon, I should get an email with the subject: "Problem: [Trigger] [SSH] [Daemon Check] SSH Dead on Major Div - Min Div". I'm currently getting: "Problem: [Trigger] [SSH] [Daemon Check] SSH Dead on {HOST.CLIENT}"

    Is what I'm trying to do supported? If so, what am I doing wrong here?

    Cheers,
    Mike​
  • ISiroshtan
    Senior Member
    • Nov 2019
    • 324

    #2
    Please check list of supported Macros by loacation here. Not sure where does {HOST.CLIENT} coming from, I dont see {HOST.<TAG>} as supported macros.
    What I expect to work is {EVENT.TAGS.<tag name>}, so for your case {EVENT.TAGS.CLIENT}.

    Please do note that I did not test it out on real server so feel free to tell if it still fails.

    Comment

    • cyber
      Senior Member
      Zabbix Certified SpecialistZabbix Certified Professional
      • Dec 2006
      • 4807

      #3
      yep.. Inventing macros is not giving you anything.. Use existing ones, {EVENT.TAGS.<tag name>} should be the one you look for.

      Comment

      Working...