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.
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.
Comment