~gnarvaja/mysar/trunk

« back to all changes in this revision

Viewing changes to mysar.pl

  • Committer: Gerry
  • Date: 2009-09-11 02:15:12 UTC
  • Revision ID: gnarvaja@gmail.com-20090911021512-409ng41p974cv3sf
Bug fix and cosmetic changes.

Show diffs side-by-side

added added

removed removed

Lines of Context:
245
245
 
246
246
        # if sepecified purge old values
247
247
        if ($my_purge ne 0) {
 
248
                print "***> purge before $my_purge days\n";
248
249
                $sth = $dbh->prepare("DELETE FROM value_stat ".
249
250
                        "WHERE DATE(value_stat_timestamp) = DATE(SUBDATE(NOW(), INTERVAL ? DAY))")
250
251
                                or die "ERROR: DELETE FROM value_stat on prepare\n";
251
 
                $sth = execute($my_purge)
 
252
                $sth->execute($my_purge)
252
253
                        or die "ERROR: DELETE FROM value_stat on execute\n";
253
254
        } # if $my_purge
254
255
 
356
357
        } # if opt(varfile)
357
358
 
358
359
        # Retrieve the list of (global) variables
 
360
        print "***> my_variables: $my_variables\n";
359
361
        if ($my_variables eq 1) {       # value is set at the begining of the main section
360
362
                print "*** Retrieving configuration variables from the DB\n";
361
363
                my ($var_name, $var_value);
413
415
                        close $in_var;
414
416
                        } # while
415
417
                } # if my_all_variables
416
 
 
417
 
                # Retrieve the list of (global) status
418
 
                if ($my_status eq 1) {  # value is set at the begining of the main section
419
 
                        print "*** Retrieving status variables from the DB\n";
420
 
                        get_status_vars($ts);
421
 
                } # $my_status eq 1
422
418
        } # if my_variables
 
419
 
 
420
        # Retrieve the list of (global) status
 
421
        if ($my_status eq 1) {  # value is set at the begining of the main section
 
422
                print "*** Retrieving status variables from the DB\n";
 
423
                get_status_vars($ts);
 
424
        } # $my_status eq 1
 
425
 
423
426
} # sub get_all_vars
424
427
 
425
428
# ---------------------------------------------------------------------------
426
429
# BEGIN 'MAIN'
427
430
# ---------------------------------------------------------------------------
428
 
print   "\n * mysar v$mysarversion - Gerardo Narvaja\n".
 
431
print   " * mysar v$mysarversion - Gerardo Narvaja\n".
429
432
        " * Developed at Pythian Inc. http://www.pythian.com\n".
430
 
        " * Use \"perldoc mysar.pl\" for usage information";
 
433
        " * Use \"perldoc mysar.pl\" for usage informationi\n";
431
434
 
432
435
if ($opt{status} ne 0) { $my_status = 1; }
433
436
if ($opt{variables} ne 0) { $my_variables = 1; }