[Orca-users] Stopping 'file did exist and is now gone' message(s).

isaac r. izsun at yahoo.com
Sat Nov 23 17:21:00 PST 2002


Blair,

Better yet - forget about checking if the filename
has changed (i.e. whether it got compressed or not).

Simply check if the inode is there. The inode stays
the same eventhough the filename changes.

Perl has a system call (escapes my mind which one),
that shows all the details about a file, including
mtime,accesstime,filename, and all the rest of  it...

So, an algorithm might become: -

Check if the inode is still there and (regardless
if the filename changed) when/if the inode is NOT
there, THEN complain.
 

?

-I


--- Blair Zajac <blair at orcaware.com> wrote:
> Blair Zajac wrote:
> > 
> > "isaac r." wrote:
> > >
> > > Dear Blair,
> > >
> > > Thanks for the direct pointer to a file where to
> > > change this.
> > >
> > > I've modified the 'if' one-liner condition.
> > >
> > > Here's the synopsis and the 'if' line to change.
> > >
> > > # ---------------------------------------
> > > # iz - making a modification to minimize warning
> > > emails
> > > # by checking if the hour on the clock is
> midnight,
> > > # which means the day has changed within the
> last
> > > hour.
> > > # If it did, then do not send the warning email
> and
> > > ignore the
> > > # fact that the file is gone (i.e. possibly
> > > compressed). Otherwise, send
> > > # an email.
> > > # ---------------------------------------
> > >
> > > Basically, assuming 'date' lives in '/bin' on
> > > your system, change:
> > >
> > >    if ($file_status == -1) {
> > >
> > > to:
> > >
> > >    if ($file_status == -1) && (`/bin/date
> > > '+%H'`!='00')  {
> > >
> > > This should do it.  It will also prevent OTHER
> types
> > > of alarms from being generated, reasons for
> which
> > > might be
> > > different then due to simply compressing the
> file.
> > > But this puts a 60 minute cap on a window within
> which
> > > some warning emails will not be generated.
> > >
> > > Thoughts ?
> > 
> > Thanks for the patch.  I don't like to call out to
> external
> > programs in Orca, given that Perl already has
> access to all
> > the necessary information without forking a new
> process.
> > 
> > How about using the localtime call and rewriting
> the patch?
> 
> Actually, thinking about it more, what I'd like Orca
> to do is
> to check if there are compressed versions of the
> filename (i.e.
> check if filename.{Z,gz,bz2} exists and if it was
> created in the
> last X minutes.  Otherwise, complain.  This way, if
> there is a
> real error around midnight, then it won't be
> ignored.  In fact,
> most errors could occur at midnight if something
> goes wrong with
> the compression of the file.
> 
> Best,
> Blair
> 
> -- 
> Blair Zajac <blair at orcaware.com>
> Web and OS performance plots -
http://www.orcaware.com/orca/


__________________________________________________
Do you Yahoo!?
Yahoo! Mail Plus – Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com



More information about the Orca-users mailing list