Ad Widget

Collapse

Create txt file based on triggers

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • DonPook
    Member
    • Dec 2019
    • 38

    #1

    Create txt file based on triggers

    Hello,

    I am trying to create an action, where a txt file will be created / updated everytime I get triggers. I am guessing this requires some sort of scripting. Anyone has anything similar?

    Thanks in advance.
  • Ed.M
    Member
    • Mar 2020
    • 42

    #2
    Hello!
    You should create an action for trigger you need. Action should identify trigger (a lot of options how to do it), then you should describe an operation of type "Remote command" and there you should choose type of script, where it should be executed (Zabbix server, agent or proxy), and write commands to execute. For example: echo $(date) >> /path/to/file.txt

    Comment


    • DonPook
      DonPook commented
      Editing a comment
      Thank you for your answer! What if I want the whole trigger name and Value? Do you know the properties I should echo? (I'm really bad at this, sorry)
  • Ed.M
    Member
    • Mar 2020
    • 42

    #3
    When you create an Action for trigger, you can use macros, like {TRIGGER.DESCRIPTION}, {TRIGGER.NAME}, {TRIGGER.VALUE} and many others. Supported macros you can find in documentation: https://www.zabbix.com/documentation...ed_by_location
    You can use them in script commands too. So you can do echo {TRIGGER.NAME} >> /path/to/file.txt for example.

    Comment

    Working...