Skip to main content

Title1

Checks an url raise an alert if some problem is found. Uses curl with all its power, so you can extend your check with all curl options.

VERSION

Install

Linux:

sudo pip3 install curlnagios --upgrade

Also is possible to use:

sudo python3 -m pip install curlnagios --upgrade

On windows with python3.5:

pip install curlnagios --upgrade

For proxies add:

--proxy='http://user:passw@server:port'

Usage

Use the command line:

> curlnagios --help
  usage: curlnagios [-h] [-u [URL]] [-e [EXTRA_ARGS]]

    optional arguments:
    -h, --help            show this help message and exit
    -u [URL], --url [URL]
                            url to check
    -e [EXTRA_ARGS], --extra_args [EXTRA_ARGS]
                            extra args to add to curl, see `curl manpage <https://curl.haxx.se/docs/manpage.html>`_.

Example usage

Example use with proxy:

> curlnagios --url='http://xx/dd' --extra_args='--proxy http://user:pass@host:8080'

Example using proxy, and authentication with ntlm for the website:

> curlnagios –url=’http://xx/dd’ –extra_args=’–proxy http://user:pass@host:8080 –user user:pass –ntlm’

All the extra_args are options directly comming from curl manpage, you can use almost any with exception of -s, -o, -w as these are implicit added on the curl command line argument to format the output for this plugin.

Example usage with AzureAD oauth2

When creating authentication with AzureAD oauth2, you need to create a client Application and Azure AD only applications:

https://apps.dev.microsoft.com/#/appList

Then use:

> curlnagios –url ‘https://{yoururltotest}/api/path’ –client_id ‘unique-client-id’ –scope ‘https://{tenant}/unique-id-here-for-the-app/.default’ –client_secret ‘theclientoken’ –grant_type ‘client_credentials’ –auth_url ‘https://login.microsoftonline.com/{tenant}/oauth2/v2.0/token’ –oauth2

Change {tenant} with your identifier and the unique id for client and for application. Add your client secret

This comes from documentation using token: https://docs.microsoft.com/en-us/azure/active-directory/develop/v2-oauth2-auth-code-flow#request-an-access-token

Nagios config

Example command:

define command{
    command_name  check_http_curl
    command_line  /usr/local/bin/curlnagios --url='$ARG1$' --extra_args='$ARG2$'
}

define command{
    command_name  check_http_curl_azuread
    command_line  /usr/local/bin/curlnagios --url='$ARG1$' --client_id '$ARG2$' --scope '$ARG3$' --client_secret '$ARG4$' --auth_url 'https://login.microsoftonline.com/$ARG5$/oauth2/v2.0/token' --oauth2 --extra_args='$ARG6$'
}

Example service:

define service {
        host_name                       SERVERX
        service_description             service_name
        check_command                   check_http_curl!http://url/path!--proxy http://user:name@host:8080 --user user:name --ntlm
        use                                         generic-service
        notes                           some useful notes
}

Example service bypassing reverse proxy and dns and proxy server:

define service {
        host_name                       SERVERY
        service_description             fqdn.backend1
        check_command                   check_http_curl!http://192.168.10.10:80!--noproxy "192.168.10.10" -H "Host: fqdn.site.name"
        use                                         generic-service
        notes                           Monitoring backend1 de of site fqdn.site.name
}

 ## In this way you can connect to some backend and pass with -H the host header to get and also ensure no proxy used to connect to url.

Example using azuread oauth2:

define service {
        host_name                       SERVERY
        service_description             fqdn.backend1
        check_command                   check_http_curl_azuread!http://fqdn.site.name/api/xx!client-unique-id!https://{tenant}/unique-id-here-for-the-app/.default!client-secret-unique!tenant!some extra args if desired
        use                                         generic-service
        notes                           Monitoring backend1 de of site fqdn.site.name
}

You can use ansible role that already has the installation and command: https://github.com/CoffeeITWorks/ansible_nagios4_server_plugins

TODO

  • Use hash passwords

  • Add Unit tests?

Metadata

Release files for curlnagios 0.6.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for curlnagios 0.6.0
File Size Uploaded Provenance
curlnagios-0.6.0.tar.gz 8.0 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for curlnagios 0.6.0
File Interpreter ABI Platform
curlnagios-0.6.0-py3-none-any.whl Python 3 none any Details

Total release size: 18.7 kB

Release files / curlnagios-0.6.0.tar.gz

Download URL curlnagios-0.6.0.tar.gz
Size 8.0 kB
Tags Source
SHA-256 checksum
How to use checksums
32b2e3a48f15e31009d6f63f03bac60cbe938de46514b25758ed2faa6ab7ea19
BLAKE2b-256 checksum
How to use checksums
eeb4b09e7dfec82f530f81e9d9c898ac624bdcd210089ce66ed9d71de557d549
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.10.0 pkginfo/1.4.2 requests/2.19.1 setuptools/39.1.0 requests-toolbelt/0.8.0 tqdm/4.19.7 CPython/3.5.2

Release files / curlnagios-0.6.0-py3-none-any.whl

Download URL curlnagios-0.6.0-py3-none-any.whl
Size 10.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f2e61767ced15cdda040d84af51e47c4af172d05b5e7521c01a9cd43c9f16044
BLAKE2b-256 checksum
How to use checksums
423356ddb55d7e97c6c7bc7bc114e8cfb0e9905d93f2b66fbfbed03315daaf9a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.10.0 pkginfo/1.4.2 requests/2.19.1 setuptools/39.1.0 requests-toolbelt/0.8.0 tqdm/4.19.7 CPython/3.5.2

Security for curlnagios 0.6.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page