summaryrefslogtreecommitdiff
path: root/docs/pingdomfetch.1
blob: 00f5b9606f0f45a3a9ab47d7a638f2c3cf8d542d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
.\" Automatically generated by Pod::Man 2.25 (Pod::Simple 3.16)
.\"
.\" Standard preamble:
.\" ========================================================================
.de Sp \" Vertical space (when we can't use .PP)
.if t .sp .5v
.if n .sp
..
.de Vb \" Begin verbatim text
.ft CW
.nf
.ne \\$1
..
.de Ve \" End verbatim text
.ft R
.fi
..
.\" Set up some character translations and predefined strings.  \*(-- will
.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left
.\" double quote, and \*(R" will give a right double quote.  \*(C+ will
.\" give a nicer C++.  Capital omega is used to do unbreakable dashes and
.\" therefore won't be available.  \*(C` and \*(C' expand to `' in nroff,
.\" nothing in troff, for use with C<>.
.tr \(*W-
.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'
.ie n \{\
.    ds -- \(*W-
.    ds PI pi
.    if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch
.    if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\"  diablo 12 pitch
.    ds L" ""
.    ds R" ""
.    ds C` ""
.    ds C' ""
'br\}
.el\{\
.    ds -- \|\(em\|
.    ds PI \(*p
.    ds L" ``
.    ds R" ''
'br\}
.\"
.\" Escape single quotes in literal strings from groff's Unicode transform.
.ie \n(.g .ds Aq \(aq
.el       .ds Aq '
.\"
.\" If the F register is turned on, we'll generate index entries on stderr for
.\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index
.\" entries marked with X<> in POD.  Of course, you'll have to process the
.\" output yourself in some meaningful fashion.
.ie \nF \{\
.    de IX
.    tm Index:\\$1\t\\n%\t"\\$2"
..
.    nr % 0
.    rr F
.\}
.el \{\
.    de IX
..
.\}
.\"
.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
.\" Fear.  Run.  Save yourself.  No user-serviceable parts.
.    \" fudge factors for nroff and troff
.if n \{\
.    ds #H 0
.    ds #V .8m
.    ds #F .3m
.    ds #[ \f1
.    ds #] \fP
.\}
.if t \{\
.    ds #H ((1u-(\\\\n(.fu%2u))*.13m)
.    ds #V .6m
.    ds #F 0
.    ds #[ \&
.    ds #] \&
.\}
.    \" simple accents for nroff and troff
.if n \{\
.    ds ' \&
.    ds ` \&
.    ds ^ \&
.    ds , \&
.    ds ~ ~
.    ds /
.\}
.if t \{\
.    ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u"
.    ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u'
.    ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u'
.    ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u'
.    ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u'
.    ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u'
.\}
.    \" troff and (daisy-wheel) nroff accents
.ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V'
.ds 8 \h'\*(#H'\(*b\h'-\*(#H'
.ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#]
.ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H'
.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u'
.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#]
.ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#]
.ds ae a\h'-(\w'a'u*4/10)'e
.ds Ae A\h'-(\w'A'u*4/10)'E
.    \" corrections for vroff
.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u'
.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u'
.    \" for low resolution devices (crt and lpr)
.if \n(.H>23 .if \n(.V>19 \
\{\
.    ds : e
.    ds 8 ss
.    ds o a
.    ds d- d\h'-1'\(ga
.    ds D- D\h'-1'\(hy
.    ds th \o'bp'
.    ds Th \o'LP'
.    ds ae ae
.    ds Ae AE
.\}
.rm #[ #] #H #V #F C
.\" ========================================================================
.\"
.IX Title "PINGDOMFETCH 1"
.TH PINGDOMFETCH 1 "2015-01-02" "pingdomfetch " "User Commands"
.\" For nroff, turn off justification.  Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
.nh
.SH "NAME"
pingdomfetch \- A small and humble tool to fetch availability stats from Pingdom and notify via E\-Mail
.SH "SYNOPSIS"
.IX Header "SYNOPSIS"
pingdomfetch
    [\-\-all\-services]
    [\-\-all\-tls]
    [\-\-checkid <\s-1STRING\s0>]
    [\-\-config <\s-1STRING\s0>]
    [\-\-flatten <\s-1STRING\s0>]
    [\-\-from <\s-1STRING\s0>]
    [\-\-help]
    [\-\-list\-services]
    [\-\-list\-tls]
    [\-\-notify]
    [\-\-notify\-dummy]
    [\-\-notify\-info]
    [\-\-service <\s-1STRING\s0>]
    [\-\-sort\-reverse]
    [\-\-tls <\s-1STRING\s0>]
    [\-\-to <\s-1STRING\s0>]
    [\-\-verbose]
    [\-\-version]
.SH "DESCRIPTION"
.IX Header "DESCRIPTION"
pingdomfetch is a tool to fetch availability stats from www.Pingdom.com and notifies the results via Email. You may use this script to extend it to do other things with the results as well. Pingdom already provides notification emailing.
.PP
Pingdomfetch also knows about 'so called' top level services (one top level service consists of several services).
.SH "CONFIG"
.IX Header "CONFIG"
.SS "Possible locations"
.IX Subsection "Possible locations"
Create a config at one of the following (or into several) location:
.PP
.Vb 5
\&    /etc/pingdomfetch.conf
\&    ./pingdomfetch.conf
\&    /etc/pingdomfetch.d/*.conf
\&    ~/.pingdomfetch.conf
\&    ~/.pingdomfetch.d/*.conf
.Ve
.PP
The last config file always overwrites the values configured in the previous config files. For this use the sample configuration file \fI/usr/share/pingdomfetch/examples/pingdomfetch.conf.sample\fR. Please read that sample configuration file carefully since it also describes all available config options.
.PP
It makes sense to have one global config \fI/etc/pingdomfetch.conf\fR containing all general configurations and for each top level service a separate config in \fI/etc/pingdomfetch.d/TLSNAME.conf\fR.
.SS "Top level services and services"
.IX Subsection "Top level services and services"
\fIConfigure a top level service:\fR
.IX Subsection "Configure a top level service:"
.PP
Each top level service consists of many services. Since Pingdom does not know about top level services but just about separate checks (which are separate services) pingdomfetch fetches the availability of all services and calculates an average availability of all services which belong to a top level service.
.PP
For each top level service you monitor via Pingdom you must create checks at Pingdom (manually). The check names should be of the form of
.PP
.Vb 1
\&    PROCOCOL://FQDN
.Ve
.PP
For example:
.PP
.Vb 1
\&    http://paul.buetow.org
\&
\&    https://paul.buetow.org
.Ve
.PP
just in order to have it uniform to all the other Pingdom checks (there is no technical reason though).
.PP
Afterwards create a new file \fI/etc/pingdomfetch.d/TLSNAME.conf\fR (for example \fI/etc/pingdomfetch.d/buetoworg_tls.conf\fR) with the following content:
.PP
.Vb 3
\&    [tls.TLSNAME]
\&    PROCOCOL1://FQDN1
\&    PROCOCOL2://FQDN2
.Ve
.PP
to be specific it should be like this:
.PP
.Vb 3
\&    [tls.buetoworg_paul]
\&    http://paul.buetow.org
\&    https://paul.buetow.org
.Ve
.PP
The buetoworg_tls will be used by pingdomfetch to identify the top level service (e.g. using \-\-list\-tls) and can be freely chosen.
.PP
\fIFetch stats of the top level service:\fR
.IX Subsection "Fetch stats of the top level service:"
.PP
The command
.PP
.Vb 1
\&    pingdomfetch \-\-tls buetoworg_tls
.Ve
.PP
fetches the availability of both services from Pingdom and calculates the average availability which is the tls availability and prints out the results to stdout.
.PP
.Vb 1
\&    pingdomfetch \-\-from yesterday \-\-to yesterday \-\-flatten bod:eod \-\-all\-tls
.Ve
.PP
fetches the availability of yesteday of all configured tls. There are many other options available.
.PP
\fIService options\fR
.IX Subsection "Service options"
.PP
It is possible to configure special options for special services:
.PP
.Vb 3
\&    [tls.TLSNAME]
\&    PROCOCOL1://FQDN1[=option1:value1[,option2:value2]
\&    PROCOCOL2://FQDN2[=option1:value1[,option2:value2]
.Ve
.PP
The possible options are:
.IP "weight" 4
.IX Item "weight"
If \s-1FQDN1\s0 has twice as much traffic as \s-1FQDN2\s0 it makes sense to increase its weight. The standard weight is 1. Its used to calculate the tls availability.
.IP "warning" 4
.IX Item "warning"
This overwrites the global warning threshold. It makes sense to use to avoid staus mails just because one specific service is under the specified global warning threshold.
.PP
to be specific it should be like this:
.PP
.Vb 3
\&    [tls.buetoworg_tls.4352844]
\&    http://paul.buetow.org=weight:2,warning:98
\&    https://paul.buetow.org=warning:100
.Ve
.PP
and means that the availability of plain http will count twice as much as much. A warning mail will be sent only if the availability is less than 98% for http or less than 100% for https.
.SH "PINGDOMFETCH OPTIONS"
.IX Header "PINGDOMFETCH OPTIONS"
.IP "\-\-all\-services" 4
.IX Item "--all-services"
Fetch availability of all services.
.IP "\-\-all\-tls" 4
.IX Item "--all-tls"
Fetch availability of all top level services
.IP "\-\-checkid <\s-1NUMBER\s0>" 4
.IX Item "--checkid <NUMBER>"
Fetch availability of a specific check \s-1ID\s0. The check \s-1ID\s0 is the Pingdom check \s-1ID\s0.
.IP "\-\-config <\s-1STRING\s0>" 4
.IX Item "--config <STRING>"
Also read a specific config file.
.IP "\-\-flatten <\s-1STRING\s0>" 4
.IX Item "--flatten <STRING>"
Flatten the time interval to fetch availabilities for. E.g.:
.Sp
.Vb 1
\&    \-\-from yesterday \-\-to yesterday \-\-flatten bod:eod
.Ve
.Sp
fetches the availability from begin of day (yesterday) until the end of the day (yesterday).
.IP "\-\-from <\s-1STRING\s0>" 4
.IX Item "--from <STRING>"
Set time interval start time to fetch availabilities for. All formats supported by Time::ParseDate can be used. See http://search.cpan.org/~muir/Time\-modules\-2003.0211/lib/Time/ParseDate.pm <http://search.cpan.org/~muir/Time-modules-2003.0211/lib/Time/ParseDate.pm>.
.Sp
For example:
.Sp
.Vb 1
\&    \-\-from today
\&
\&    \-\-from \*(Aq03.02.2013 12:34:56\*(Aq
\&
\&    \-\-from \*(Aqlast week\*(Aq
.Ve
.IP "\-\-help" 4
.IX Item "--help"
Print out a brief help.
.IP "\-\-list\-services" 4
.IX Item "--list-services"
List all configured services.
.IP "\-\-list\-tls" 4
.IX Item "--list-tls"
List all configured top level services.
.IP "\-\-notify" 4
.IX Item "--notify"
Write a mail to all addresses specified in notify.email.to if at least one service or top level service is in state warning or critical. The warning threshold in % is warning.if.avail.is.less, the critical threshold in % is critical.if.avail.is.less.
.IP "\-\-notify\-dummy" 4
.IX Item "--notify-dummy"
In conjunction with \-\-notify or \-\-notify\-info don't actually send mails but print them to stdout.
.IP "\-\-notify\-info" 4
.IX Item "--notify-info"
Write a mail to all addresses specified in notify.info.mail.to regardless of warning and critical services and top level services.
.IP "\-\-service <\s-1STRING\s0>" 4
.IX Item "--service <STRING>"
Fetch availability of a specific service name. The service name can be taken from \-\-list\-services.
.IP "\-\-sort\-reverse" 4
.IX Item "--sort-reverse"
Reverse the availability output list. Affects only status mails and stdout.
.IP "\-\-tls <\s-1STRING\s0>" 4
.IX Item "--tls <STRING>"
Fetch availability of a specific top level service. The top level service name can be taken from \-\-list\-tls.
.IP "\-\-to <\s-1STRING\s0>" 4
.IX Item "--to <STRING>"
Same as \-\-from, but specifies the end time to fetch availabilities for.
.IP "\-\-verbose" 4
.IX Item "--verbose"
Turns on verbose mode. Enables some extra output to stdout.
.IP "\-\-version" 4
.IX Item "--version"
Prints out the current version of pingdomfetch.
.SH "AUTHOR"
.IX Header "AUTHOR"
Paul Buetow \- <http://pingdomfetch.buetow.org>