2009-09-08 17:40:51 +02:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
# (c) 2008-2009 PandoraFMS.org Development Team
|
|
|
|
# This script is BSD Licensed.
|
|
|
|
|
|
|
|
# This script is used to copy all received data in /var/spool/pandora/data_in
|
|
|
|
# (default Pandora FMS incoming directory) to a remote Tentacle server.
|
|
|
|
|
|
|
|
# Define here your Parameters
|
|
|
|
|
|
|
|
TIMEOUT=5
|
|
|
|
SERVER_IP=192.168.50.1
|
|
|
|
|
|
|
|
# Main code, do not alter
|
|
|
|
|
|
|
|
while [ 1 ]
|
|
|
|
do
|
|
|
|
|
2009-11-11 19:06:58 +01:00
|
|
|
# Check before if I can connect to remote IP
|
|
|
|
CAN_CONNECT=`ping -c 1 -q $SERVER_IP | grep " 0%" | wc -l`
|
|
|
|
if [ "$CAN_CONNECT" == 1 ]
|
|
|
|
then
|
|
|
|
|
|
|
|
for myfile in `find /var/spool/pandora/data_in -type f`
|
|
|
|
do
|
|
|
|
|
|
|
|
tentacle_client -q -a $SERVER_IP $myfile
|
|
|
|
rm -Rf $myfile
|
|
|
|
|
|
|
|
done
|
|
|
|
fi
|
2009-09-08 17:40:51 +02:00
|
|
|
sleep $TIMEOUT
|
|
|
|
|
|
|
|
done
|