root/trunk/omnipitr/doc/omnipitr-monitor.pod

Revision 156, 2.9 kB (checked in by depesz, 4 years ago)

Update copyright info

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