aboutsummaryrefslogtreecommitdiff
path: root/lib
AgeCommit message (Collapse)Author
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
2012-11-02lib/utils_base.c: Stop dumping core on bad args to check_snmpGravatar Andreas Ericsson
Since the state patch introduction, we've been freeing uninitialized memory in lib/utils_base.c::np_cleanup(), which caused coredumps with check_snmp when illegal threshold ranges (for example) were passed, or when we called 'die' without having read any state. This patch fixes it by replacing the malloc() calls in there (all of them, since using malloc() is almost always an error) with calloc(). malloc() either doesn't initialize the memory at all, or taints it with a special marker so it can tell us when we're free()'ing memory that hasn't been initialized. calloc() explicitly initializes the allocated memory to nul bytes, which is a zero-cost operation when we get the memory from the kernel (which alread does that) and almost always desirable everywhere else. Signed-off-by: Andreas Ericsson <ae@op5.se>
2010-11-15Fix check_disk free space calculation if blocksizes differ within a disk ↵Gravatar Matthias Eble
group (Bekar - #2973603) Various values (dused_pct, dfree_pct, inodes_free, inodes_total, ...) are now carried in the parameter_list structure. Assignments have been moved to a subroutine preventing code redundancies. Group metrics are now calculated based on units rather than blocks. This fixes freespace calculation when blocksizes differ within a group.
2010-07-02Fix cmd_run overwriting the environmentGravatar Thomas Guyot-Sionnest
Some commands need the environment to function properly. One such example is check_ssh and check_by_ssh when a SOCKS proxy is required. This patch use setenv and extern char **environ to alter and pass the new environment to the child process Those modules have been added to Gnulib for portability.
2010-06-25Add test file directoryGravatar tonvoon
2010-06-24Cleanup some warnings displayed from IRIX tinderbox serverGravatar Ton Voon
2010-06-23Added state retention APIs. Implemented for check_snmp with --rate option.Gravatar Ton Voon
See http://nagiosplugin.org/c-api-private for more details on the API. Also updated check_snmp -l option to change the perfdata label.
2009-06-11Use a more "natural" way of writing argument lists in extra-opts tests.Gravatar Thomas Guyot-Sionnest
2009-06-02Fix the memory allocation for the thresholds dataGravatar Holger Weiss
Allocate the appropriate amount of memory for storing the thresholds data. Before, we allocated the amount of memory required for storing a _pointer_ to the thresholds data. This crashed (at least) check_mysql when using its "-S" option on FreeBSD/amd64 (as reported and analyzed by Nikita Kalabukhov - 2797757). Signed-off-by: Holger Weiss <holger@zedat.fu-berlin.de>
2009-05-28check_snmp: Make use of standard threshold functionsGravatar Thomas Guyot-Sionnest
This patch makes use of standard threshold functions. This allows using doubles as thresholds. Since SNMP supports only integers, double precision numbers are only printed when parsed from a STRING type. In addition, support for printing properly Timeticks type has been added, and the code has been thoroughly cleaned.
2009-01-26Make extract_value more generic:Gravatar Thomas Guyot-Sionnest
Add a separator argument passed using defines.
2009-01-24Remove the commented out blocksGravatar Thomas Guyot-Sionnest
The die tests are implemented in the test_*3.t files
2009-01-24Fix paths in test_ini testsGravatar Thomas Guyot-Sionnest
2009-01-23Add die tests for parse_iniGravatar Thomas Guyot-Sionnest
2009-01-22Return UNKNOWN if none of the default files can be found.Gravatar Thomas Guyot-Sionnest
It makes no sense to return unknown if an implicit section is not found, but go on if the file is missing
2009-01-22Add die tests for extra-optsGravatar Thomas Guyot-Sionnest
2009-01-21Move check_ntp's extract_value to utils_base.c.Gravatar Thomas Guyot-Sionnest
This function can also be used to parse performance data strings which could be useful in the future.
2009-01-21Accidentally included built executables - also updated .gitignoreGravatar Thomas Guyot-Sionnest
2009-01-20Some platform are missing setenvGravatar Thomas Guyot-Sionnest
Instead of adding the gnulib module for solving tests only I split the test in two, setting environment from Perl for the later.
2009-01-20Fix (or try at least) for IRIX compile to tap testsGravatar Thomas Guyot-Sionnest
Gnulib says: "$(LTLIBINTL) when linking with libtool, $(LIBINTL) otherwise" Everywhere else we use LTLIBINTL so I assume the tests should use it as well.
2009-01-18Re-apply "Cleanup; fix the way libraries are linked; Make-It-Simple(tm)"Gravatar Thomas Guyot-Sionnest
This reverts commit 7449b16b1781c645751e2c05b93893e93630fb2a.
2009-01-15TypoGravatar Thomas Guyot-Sionnest
2009-01-13Make /lib before /lib/tests to satisfy dependencies (building tests fails on ↵Gravatar Thomas Guyot-Sionnest
IRIX)
2009-01-09Fix test from last commitGravatar Thomas Guyot-Sionnest
2009-01-09basename check in test_utils.c was accidentaly added again.Gravatar Thomas Guyot-Sionnest
In 538b97c I reverted a serie of libtap patch by Ton Voon; it included the removal of the useless basename check. Relevant portion of the changelog from which it was removed (f31cd40): Removed basename test as we should use base_name from GNUlib which is tested separately
2009-01-09Revert "Cleanup; fix the way libraries are linked; Make-It-Simple(tm)"Gravatar Thomas Guyot-Sionnest
Trying to see if this has any relation to the tinderbox failure. I doubt it and will revert back as soon as it's tested. This reverts commit a97e5fbda21a05574b0e3c5a5118402ebfbbd13c.
2009-01-08Try to make IRIX happy (this fixes a similar warning in Solaris)Gravatar Thomas Guyot-Sionnest
2009-01-07Cleanup; fix the way libraries are linked; Make-It-Simple(tm)Gravatar Thomas Guyot-Sionnest
lib/Makefile.am | 2 +- lib/tests/Makefile.am | 37 ++++--------------------------------- 2 files changed, 5 insertions(+), 34 deletions(-)
2008-11-29Add Libtap as a bundled library (does not change any behaviour without ↵Gravatar Thomas Guyot-Sionnest
--enable-libtap) Detects system library as pre-1.4.13 and does not install the built-in library anymore Tested on: - Linux x86_64, with and without local libtap (System libtap installed) - Linux x86, with and without local libtap (System libtap NOT installed) - Solaris SPARC, with and without local libtap, with and without system libtap installed
2008-11-28Revert inclusion of libtap into nagiospluginsGravatar Thomas Guyot-Sionnest
(except for the NEWS file) This reverts the following commits (latest first): f3e0909, 9f16b54, be8df51, f31cd40, 5270c7d, a25083f, f1bfe40, c503d85 and 6c476db
2008-11-23Removing CVS/SVN tags and replacing with git-based versioningGravatar Thomas Guyot-Sionnest
For contrib/, full tags have been imported from subversion git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@2091 f882894a-f735-0410-b71e-b25c423dba1c
2008-11-19Bulk EOL cleanupGravatar Thomas Guyot-Sionnest
$ git diff --ignore-space-change|diffstat 0 files changed git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@2087 f882894a-f735-0410-b71e-b25c423dba1c
2008-11-19check_disk: rerpopulate the mount list after doing a stat() on paths ↵Gravatar Thomas Guyot-Sionnest
specified with -p for better automount support. NB: There's a memory leak here - properly freeing the mount list would invlove much more work - there's many other places where leaks can happen so it should be a project on its own. git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@2085 f882894a-f735-0410-b71e-b25c423dba1c