Not bad, so far. I ran it, and it worked just fine after I hit CPAN for Number::Format.

I did see some odd things, but I am running ASE 12.0, and you seem to be running ASE 11.9.2. In any event, I know my log is not 100% full.

I appreciate seeing how you set up your query to the database and deal with the results. Everyone I see has done it just a little differently, which is one of the reasons I like Perl.

One thing I use in nearly all my databases is threshholds. For example, I created a threshhold to dump the log at about 80% full, thereby eliminating a great deal of "pooper scooping" when people write poorly-framed queries.

Following is the output from my first try with your script:

9:14am % ./view_log_size.pl -U xxxxxx -P xxxxxxxxxxxxxx -D xxxx
Argument "buffer manager" isn't numeric in addition (+) at ./view_log_size.pl line 94.
Argument "not applicable" isn't numeric in multiplication (*) at ./view_log_size.pl line 91.
Argument "not applicable" isn't numeric in multiplication (*) at ./view_log_size.pl line 91.
Use of uninitialized value in concatenation (.) at ./view_log_size.pl line 122.
   Warning! Resources are getting low in Sybase database!
   Threshold used: 
      Log or Data Empty Percent greater than 30.00%

       Host: xxxx
   Database: xxxxx
     Server: 
      Owner: xxxxx
    Created: Apr 01, 1999

   Total Size: 1,144.41 MB

    Data Size: 953.67 MB
    Data Used: 399.99 MB
    Data Free: 553.69 MB
        Empty: 58.06%

     Log Size: 190.73 MB
     Log Used: 190.73 MB
     Log Free: 0
        Empty:  0.00%

   Please fix the situation ASAP!

-----
"Computeri non cogitant, ergo non sunt"


In reply to RE: Check Sybase data/log sizes by cadfael
in thread Check Sybase data/log sizes by lachoy

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.