Ad Widget

Collapse

monit the file

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • sofire
    Junior Member
    • Oct 2008
    • 2

    #1

    monit the file

    I wan to monit the files in a dir, if they are changed in 5 minutes.

    I write a shell:

    #!/bin/sh
    lines=`find /log/error/ -mmin -5 -type f`

    if [ "x$lines" != "x" ]
    then
    for i in $lines
    do
    echo $i
    done
    else
    echo ok
    fi

    Zabbix config:

    Item:
    type: ZABBIX agent
    key: logerror.new5
    Type of information: Character
    Update interval (in sec): 30

    I want:
    if the script return string "ok", or return the same string.
    I don't wan't to recieve email twice.
    so, gtrigger is:
    Expression: {host_name:logerror.new5.diff(0)}=1&{host_name:log error.new5.str(ok)}=0

    But I still recieve the two type of email.
    Something is wrong?
    Somebody can help me? Thanks.
  • Tenzer
    Senior Member
    • Nov 2007
    • 316

    #2
    You will both receive an e-mail when the trigger is TRUE and when it's FALSE. Is that your problem?

    Comment

    • sofire
      Junior Member
      • Oct 2008
      • 2

      #3
      I'm not sure, maybe yes.

      Comment

      Working...