Ad Widget

Collapse

monthly alert by customer (host group)

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • tlabaume
    Junior Member
    • Feb 2014
    • 1

    #1

    monthly alert by customer (host group)

    Hi,

    I'm in Zabbix 2.2.2 (just upgraded) and I would like to extract easily a report in CSV format including all alert for a host group with date/hour, host, message, severity

    I tried to create a external script under configuration/actions/operations in order to generate a txt file with those information but it seems that required parameters cannot be passed to the script. Does someone knows how to do that ?

    I also tried to create a special media associated to one user using parameters $1 $2 and $3 but those parameters doesn't include the required information (host, severity). It seems that the script is executed but parameters are still empty.

    I also look if there is a way to directly export alert to a syslog server but it seems that this function isn't implemented in Zabbix.


    Here is my actual script :

    #!/bin/bash
    to=$1
    subject=$2
    body=$3
    echo "$to" "$subject" "$body" >>/var/log/zabbix/alert_zabbix.log

    launch with /usr/lib/zabbix/alertscripts/alert.sh %1 %2 %3 in configuration/action/operations as a custom script on zabbix server

    Thanks for your help.
  • JvGinkel
    Junior Member
    • Jan 2014
    • 10

    #2
    In an alertscript you supply with the person you want to send something to, a subject and the body itself. When calling the script, you don't provide the parameters as %1 %2 %3.
    $1 is supplied in the Media for the user

    $2 and $3 are supplied in the action (Configuration -> Actions) where you build the message you want to send.

    Since the data is stored in a database it is possible to create a script outside Zabbix where you access the database, extract the data you want to send and process it.

    Comment

    Working...