aboutsummaryrefslogtreecommitdiff
path: root/lib
AgeCommit message (Collapse)Author
2021-11-17check_snmp: fix performance thresholds when using multiple oidsGravatar Sven Nierlein
when using check_snmp with multiple oids it simply printed the unparsed content from -w/-c into the thresholds for each oid. So each oid contained the hole -w from all oids. ./check_snmp ... -o iso.3.6.1.2.1.25.1.3.0,iso.3.6.1.2.1.25.1.5.0 -w '1,2' -c '3,4' before: SNMP ... | HOST-RESOURCES-MIB::hrSystemInitialLoadDevice.0=393216;1,2;3,4 HOST-RESOURCES-MIB::hrSystemNumUsers.0=24;1,2;3,4 after: SNMP ... | HOST-RESOURCES-MIB::hrSystemInitialLoadDevice.0=393216;1;3 HOST-RESOURCES-MIB::hrSystemNumUsers.0=24;2;4 This also applies to fixed thresholds since check_snmp translates negative infinities from: '~:-1' to '@-1:~'
2021-10-26Switch to uint64_tGravatar RincewindsHat
2019-02-19Merge pull request #1567 from vdanjean/masterGravatar Sven Nierlein
[check_disk] add support to display inodes usage in perfdata
2019-02-15check_by_ssh: fix child process leak on timeoutsGravatar Sven Nierlein
When check_by_ssh runs into a timeout it simply exits keeping all child processes running. Simply adopting the kill loop from runcmd_timeout_alarm_handler() fixes this. Signed-off-by: Sven Nierlein <sven@nierlein.de>
2018-12-08[check_disk] add support to display inodes usage in perfdataGravatar Vincent Danjean
This is not enabled by default It can be enabled with the -P (--iperfdata) option
2018-09-29Avoid passing NULL to vprintf().Gravatar Guido Falsi
2014-11-28make constants from maxfd values (#1300)Gravatar Sven Nierlein
its good practice to use constants instead of (random) values. Signed-off-by: Sven Nierlein <sven@nierlein.de>
2014-11-28avoid a segfault, if ulimit is set to unlimitedGravatar nafets
2014-10-06Revert "Make use of xasprintf instead of asprintf"Gravatar Holger Weiss
This reverts commit a143739ed286cf9ae003792dbb1ce26ce43f3312. Our current setup doesn't allow lib/*.c files to call functions defined in plugins/utils.[ch].
2014-07-30Make use of xasprintf instead of asprintfGravatar Jan Wagner
--- Closes #1278
2014-07-30lib/utils_base.c: if asprintf fails, string is undefinedGravatar Ricardo Maraschini
if asprintf fails, string content becomes invalid. we need to check if it ran OK by checking the returned value. in case of fail, asprintf returns -1, otherwise the number of writen bytes is returned. also, on ubuntu 13.10 i've receiving a lot of warnings: "warning: ignoring return value of ‘asprintf’" this patches fixes some of them Signed-off-by: Ricardo Maraschini <ricardo.maraschini@gmail.com> --- Closes #1227
2014-07-06check_icmp/check_dhcp: disable check, if we are rootGravatar Jan Wagner
As it is possible to use capabilities(7) on linux or solaris privileges for example, it is not necessary in all cases to have those binaries making use of setuid.
2014-06-28lib/utils_cmd.c - Free file descriptorGravatar Spenser Reinhardt
Coverity 66502 - File descriptor fd in cmd_file_read is never closed, and thus file is left open after usage throughout runtime. - SR
2014-06-21Add UID to state retention file pathGravatar Holger Weiss
Add the UID of the invoking user to the state retention file path. This helps solving permission issues when different users run the same plugin.
2014-06-18lib/parse_ini.c: Print proper read error messageGravatar Holger Weiss
Print a useful error message if opening the configuration file fails.
2014-06-18lib/parse_ini.c: Drop privileges for reading fileGravatar Holger Weiss
Read the configuration file with privileges temporarily dropped if the code is used by a setuid plugin.
2014-06-18lib/parse_ini.c: Add newline to die() callsGravatar Holger Weiss
Our die() function doesn't append a newline character to the message.
2014-06-18lib/parse_ini.c: Cosmetic changeGravatar Holger Weiss
Replace an "if" with the ternary operator.
2014-06-18lib/parse_ini.c: Search for INI file in subdirsGravatar Holger Weiss
Add two path names to the list of default INI file locations, as some users/distributions prefer to put configuration files into subdirectories.
2014-06-18lib/parse_ini.c: Add comment on NAGIOS_CONFIG_PATHGravatar Holger Weiss
We might want to spit out a warning when NAGIOS_CONFIG_PATH is used. While at it, move the function that handles this environment variable to the bottom.
2014-06-18lib/parse_ini.c: Cosmetic changes to commentsGravatar Holger Weiss
2014-06-18lib/parse_ini.c: Fix Clang warningsGravatar Holger Weiss
2014-06-18lib/parse_ini.[ch]: Change code formattingGravatar Holger Weiss
Change the indentation and formatting of the code in lib/parse_ini.c. This breaks patches against that file and makes it harder to track its history, but it (hopefully) improves readability a lot.
2014-06-18lib/parse_ini.c: Don't cast malloc(3) resultGravatar Holger Weiss
There's no need to cast malloc(3)'s return value.
2014-06-18lib/parse_ini.c: Remove outdated comment and codeGravatar Holger Weiss
The lib/parse_ini.c:np_get_defaults() function now dies if no configuration file is found.
2014-06-18lib/parse_ini.c: Read $MP_CONFIG_FILEGravatar Holger Weiss
Read $MP_CONFIG_FILE if that variable is set in the environment.
2014-06-18lib/parse_ini.c: Read "monitoring-plugins.ini"Gravatar Holger Weiss
Read "monitoring-plugins.ini" if that file exists, but fall back to reading "plugins.ini" or "nagios-plugins.ini" for backward compatibility.
2014-06-18lib/parse_ini.[ch]: Simplify codeGravatar Holger Weiss
Rewrite the code that looks up the INI configuration file path (used by the Extra-Opts feature) in order to improve readability. The behaviour should not have changed.
2014-03-09build - avoid deprecated INCLUDESGravatar Davide Madrisan
Signed-off-by: Davide Madrisan <davide.madrisan@gmail.com>
2014-01-31Handle negative values properly with check_snmpGravatar Stephane Lapie
check_snmp becomes capable of evaluating negative values properly, but it might be returning CRITICALs where it used to return OK and was ignored, if a negative value turns out to actually be a valid value. If negative values are valid, this can be worked around, by adding "~:" to the warning/critical threshold : 100 -> ~:100
2014-01-31Add tests for negative thresholds in test_utilsGravatar Thomas Guyot-Sionnest
2014-01-29Add tests for mp_translate_state()Gravatar Thomas Guyot-Sionnest
2014-01-29Move negate' translate_state() to utils_base.h mp_translate_state()Gravatar Thomas Guyot-Sionnest
Also use strcasecmp imported from gnulib for simplicity
2014-01-27Rename MP_STATE_DIRECTORY to MP_STATE_PATHGravatar Thomas Guyot-Sionnest
2014-01-27And release notes for previous change (MP_STATE_DIRECTORY)Gravatar Thomas Guyot-Sionnest
The change has also been updated in https://www.monitoring-plugins.org/doc/state-retention.html
2014-01-25Ignore MP_STATE_DIRECTORY in suid pluginsGravatar Thomas Guyot-Sionnest
If a plugin still has suid privileges at the time np_enable_state() is called, the MP_STATE_DIRECTORY environment will be ignored. There is no need for a NEWS entry as no suid plugins use np_enable_state yet.
2014-01-25Clean up parse_ini error messages, add missing newlinesGravatar Thomas Guyot-Sionnest
2014-01-25Rename ENV variable, keep backward compatibilityGravatar Thomas Guyot-Sionnest
Rename NAGIOS_PLUGIN_STATE_DIRECTORY to MP_STATE_DIRECTORY
2014-01-24Use access() instead of stat() in parse_ini.cGravatar Thomas Guyot-Sionnest
2014-01-24Update commentsGravatar Thomas Guyot-Sionnest
1. libtab is now bundled, so suggest to enable it rather than install it 2. "parse-ini" feature has been called "extra-opts"
2014-01-21Capitalize "Monitoring Plugins"Gravatar Holger Weiss
"Monitoring Plugins" is a name.
2014-01-20Minor fixes to be amended into "rename" commitGravatar Holger Weiss
2014-01-19Project rename initial commit.Gravatar Monitoring Plugins Development Team
This is an initial take at renaming the project to Monitoring Plugins. It's not expected to be fully complete, and it is expected to break things (The perl module for instance). More testing will be required before this goes mainline.
2013-09-12Minor cosmetic changesGravatar Holger Weiss
2013-09-12check_tcp: Properly deal will partial recv(3)sGravatar Holger Weiss
The np_expect_match() function now returns one of three possible states instead of just TRUE or FALSE: - NP_MATCH_SUCCESS - NP_MATCH_FAILURE - NP_MATCH_RETRY The NP_MATCH_RETRY state indicates that matching might succeed if np_expect_match() is called with a longer input string. This allows check_tcp to decide whether it makes sense to wait for additional data from the server.
2013-09-12Improve interface of np_expect_match() functionGravatar Holger Weiss
Replace the three boolean parameters of lib/utils_tcp.c's np_expect_match() function with a single "flags" parameter.
2013-09-10Fix GCC's -Wimplicit-function-declaration warningsGravatar Holger Weiss
Fix the issues found by GCC when the -Wimplicit-function-declaration flag is specified.
2013-09-10Fix GCC's -Wuninitialized warningsGravatar Holger Weiss
Fix the issues found by GCC when the -Wuninitialized flag is specified.
2013-08-20added missing header to fix build on freebsdGravatar Sven Nierlein
2013-08-17Adding tests for range @1:1Gravatar Dominique Broeglin