summaryrefslogtreecommitdiffstats
path: root/lib
AgeCommit message (Collapse)AuthorFilesLines
2023-10-15Fixes for compiler warning -Wparenthesesrefs/pull/1939/headRincewindsHat2-4/+4
2023-10-15Replace all old school booleans in lib witch C99 onesrefs/pull/1937/headRincewindsHat8-116/+104
2023-10-15Whitespace fixes in libRincewindsHat16-106/+104
2023-09-30Fix typoLorenz Kästle1-1/+1
2023-09-30Document new np_add_regex more and add error handlingLorenz Kästle1-4/+29
2023-09-28Introduce np_find_regmatch()Alexander A. Klimov2-0/+26
2023-09-28Introduce np_add_regex()Alexander A. Klimov2-0/+12
2023-09-28Introduce regex_listAlexander A. Klimov1-0/+6
2023-09-23Remove check for RETSIGTYPE in autoconf stuffrefs/pull/1926/headRincewindsHat1-1/+1
autoupdate tells me, that since C89 I can safely assume RETSIGTYPE is void. Therefore to simplify things I removed the corresponding configure.ac line and replaced all mentions of RETSIGTYPE with void.
2023-09-23Merge pull request #1924 from RincewindsHat/compiler_warnings_4_1Lorenz Kästle4-9/+43
Centralise and refactor maxfd related functionality
2023-09-23open_max is a library function now, it should be mp_open_maxrefs/pull/1924/headRincewindsHat3-6/+6
2023-09-22Place _cmd_pids in object not header to avoid unsused variablesrefs/pull/1925/headRincewindsHat2-9/+10
2023-09-22fixup! Rework maxfd/open_max to avoid unused variablesRincewindsHat2-0/+35
2023-09-22Rework maxfd/open_max to avoid unused variablesRincewindsHat2-9/+8
2023-09-21Merge branch 'master' into compiler_warning_part_3refs/pull/1868/headLorenz Kästle1-4/+0
2023-07-23Use memory on stack instead of heap for temporary variablesRincewindsHat1-5/+1
2023-06-28Merge branch 'master' into compiler_warning_part_3waja2-12/+13
2023-06-28Merge branch 'master' into compiler_warning_part_5waja2-12/+13
2023-05-10avoid mounting when searching for matching mount pointsStefan Taferner1-8/+9
2023-04-17Fixes for -Wnonnull-compareRincewindsHat1-4/+0
2023-04-17Fix hash creationRincewindsHat1-3/+15
2023-04-17Use default OPENSSL sha functions if availableRincewindsHat2-9/+22
2023-04-17Fixes for -Wunusedrefs/pull/1866/headRincewindsHat1-4/+4
* lib/utils_base.c * plugins/check_curl.c * plugins-root/check_dhcp.c Removed a line which theoretically can not do anything, but there was comment which indicated something else. Still trying this though.
2023-04-14Fix a lot of typos reported by codespellrefs/pull/1864/headJan Wagner7-15/+15
2023-02-19Merge remote-tracking branch 'origin/master' into ↵Kristian Schuster5-9/+15
feature_check_disk_add_ignore_missing_option
2023-02-19utils_disk: add name_prev pointer to struct parameter_listKristian Schuster2-2/+18
Also added handling of name_prev in np_add_parameter and np_delete_parameter. This make calling the np_delete_parameter function easier, because it requires the previous element as second argument.
2023-02-01Fix hashes in tests since we are using sha256 nowLorenz Kästle1-3/+3
2023-02-01Also link LIB_CRYPTO against testsLorenz Kästle1-1/+1
2023-01-31Replace sha1 with sha256 in utils_baseRincewindsHat2-5/+5
2022-12-13check_disk: Find accessible mount path if multiple are available (#1820)christian-21-0/+6
* fixes #1819 * mount entries also have to be accessible according to get_fs_usage()
2021-11-17check_snmp: fix performance thresholds when using multiple oidsSven Nierlein2-1/+2
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_tRincewindsHat1-1/+1
2019-02-19Merge pull request #1567 from vdanjean/masterSven Nierlein2-1/+4
[check_disk] add support to display inodes usage in perfdata
2019-02-15check_by_ssh: fix child process leak on timeoutsrefs/pull/1583/headSven Nierlein4-25/+54
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 perfdatarefs/pull/1567/headVincent Danjean2-1/+4
This is not enabled by default It can be enabled with the -P (--iperfdata) option
2018-09-29Avoid passing NULL to vprintf().refs/pull/1552/headGuido Falsi1-4/+7
2014-11-28make constants from maxfd values (#1300)refs/pull/1304/headSven Nierlein1-4/+6
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 unlimitednafets1-0/+8
2014-10-06Revert "Make use of xasprintf instead of asprintf"Holger Weiss1-3/+3
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 asprintfrefs/pull/1278/headJan Wagner1-3/+3
--- Closes #1278
2014-07-30lib/utils_base.c: if asprintf fails, string is undefinedRicardo Maraschini1-5/+10
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 rootJan Wagner2-16/+0
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 descriptorrefs/pull/1263/headSpenser Reinhardt1-0/+3
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 pathHolger Weiss2-3/+9
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 messageHolger Weiss1-1/+2
Print a useful error message if opening the configuration file fails.
2014-06-18lib/parse_ini.c: Drop privileges for reading fileHolger Weiss1-0/+10
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() callsHolger Weiss1-2/+2
Our die() function doesn't append a newline character to the message.
2014-06-18lib/parse_ini.c: Cosmetic changeHolger Weiss1-4/+1
Replace an "if" with the ternary operator.
2014-06-18lib/parse_ini.c: Search for INI file in subdirsHolger Weiss1-0/+2
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_PATHHolger Weiss1-15/+17
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.