View Full Version : Import archive logs satellite in centreon
nks
18th November 2009, 12:13
How can I import archive logs from a satellite into the centreon central server? For the centreon server itself i did it like:
# ./bin/logAnalyser -a
# ./cron/archiveDayLog -r
And that worked perfectly. But how is it done for a satellite?
DonKiShoot
18th November 2009, 20:16
Hi,
This is how to do it on master to download archives from all pollers :
su - nagios
echo "SYNCARCHIVES:0" > /var/lib/centreon/centcore.cmd
Rem : "SYNCARCHIVES:2" for poller n°2
Regards,
nks
18th November 2009, 22:05
Hi DonKiShoot,
thanks for the reply but i had to do some things more.....
first of all i turned on logging on centcore. After that i executed the command you gave me. The log was showing:
18/11/2009 21:31:56 - rsync --timeout=5 --port=22 -c
<ip adres> :/usr/local/nagios/var/archives//*.log /var/lib/centreon/log/2/archives/
18/11/2009 21:31:56 - Start Synchronizing archives for poller 2
18/11/2009 21:31:56 - Synchronize over for poller 2
But that was not working! (see the last line, it's directly finished)
So i tried to set the correct rights on the directory /var/lib/centreon/log/2/archives/ (nagios:nagios) and started the command again. This with the same result.
After that i started the rsync manually from the commandline and that failed!
I had not installed rsync at all! I had to install this on the central server as well as on the satellites to get this to work. Eventually it worked. Great!
Just one more question:
are the logs now automatically read in and visible in centreon or do i have to do something more?
nks
23rd November 2009, 11:17
Hi, i managed to reread the archive logs from the central centreon server as well as the satellites. For other users, here is how i did it:
On advice of DonKiShoot i first got the archivelogs from the remote hosts with (the central server is poller 1):
(poller 2)
echo "SYNCARCHIVES:2" > /var/lib/centreon/centcore.cmd
(poller 3)
echo "SYNCARCHIVES:3" > /var/lib/centreon/centcore.cmd
After the files where transferred to the central server i ran:
*NOTE* remember to set your Logs Retention Duration to the maximum of days of your logfiles.
# /usr/local/centreon/bin/logAnalyser -a
# /usr/local/centreon/cron/archiveDayLog -r
And that's it! Your records are now read in again and ready for use.