Algumas opções para você:
- Nagios + nrpe
Escreva um script simples para contar o número de arquivos * .html no diretório especificado:
COUNT='ls "$1"/*.html | wc -l'
if [ $COUNT -lt $3 ]; then
echo "OK - The number of html files in $1 is $COUNT"
exit 0
elif [ $COUNT -ge $3 -a $COUNT -lt $5 ]; then
echo "Warning - The number of html files in $1 is $COUNT""
exit 1
else
echo "Critical - The number of html files in $1 is $COUNT""
exit 2
fi
e chame-o em nrpe.conf com:
command[number_of_html_files]=/path/to/html_count.sh /etc/somedir1 -w 121 -c 141
- Ganglia + Gmetric:
Crie um arquivo html_count_gmetric.sh como abaixo:
/usr/bin/gmetric --name html_count --value 'ls "$1"/*.html | wc -l' --type uint32 --unit files
e coloque-o em um cron job:
* * * * * /path/to/html_count_gmetric.sh /etc/somedir1
ele criará um gráfico para você.