Ad Widget

Collapse

Create a file if trigger changes, instead of sending an email?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • jompsi
    Junior Member
    • Jul 2015
    • 2

    #1

    Create a file if trigger changes, instead of sending an email?

    Hello

    I have a question about actions a trigger can execute. It is like this. In the company I work, an alarmcenter is already existing, which works with XML files.

    Now I got the assignment, that if for example a server is down, zabbix should create in a specific folder an XML file, which will be used from the existing alarmcenter to generate a VBA Msgbox alert. This type
    of notification is just for low priorities events.

    For more importent tasks I use the mail action which comes with zabbix.

    Goal of this task is to keep the number of sent emails as low as possible.

    I have created the following alert script:

    Code:
    jompsi@zabbix:/usr/lib/zabbix/alertscripts# cat xml
    #!/bin/bash
    
    to=$1
    subject=$2
    body=$3
    out=/tmp/test.xml
    
    echo $subject>$out
    echo $body>>$out
    Then I created the media type script for my xml(Administration -> Media Type -> Create New) file and added it to my users media(Profile -> Media). Now if the trigger changes it creates the file.

    What do you think about this? Are there betters ways? What makes me unhappy with this solution is, that I have to connect this alert script with a user.

    What I imagine is something like "IF trigger comes true THEN create xml file".

    Thanks and kind regards
    jompsi
  • Atsushi
    Senior Member
    • Aug 2013
    • 2028

    #2
    We can a set flexible operation by the definition of each by combining at the disaster occurs.

    I think the benefits of using the media also can aggregate the setting and process for send messages.
    Because such as e-mail transmission is the same process with only a different destination.

    If you have than not only that the output XML, it is also possible to run the script by using the remote commands without using the media.

    Comment

    • jompsi
      Junior Member
      • Jul 2015
      • 2

      #3
      Hi @Atsushi

      Thanks a lot for your reply

      How do you set a flexible operation? Configuration -> Actions?

      So you would say my approach is good?

      I will look a bit more into remote commands.

      Comment

      Working...