[Box Backup] NotifySysadmin Function

Matt Brown boxbackup@fluffy.co.uk
Thu, 13 Sep 2007 21:54:54 +0100


Hi Chris,

I was wondering ....

Currently the Notify script is passed and Int when an error occurs -  
which in turn will fire the NotifyScript ..

However what then happens is a mail is sent saying read-error check  
the logs .. so I look in the logs and see ..

Sep 13 21:08:19 sali Box Backup (bbackupd)[22163]: Sending stream,  
size uncertain
Sep 13 21:08:20 sali Box Backup (bbackupd)[22163]: Receive Success 
(0x2aea0)
Sep 13 21:08:20 sali Box Backup (bbackupd)[22163]: Send ListDirectory 
(0x29fed,0xffffffff,0xc,true)
Sep 13 21:08:20 sali Box Backup (bbackupd)[22163]: Receive Success 
(0x29fed)
Sep 13 21:08:20 sali Box Backup (bbackupd)[22163]: Receiving stream,  
size 473
Sep 13 21:08:20 sali Box Backup (bbackupd)[22163]: NOTICE: About to  
notify administrator about event read-error, running script '/etc/box/ 
bbackupd/NotifySysadmin.sh read-error'
Sep 13 21:08:21 sali Box Backup (bbackupd)[22163]: Send DeleteFile 
(0x2bd3,"mysql-bin.000563")
Sep 13 21:08:21 sali Box Backup (bbackupd)[22163]: Receive Success 
(0x2bd4)

Which does not really tell me what file could not be read - unless in  
this case its mysql-bin.000563 ? I have LogAllFileAccess = Yes and  
ExtendedLogging = Yes ...

So (not being a C++ programmer) I thought I would look at the source  
to see if its possible to pass the filename or dir that could not be  
read into the function call as passed which would help track the  
error down, sadly I dont know enough about C to modify it .. is this  
a relevatively easy thing to add/change ? Any pointers would be  
great :-)

Btw I am putting together a perl script of sorts together for the  
notify bit, I will post something when I have it working :-)

Regards

Matt Brown