Re: how to parse oncheck output?
Posted in 1998
In article <6f6huf$kkt@zax.whoville.leftbank.com>,
cos@zax.whoville.leftbank.com (Ofer Inbar) wrote:
>
> I've written a short script to run all of the consistency checks
> recommended in chapter 31 of the Administrator's Guide:
>
> ----------------------------------------------------------------------
> #!/usr/bin/perl
>
> open DBLIST, "echo 'select name,owner,created,flags from sysdatabases'
> | dbaccess sysmaster - 2>&1 |"
> or die "can't open dbacess pipe: $!\\n";
> while (<DBLIST>) { push @dblist, $1 if
> /^(\\w+)\\s+\\S+\\s+\\d\\S+\\d\\s+\\d+\\s*$/ }
> close DBLIST;
>
> print `oncheck -cr`;
> print `oncheck -ce`;
> print `oncheck -cc`;
>
> foreach $db (@dblist)
> { print `oncheck -cI $db`;
> print `oncheck -cD $db`;
> }
> ----------------------------------------------------------------------
>
> What I'd like to do is run it from crontab and have it mail its output
> to a few people. But, oncheck is really verbose! I'd like it to send
> mail only if there's an actual problem that someone needs to worry
> about. It would be trivial for me to change those backtick calls into
> opens of pipes, and have perl parse the output to figure out if it's
> worth mailing out. Unfortunately, I have no clue what to look for.
> There doesn't seem to be any regular format for what oncheck spews
> out, nor is the format of its messages and error indications
> documented anywhere that I can find.
>
> One possible rule might be:
> Look for the word "error". Starting with the line that has the word
> "error", continue until you reach a blank line. That block of text is
> the entire error message for an actual problem.
>
> If that were true, I could write my script accordingly. It seems like
> a plausible rule to me, based on what I've seen of oncheck output so
> far, but without documentation I just don't *know*. I don't want to
> make a guess that will end up suppressing actual error messages that
> we need to see, leading to a false sense of confidence. But I also
> don't want to mail out the entire output every day, because people
> will stop reading it.
>
> I posted this question once before, about a year ago. I got one
> followup, but it was a big .shar of a bunch of shell & sed scripts
> that did a whole bunch of things not directly related to my question,
> and it was written for and tested Informix 5 whereas I'm running 7.22
>
> I don't actually want any scripts, because I want to tailor my script
> to our local needs anyway, and I definitely want to keep it all in
> perl. All I want is some documentation, or pointer to documentation,
> or description, of all the kinds of output oncheck might produce and
> how an automated script is supposed to be able to figure out what is
> important to report about. Since our database is mostly fine, and has
> always been so, I've never actually SEEN any real errors reported by
> oncheck, so I have no idea what they would look like when they do
> appear. I want to make sure my script will be able to handle anything
> oncheck throws at it. For example, being told "a serious error will
> aways start with the word 'ERROR:'", in and of itself, isn't helpful
> because perhaps some errors give multiline output, and I'd need to
> know how to identify those, and how to identify where the error
> message ends.
>
> I'm not afraid of reading manuals, but I just can't find this
> information and I don't know where to look for it.
>
> -- Cos (Ofer Inbar) -- cos@leftbank.com cos@cs.brandeis.edu
> -- The Left Bank Operation -- lbo@leftbank.com http://www.leftbank.com/
> It's been said that if a sysadmin does his job perfectly, he's the
> fellow that people wonder what he does and why the company needs him,
> until he goes on vacation. -- comp.unix.admin FAQ
>
I use the output of oncheck -pT a lot.
I have found a shell script ages ago in the IIUG archives
(look at www.iiug.org, but you know this anyway)
which brought tablename, allocated / used pages, first/next extentsize
into one line of text.
I then modified this a lot (V5->V7...) and now it gives me a file which I can
dbload into a table.
From there I collet grow rate in extents/pages/rows per server and
month/week (we have 99 machines), actual fill grade of indices & more
information of that sort
The sum function gives me an forecast how long it will take onarchive
to perform a LEVEL 0 ARCHIVE.
I am also looking for more information explaining all the output.
(oncheck -p{kKlL})
Out oncheck -cc always gives warnings so plus to the '-q' switch I parse
it's output for the word 'ERROR/error' as '-q' doesn't prevent all the
warnings & I can live with that (Never saw an error)
I am especially interested to learn if somebody has written a script
dealing with getting out which tables are to be reorganized TOGETHER
because we see extents of 10-15 tables lying around so, that to be
able to recreate the tables creating no 'holes' on disk & with bigger
first extent size we first have to copy/remove a buch of tables extents
to create sufficient contiguous space to allocate the then bigger pieces.
This is a disk defrag problem - any solutions ???
We use SNI RM400/RM600 & SINIX V5.43 & INFORMIX V7.12 UC1
Regards
Dick
Richard Kofler
EDVg-debis Systemhaus
Vienna, Austria
e-mail: richard_kofler@edvg.co.at
-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/ Now offering spam-free web-based newsreading