-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathREADME
87 lines (60 loc) · 2.19 KB
/
README
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
check_pycurl
NOTE: this is now unmaintained - further development is on the Python 3 branch @ https://github.com/jamespo/check_pycurl3
INTRODUCTION
A nagios / icinga / shinken plugin to check HTTP requests
Written in python. Licensed under GPL v3
Copyright James Powell 2013
DEPENDENCIES
python 2.x with modules:
pycurl (with TLS support)
yaml
INSTALLATION
Just install the dependencies & copy the binary to your standard path for nagios plugins and configure in nagios/icinga (see SERVER CONFIGURATION).
USAGE
Usage: check_pycurl [options]
Options:
-h, --help show this help message and exit
-u URL, --url=URL
-f RUNFILE, --runfile=RUNFILE
--test=TEST [code:HTTPCODE|regex:REGEX]
--connect-timeout=CONNECTTIMEOUT
--timeout=TIMEOUT
--proxy=PROXY
--location Follow redirects
--insecure
check_pycurl can run in one of two ways, a simple one-off http check (specify the url with -u) or with a runfile which is written in yaml and can be used to specify multi-stage url checks (eg logging in then checking for success).
By default check_pycurl will test for HTTP 200 code (--test code:200)
An alternate test is for presence of regex in the output (--test regex:t.st)
EXAMPLE RUNFILE
---
cookiejar: no
urls:
- url: http://jamespo.org.uk
test: code:200
- url: http://yahoo.com
test: code:301
SERVER CONFIGURATION
# simple configuration just for HTTP 200 check
define command {
command_name check_pycurl
command_line /usr/local/nagios/plugins/check_pycurl --url $ARG1$
}
# configuration to use runfiles
define command {
command_name check_pycurl_rf
command_line /usr/local/nagios/plugins/check_pycurl -f $ARG1$
}
# host check
define service {
use generic-service
host_name local2
service_description BBC web check
check_command check_pycurl!http://www.bbc.co.uk
}
# runfile check
define service {
use generic-service
host_name local2
service_description Roundcube Login Check
check_command check_pycurl_rf!/opt/nagios/pyc_rf/rc.yml
}