summaryrefslogtreecommitdiff
path: root/docs/pingdomfetch.txt
blob: 9b651530379c50a0a5c12a840870417b1b98cc1d (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
NAME
    pingdomfetch - A small and humble tool to fetch availability stats from
    Pingdom and notify via E-Mail

SYNOPSIS
    pingdomfetch [--all-services] [--all-tls] [--checkid <STRING>] [--config
    <STRING>] [--flatten <STRING>] [--from <STRING>] [--help]
    [--list-services] [--list-tls] [--notify] [--notify-dummy]
    [--notify-info] [--service <STRING>] [--sort-reverse] [--tls <STRING>]
    [--to <STRING>] [--verbose] [--version]

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.

    Pingdomfetch also knows about 'so called' top level services (one top
    level service consists of several services).

CONFIG
  Possible locations
    Create a config at one of the following (or into several) location:

        /etc/pingdomfetch.conf
        ./pingdomfetch.conf
        /etc/pingdomfetch.d/*.conf
        ~/.pingdomfetch.conf
        ~/.pingdomfetch.d/*.conf

    The last config file always overwrites the values configured in the
    previous config files. For this use the sample configuration file
    /usr/share/pingdomfetch/examples/pingdomfetch.conf.sample. Please read
    that sample configuration file carefully since it also describes all
    available config options.

    It makes sense to have one global config /etc/pingdomfetch.conf
    containing all general configurations and for each top level service a
    separate config in /etc/pingdomfetch.d/TLSNAME.conf.

  Top level services and services
   Configure a top level service:
    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.

    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

        PROCOCOL://FQDN

    For example:

        http://paul.buetow.org

        https://paul.buetow.org

    just in order to have it uniform to all the other Pingdom checks (there
    is no technical reason though).

    Afterwards create a new file /etc/pingdomfetch.d/TLSNAME.conf (for
    example /etc/pingdomfetch.d/buetoworg_tls.conf) with the following
    content:

        [tls.TLSNAME]
        PROCOCOL1://FQDN1
        PROCOCOL2://FQDN2

    to be specific it should be like this:

        [tls.buetoworg_paul]
        http://paul.buetow.org
        https://paul.buetow.org

    The buetoworg_tls will be used by pingdomfetch to identify the top level
    service (e.g. using --list-tls) and can be freely chosen.

   Fetch stats of the top level service:
    The command

        pingdomfetch --tls buetoworg_tls

    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.

        pingdomfetch --from yesterday --to yesterday --flatten bod:eod --all-tls

    fetches the availability of yesteday of all configured tls. There are
    many other options available.

   Service options
    It is possible to configure special options for special services:

        [tls.TLSNAME]
        PROCOCOL1://FQDN1[=option1:value1[,option2:value2]
        PROCOCOL2://FQDN2[=option1:value1[,option2:value2]

    The possible options are:

    weight
        If FQDN1 has twice as much traffic as FQDN2 it makes sense to
        increase its weight. The standard weight is 1. Its used to calculate
        the tls availability.

    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.

    to be specific it should be like this:

        [tls.buetoworg_tls.4352844]
        http://paul.buetow.org=weight:2,warning:98
        https://paul.buetow.org=warning:100

    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.

PINGDOMFETCH OPTIONS
    --all-services
        Fetch availability of all services.

    --all-tls
        Fetch availability of all top level services

    --checkid <NUMBER>
        Fetch availability of a specific check ID. The check ID is the
        Pingdom check ID.

    --config <STRING>
        Also read a specific config file.

    --flatten <STRING>
        Flatten the time interval to fetch availabilities for. E.g.:

            --from yesterday --to yesterday --flatten bod:eod

        fetches the availability from begin of day (yesterday) until the end
        of the day (yesterday).

    --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/ParseD
        ate.pm>.

        For example:

            --from today

            --from '03.02.2013 12:34:56'

            --from 'last week'

    --help
        Print out a brief help.

    --list-services
        List all configured services.

    --list-tls
        List all configured top level services.

    --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.

    --notify-dummy
        In conjunction with --notify or --notify-info don't actually send
        mails but print them to stdout.

    --notify-info
        Write a mail to all addresses specified in notify.info.mail.to
        regardless of warning and critical services and top level services.

    --service <STRING>
        Fetch availability of a specific service name. The service name can
        be taken from --list-services.

    --sort-reverse
        Reverse the availability output list. Affects only status mails and
        stdout.

    --tls <STRING>
        Fetch availability of a specific top level service. The top level
        service name can be taken from --list-tls.

    --to <STRING>
        Same as --from, but specifies the end time to fetch availabilities
        for.

    --verbose
        Turns on verbose mode. Enables some extra output to stdout.

    --version
        Prints out the current version of pingdomfetch.

AUTHOR
    Paul Buetow - <paul@buetow.org>