Skip to content

nagios plugin to check webpages serially with limited state support, built with python and pycurl

License

Notifications You must be signed in to change notification settings

jamespo/check_pycurl

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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
}

About

nagios plugin to check webpages serially with limited state support, built with python and pycurl

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages