Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

We've implemented a folder sync across two servers sitting in two different data centres using Unison. It's crucial for us that this folder sync work as expected as our SLAs depend on the data being available at both ends.

So far Unison has been working like an ace, no problems.

However, we need to implement a mechanism to ensure that someone is notified if Unison does throw up an error. I know of the standard Unison logs. But in addition to the standard logs I'm looking for another log that would only report errors, not the entire verbose log of everything the Unison service is doing.

This way we can monitor this 'errors-only' log and send out emails or SMSs to notify the correct individuals.

share|improve this question
add comment

2 Answers

up vote 2 down vote accepted

We use a wrapper around Unison that, on failure, creates a file in /tmp based on the pathname of the directory to sync. Then, there is a service check in Nagios that checks for the presence of these files, and sends up an alert if found. This way there is the verbose Unison log for more information, a quick way to know if something went wrong, and automated email/SMS if/when it does. You could also use cron for this if something like Nagios isn't available.

share|improve this answer
    
Thanks Kendall, maybe a wrapper around Unison is the way to go. As a short term fix we may have something crude watching the verbose logs but the longer run need something that will spit out errors in the way our notification system would need it. –  Mayuresh Walke Dec 30 '11 at 16:07
add comment

I don't test but you can maybe use the logfile directive to have all the modifications, and the quiet to stop the stdout. You will just have the errors, so you can redirect them to a mail, a logfile...

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.