Ad Widget

Collapse

Include part of textfile in email notification

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • zswss
    Junior Member
    • Jun 2018
    • 3

    #1

    Include part of textfile in email notification

    I'm monitoring a text file on windows. When the file contains the string "example" I receive an email. Setup of Item and Trigger is as follows:

    Item:
    Type= Zabbix agent (active)
    Key= vfs.file.regmatch[c:\zabbix\Test.txt,"example",,,10]
    Type= Numeric (unsigned)

    Trigger:
    {hostname:vfs.file.regmatch[c:\zabbix\test.txt,"example",,,10].last()}=1

    The textfile will look something like this:

    06/27/2018 06:00:04 this is example1.
    06/27/2018 06:00:04 this is example4
    06/27/2018 06:00:04 this is example6

    or :
    06/27/2018 06:00:00 nothing to report.


    Is it possible to include every occurence of "example" in the email zabbix sends? And if so, how?


    (Zabbix 3.4.7)
  • kernbug
    Senior Member
    • Feb 2013
    • 330

    #2
    Originally posted by zswss


    Is it possible to include every occurence of "example" in the email zabbix sends? And if so, how?


    (Zabbix 3.4.7)
    Hi,

    You can perform an action if trigger fired up: https://www.zabbix.com/documentation...remote_command

    Trigger->Remote Action (get data from log file)-> Send data via e-mail
    or
    Trigger -> Trigger Action (remotely get data from log)-> Send an alert via email with the attachemnent (getting data from the host may be very slow, performance impact on the alerter and escalator)

    Comment

    • zswss
      Junior Member
      • Jun 2018
      • 3

      #3
      Trigger->Remote Action (get data from log file)-> Send data via e-mail
      or
      Trigger -> Trigger Action (remotely get data from log)-> Send an alert via email with the attachemnent (getting data from the host may be very slow, performance impact on the alerter and escalator)
      I understand the principle of remote actions; I have them set up to start services if a trigger is fired. (this to indicate everything is set up correctly for use of remote commands)

      I'm assuming I need to configure two steps in Actions-->Operations?
      One to run the command, one to send the message? How do I include the results of the command to get sent with the alert?

      Could you please show me an example of how to set this up?

      Comment

      Working...