Hi all!
Another question...
I explain what I do, in crontab I put this line, run this script every 10 min.:
The script is this, return 2 value for 2 zabbix item (date & time):
In zabbix I configure the items in this way:
Description: DVD CFC Date
Type: ZABBIX agent (active)
key: datedvd.cfc
Type information: Character
Show value: As Is
Description: DVD CFC Time
Type: ZABBIX agent (active)
key: timedvd.cfc
Type information: Character
Show value: As Is
After a little work is fine, the result in zabbix is:
YYYYMMDD
HH:MM
Es.:
20080314
15:30
But now I miss only one thing, create a trigger for this two items.
For the date, trigger ON if no change evary 24h, better if different from today's date. And for time if it is different from time is 15 minutes.
If I explained evil ask please, thank you in advance.
Another question...

I explain what I do, in crontab I put this line, run this script every 10 min.:
Code:
0,10,20,30,40,50 * * * * /share/archivio/datedvd.sh "Colunga V1" /share/archivio/cfc/ cfc
Code:
#!/bin/sh
#########################################################################
#
# datedvd.sh
# Versione 1.0
# Autore: Lorenzo Giandomenico
#
# Date: 07/03/08
# Ultima revisione: 14/03/08 Alessandro Bagalini
#
#########################################################################
#
# Script per il controllo data ed ora dell'ultimo dato dei DVD.
# All'avvio dello script e' necessario specificare l'host, il percorso
# di partenza e la banca dati che si vuole controllare
#
# Es: ./datedvd.sh /share/archivio/cfc/ cfc
#
# La banca dati deve corrispondere alla chiave settata su Zabbix
#
#
HOST_CF=$1
DIR=$2
BANCA_DATI=$3
cd $DIR
for i in $( ls -d yd*); do
YDIR=$i
done
for i in $( ls -d $YDIR/md*); do
MDIR=$i
done
for i in $( ls $MDIR/*.dvd); do
FILE=$i
done
DATA=`head $FILE --lines=7 | tail --lines=1 | awk -F '=' {'print $2'} | awk {'print $1'}`
ORA=`head $FILE --lines=8 | tail --lines=1 | awk -F '=' {'print $2'} | awk {'print $1'}`
# echo $HOST_CF $DIR $DATA $ORA
zabbix_sender -z 172.23.0.35 -p 10051 -s "$HOST_CF" -k datedvd.$BANCA_DATI -o $DATA
zabbix_sender -z 172.23.0.35 -p 10051 -s "$HOST_CF" -k timedvd.$BANCA_DATI -o $ORA
~
Description: DVD CFC Date
Type: ZABBIX agent (active)
key: datedvd.cfc
Type information: Character
Show value: As Is
Description: DVD CFC Time
Type: ZABBIX agent (active)
key: timedvd.cfc
Type information: Character
Show value: As Is
After a little work is fine, the result in zabbix is:
YYYYMMDD
HH:MM
Es.:
20080314
15:30
But now I miss only one thing, create a trigger for this two items.
For the date, trigger ON if no change evary 24h, better if different from today's date. And for time if it is different from time is 15 minutes.
If I explained evil ask please, thank you in advance.


Comment