Changeset 64

Show
Ignore:
Timestamp:
12/10/09 18:19:53 (4 years ago)
Author:
depesz
Message:

looks like a solid base for monitoring, perhaps will be extended later

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/omnipitr/doc/omnipitr-monitor.pod

    r57 r64  
    33=head2 USAGE 
    44 
     5/some/path/omnipitr/bin/omnipitr-monitor --log=... --check=... [--state-dir=...] [options] 
     6 
     7Where: 
     8 
     9=over 
     10 
     11=item * --log (-l) Points to logfile created by I<OmniPITR> tool that should be monitored. 
     12 
     13It can contain strftime-type marks - just like --log argument to other 
     14I<OmniPITR> programs. 
     15 
     16=item * --check (-c) contains name of check that should be performed. 
     17 
     18For list of check, please read L<CHECKS> section. 
     19 
     20=item * --state-dir (-s) is a name of directory that can be used to store state 
     21between calls to checks 
     22 
     23This is primarily used to report rates or errors - to avoid checking full logs, 
     24and just check from last known position. 
     25 
     26=item * options depend on which check being performed. 
     27 
     28Most checks don't have any options. List of options for check is supplied in 
     29L<CHECKS> section. 
     30 
     31=back 
     32 
    533=head2 DESCRIPTION 
    634 
     35This script simply reads log files from other I<OmniPITR> tools, and reports 
     36values useful for monitoring in Nagios, Cacti or other tools. 
     37 
     38=head2 CHECKS 
     39 
     40=head3 last-archive-age 
     41 
     42When was the last WAL segment archived. Returns value in seconds being interval 
     43between "now" and the moment when last archive happened. 
     44 
     45Requires path to log from I<omnipitr-archive> 
     46 
     47=head3 last-restore-age 
     48 
     49When was the last WAL segment restored. Returns value in seconds being interval 
     50between "now" and the moment when last restore happened. 
     51 
     52Requires path to log from I<omnipitr-restore> 
     53 
     54=head3 errors 
     55 
     56Lists all errors that happened from last call to errors check in given logfile. 
     57 
     58Can have option: 
     59 
     60--from 
     61 
     62Where value of from is treated as: 
     63 
     64=over 
     65 
     66=item * Date time in format: %Y-%m-%d %H:%M:%S (for example: 2009-12-24 
     6715:45:32) 
     68 
     69=item * interval, in seconds (for example: 300 - means check last 5 minutes) 
     70 
     71=back 
     72 
     73Works with logfiles of all types. 
     74 
     75=head3 last-backup-age 
     76 
     77Returns when last backup was finished, in seconds that passed since. 
     78 
     79Requires path to log from I<omnipitr-master-backup> or I<omnipitr-slave-backup> 
     80 
    781=head2 EXAMPLES 
     82 
     83=head3 Getting age of last archive: 
     84 
     85    .../omnipitr-monitor -l /var/log/omnipitr/archive-%Y-%m-%d.log -c last-archive-age -s /var/lib/omnipitr 
     86 
     87=head3 Getting age of last wal restore: 
     88 
     89    .../omnipitr-monitor -l /var/log/omnipitr/restore-%Y-%m-%d.log -c last-restore-age -s /var/lib/omnipitr 
     90 
     91=head3 Getting errors for raporting: 
     92 
     93    .../omnipitr-monitor -l /var/log/omnipitr/archive-%Y-%m-%d.log -c errors -s /var/lib/omnipitr 
     94 
     95=head3 Getting errors for raporting, but checking always only last 10 minutes of 
     96logs: 
     97 
     98    .../omnipitr-monitor -l /var/log/omnipitr/archive-%Y-%m-%d.log -c errors -s /var/lib/omnipitr --from=600 
    899 
    9100=head2 COPYRIGHT 
    10101 
    11102The OmniPITR project is Copyright (c) 2009 OmniTI. All rights reserved. 
    12