On Wed, Mar 26, 2014 at 6:17 AM, David Lang <da...@lang.hm> wrote:

> On Tue, 25 Mar 2014, Nick Syslog wrote:
>
>  My team and I are working on new methods for monitoring our disk assisted
>> queues and additionally look for failures within these queues.
>>
>> Typically with a 'healthy' DA queue I will see an associated .qi file with
>> the queue files, my question is this: is a .qi file always generated by
>> rsyslog at the instantiation of a disk assisted queue?
>>
>>
>> We are trying to identify cases where the spool/queue files may have
>> become
>> orphaned and as such we would want to run recover_qi.pl to regenerate the
>> Queue Info file. That being said my understanding of how and when .qi
>> files
>> are generated is hazy and needs further clarification before we automate.
>>
>>
>> For some more details here is our thought process for discovery and/or
>> recovery:
>>
>> -Scan rsyslog hosts spool directories for any series of queue files
>> without
>> a matching ".qi" file.
>> -If a host is discovered to have queue files without a corresponding .qi
>> file then attempt a restart of rsyslog (in the event the queue files are
>> stale.)
>> -If after restart a .qi file is not discovered for the queue in question
>> then initiate recovery script to rebuild .qi file.
>>
>>
>> Does the above correspond to a sane attempt to monitor my queue files and
>> their potential error states or am I missing something with my
>> understanding and knowledge of when and how .qi files are actually
>> generated.
>>
>
> just to avoid race conditions (because nothing is truely simultanious on a
> computer), I would check to see if the file is open (via lsof or similar)
> just in case you catch any window between the two files being created. I
> would assume that if the file is open, it's not orphaned :-)
>
> Rainer will need to comment further.
>
>
I need to check the code, but I am 98% sure that rsyslog will NOT generate
the .qi file until actually needed. A core point is that any .qi file is
always outdated as long as rsyslog writes data to the disk queue. Thus, it
is persisted when rsyslog is shut down OR when the persist interval is
reached (which costs performance).

Having said that, using the .qi as a flag sounds reasonable. I could add an
option that it is created when the queue is started. It would be nice,
though, if you would contribute your scripts and accompanying doc to the
project, so that others can benefit as well. Would be even greater if we
could work together to provide that level of external monitoring and
recovery.

Rainer
_______________________________________________
rsyslog mailing list
http://lists.adiscon.net/mailman/listinfo/rsyslog
http://www.rsyslog.com/professional-services/
What's up with rsyslog? Follow https://twitter.com/rgerhards
NOTE WELL: This is a PUBLIC mailing list, posts are ARCHIVED by a myriad of 
sites beyond our control. PLEASE UNSUBSCRIBE and DO NOT POST if you DON'T LIKE 
THAT.

Reply via email to