Monitoring Plugins standards
Find a file
inqrphl b9cd60ec3a
add proxy argument and improve dns cache usage (#2209)
* add proxy argument and improve dns cache usage

add proxy argument that useing the -x and --proxy argument. add it to
the static curl config struct, command usage and help outputs of the
cli.

parse these argument together with the environment variables like
http_proxy before setting the CURLOPT_PROXY in the curl configuration
option. this is required, as there is no easy way to ascertain/get what
the CURLOPT_PROXY that libcurl will use. by the point it is set by
libcurl, we have no control over it anymore, and need it for the other
steps in the configuration.

if the CURLOPT_PROXY is set, skip the DNS cache population which would
set the CURLOPT_RESOLVE. this is currently not perfect however. if a
proxy is set with socks4 or socks5 scheme, the host should be resolving
the hostname.

* codespell, clang-format and hints fixes

* add curl version and ssl enabelement macro checks

might fix rocky linux 8 compilation issues.

* add proxy_resolves_hostname, determined by proxy scheme

leave the functions that print out an curl_easyoption, but dont use it. organize the code slightly, print out the final CURLOPT_PROXY and proxy_resolves_hostname flag on verbose mode, add comments

* remove unused handle_curl_easyoption and format_curl_easyoption functions

* fix typo in the proxy argument

* fix typo with proxy scheme socks5a->socks5h

* improve proxy environment parsing

add another argument: --no-proxy , which is used when setting
CURL_NOPROXY

additionally parse all_proxy, ALL_PROXY, no_proxy and NO_PROXY
environment variables in the correct order.

set the curlopt_proxy and curlopt_noproxy of libcurl, and additionally
save them in check_curl_working_state.

add function determine_hostname_resolver, uses the working state and
static config. it can tokenize the no_proxy variable and check for exact
matches, but cannot determine subnet matches for ip addresses yet.

* document proxy cli arguments

clarify and add more examples of proxy environment variables and their
behavior when multiple are specified, overriden etc.

add single wildcard '*' checking for no_proxy to
determine_hostname_resolver, special case per curlopt_noproxy
documentation

* check curlopt_noproxy before accessing it

* switch argument from --no-proxy to --noproxy like curl cli

* check if host name is a subdomain of an noproxy item

* use strdup where destination working_state.curlopt_proxy may be NULL

* add disclaimer about uppercase HTTP_PROXY

* add subdomain checks for each item in the no_proxy, if the target host is a subdomain proxy wont resolve it

add function ip_addr_inside_cidr, use it for checking possible cidr ranges  given in the no_proxy

* wip tests that work on local perl http/https server

* wip tests that work on the live debian image

* fix subnet definition

* make apache2 listen on [::1] for ipv6 tests

* remove squid certificate

* rewrite ip_addr_inside_cidr, split ipv4 and ipv6 parsing path and copy them to a shared buffer later on for prefix check

* Adapt tests for the squid sever, disable checking return code for socks 4/5 proxies. Squid does not support it, and we do not install a capable proxy for these schemes.

* specify localhost acl and allow it through the proxy. used in check_curl tests

* typo in comment

* move function comments to header

* fix failing tests

* handle case where proxy is set as empty string

* removed duplicate tests, corrected wrong comments

* corrected some annotations

* move docker apache subdomain setup files to /tools/subdomain1

* add a newline before dying in handle_curl_option_return_code

* fix the -ssl better, now does not segfault on empty --ssl argument as well.


---------

Co-authored-by: Ahmet Oeztuerk <Ahmet.Oeztuerk@consol.de>
2026-03-13 15:54:23 +01:00
.github add proxy argument and improve dns cache usage (#2209) 2026-03-13 15:54:23 +01:00
build-aux Fix a lot of typos reported by codespell 2023-04-14 18:35:00 +00:00
config_test Fix a lot of typos reported by codespell 2023-04-14 18:35:00 +00:00
doc Fix a few typos (#2231) 2026-02-16 11:21:21 +01:00
gl Remove dep files which were checked in unintentionally (#2228) 2026-01-23 11:07:06 +01:00
lib Make replacing of mismatching single quotes work (#2232) 2026-02-16 11:27:49 +01:00
m4 Fix some more typos 2023-10-03 22:22:51 +02:00
perlmods update perl module to 0.39 2015-04-11 13:08:45 +02:00
pkg Replace egrep with grep -E (#1791) 2022-10-07 11:44:47 +02:00
plugins add proxy argument and improve dns cache usage (#2209) 2026-03-13 15:54:23 +01:00
plugins-root OpenBSD: pledge(2) some network-facing checks (#2225) 2026-02-06 12:58:38 +01:00
plugins-scripts Fix wrong exit codes 2025-02-19 19:44:17 +01:00
tap Run clang-format again 2025-09-15 12:59:37 +02:00
tools add proxy argument and improve dns cache usage (#2209) 2026-03-13 15:54:23 +01:00
.clang-format clang-format: reduce line lenght to 100 char, it's easier to read 2025-04-27 17:50:59 +02:00
.gitignore Remove check_ntp (#2194) 2025-12-04 13:23:50 +01:00
ABOUT-NLS Updating gettext files from coreutils-6.9. mkinstalldirs needs to be in 2007-05-12 00:49:26 +00:00
acinclude.m4 Removing CVS/SVN tags and replacing with git-based versioning 2008-11-23 05:38:47 +00:00
ACKNOWLEDGEMENTS Fix a lot of typos reported by codespell 2023-04-14 18:35:00 +00:00
AUTHORS release v2.3.2 2022-10-19 14:47:57 +02:00
autogen.sh Removing CVS/SVN tags and replacing with git-based versioning 2008-11-23 05:38:47 +00:00
CODING Adapt the hints to coding style in the CODING file 2024-10-15 09:05:00 +02:00
config.rpath make dist failing without config.rpath in top level. File copied 2007-01-30 09:56:47 +00:00
configure.ac Make IPv6 unconditional (#2219) 2026-02-06 12:59:58 +01:00
COPYING Update the COPYING file to the GPLv3 2010-07-27 23:06:23 +02:00
FAQ FAQ: Remove outdated (RPM/DEB-related) questions 2014-10-15 13:56:13 +02:00
Makefile.am Remove tinderbox related stuff 2025-02-25 18:01:51 +01:00
mkinstalldirs Adding more required files from gettext 2006-05-19 21:30:59 +00:00
NEWS Fix double lines in NEWS 2024-07-24 23:14:03 +02:00
NP-VERSION-GEN Update version to new git version 2024-07-24 22:25:37 +02:00
NPTest.pm Just use eval instead of Try::Tiny in tests 2025-03-07 19:29:24 +01:00
README Update README 2020-10-02 01:48:46 +05:30
README.md Add symlink: README.md -> README 2013-09-20 17:00:40 +02:00
REQUIREMENTS Remove check_nt (#2195) 2025-12-03 22:39:19 +01:00
SUPPORT fix typo in SUPPORT 2024-11-28 22:52:41 +01:00
test.pl.in Use "C" locale when running test suite 2014-07-21 22:20:57 +02:00
THANKS.in Fix/check curl sticky redir (#2188) 2025-11-28 12:21:08 +01:00

Monitoring Plugins

  • For instructions on installing these plugins for use with your monitoring system, see below. In addition, generic instructions for the GNU toolchain can be found in the INSTALL file.

  • For major changes between releases, read the NEWS file.

  • For information on detailed changes that have been made or plugins that have been added, read the ChangeLog file.

  • Some plugins require that you have additional programs or libraries installed on your system before they can be used. Plugins that are dependent on other programs/libraries that are missing are usually not compiled. Read the REQUIREMENTS file for more information.

  • Individual plugins are self-documenting. All plugins that comply with the basic guidelines for development will provide detailed help when invoked with the -h or --help options.

You can check the latest plugins at:

Send an email to help@monitoring-plugins.org for assistance. Please include the OS type and version that you are using. Also, run the plugin with the -vvv option and provide the resulting version information. Of course, there may be additional diagnostic information required as well. Use good judgment.

Send an email to devel@monitoring-plugins.org for developer discussions.

For patch submissions and bug reports, please use the appropriate resources at:

Installation Instructions

  1. If you are using the Git tree, you will need m4, gettext, automake, and autoconf. To start out, run:

    ./tools/setup
    

    For more detail, see the developer guidelines at https://www.monitoring-plugins.org/doc/guidelines.html.

  2. Run the configure script to initialize variables and create a Makefile, etc.

    ./configure --prefix=BASEDIRECTORY --with-cgiurl=SOMEURL
    

    Replace BASEDIRECTORY with the path of the directory under which your monitoring system is installed (default is /usr/local), and replace SOMEURL with the path used to access the monitoring system CGIs with a web browser (default is /nagios/cgi-bin).

  3. Compile the plugins with the following command:

    make
    
  4. Install the compiled plugins and plugin scripts with the following command:

    make install
    

    The installation procedure will attempt to place the plugins in a libexec/ subdirectory in the base directory you specified with the --prefix argument to the configure script.

  5. There are some plugins that require setuid. If you run make install as a non-root user, they will not be installed. To install, switch to root and run:

    make install-root
    

That's it! If you have any problems or questions, feel free to send an email to help@monitoring-plugins.org.

License Notice

You can redistribute and/or modify this software under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version; with the additional exemption that compiling, linking, and/or using OpenSSL is allowed.

This software is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

See the COPYING file for the complete text of the GNU General Public License, version 3.