summaryrefslogtreecommitdiffstats
path: root/lib
AgeCommit message (Collapse)AuthorFilesLines
2014-01-27And release notes for previous change (MP_STATE_DIRECTORY)Thomas Guyot-Sionnest1-1/+0
The change has also been updated in https://www.monitoring-plugins.org/doc/state-retention.html
2014-01-25Ignore MP_STATE_DIRECTORY in suid pluginsThomas Guyot-Sionnest3-9/+21
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 newlinesThomas Guyot-Sionnest1-5/+5
2014-01-25Rename ENV variable, keep backward compatibilityThomas Guyot-Sionnest2-3/+9
Rename NAGIOS_PLUGIN_STATE_DIRECTORY to MP_STATE_DIRECTORY
2014-01-24Use access() instead of stat() in parse_ini.cThomas Guyot-Sionnest1-3/+2
2014-01-24Update commentsThomas Guyot-Sionnest10-10/+10
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"Holger Weiss2-2/+2
"Monitoring Plugins" is a name.
2014-01-20Minor fixes to be amended into "rename" commitHolger Weiss2-2/+2
2014-01-19Project rename initial commit.Monitoring Plugins Development Team13-91/+91
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 changesHolger Weiss2-7/+10
2013-09-12check_tcp: Properly deal will partial recv(3)sHolger Weiss3-27/+58
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() functionHolger Weiss3-18/+23
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 warningsHolger Weiss1-0/+3
Fix the issues found by GCC when the -Wimplicit-function-declaration flag is specified.
2013-09-10Fix GCC's -Wuninitialized warningsHolger Weiss1-1/+1
Fix the issues found by GCC when the -Wuninitialized flag is specified.
2013-08-20added missing header to fix build on freebsdSven Nierlein1-0/+1
2013-08-17Adding tests for range @1:1Dominique Broeglin1-1/+13
2012-11-03lib/utils_base.c: Stop dumping core on bad args to check_snmpAndreas Ericsson1-8/+8
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 ↵Matthias Eble2-0/+17
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 environmentThomas Guyot-Sionnest1-4/+5
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 directorytonvoon1-1/+1
2010-06-24Cleanup some warnings displayed from IRIX tinderbox serverTon Voon2-14/+9
2010-06-23Added state retention APIs. Implemented for check_snmp with --rate option.Ton Voon10-2/+593
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.Thomas Guyot-Sionnest3-173/+137
2009-06-01Fix the memory allocation for the thresholds dataHolger Weiss1-1/+3
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 functionsThomas Guyot-Sionnest1-0/+3
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:Thomas Guyot-Sionnest3-28/+34
Add a separator argument passed using defines.
2009-01-24Remove the commented out blocksThomas Guyot-Sionnest2-66/+0
The die tests are implemented in the test_*3.t files
2009-01-24Fix paths in test_ini testsThomas Guyot-Sionnest2-4/+4
2009-01-23Add die tests for parse_iniThomas Guyot-Sionnest6-5/+76
2009-01-22Return UNKNOWN if none of the default files can be found.Thomas Guyot-Sionnest2-9/+17
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-optsThomas Guyot-Sionnest5-10/+72
2009-01-21Move check_ntp's extract_value to utils_base.c.Thomas Guyot-Sionnest3-1/+145
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 .gitignoreThomas Guyot-Sionnest2-0/+0
2009-01-21Some platform are missing setenvThomas Guyot-Sionnest8-98/+168
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-21Fix (or try at least) for IRIX compile to tap testsThomas Guyot-Sionnest1-1/+1
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)"Thomas Guyot-Sionnest1-33/+4
This reverts commit 7449b16b1781c645751e2c05b93893e93630fb2a.
2009-01-15TypoThomas Guyot-Sionnest1-1/+2
2009-01-13Make /lib before /lib/tests to satisfy dependencies (building tests fails on ↵Thomas Guyot-Sionnest1-1/+1
IRIX)
2009-01-09Fix test from last commitThomas Guyot-Sionnest1-1/+1
2009-01-09basename check in test_utils.c was accidentaly added again.Thomas Guyot-Sionnest1-4/+0
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)"Thomas Guyot-Sionnest2-5/+34
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)Thomas Guyot-Sionnest1-1/+1
2009-01-07Cleanup; fix the way libraries are linked; Make-It-Simple(tm)Thomas Guyot-Sionnest2-34/+5
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 ↵Thomas Guyot-Sionnest1-20/+29
--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 nagiospluginsThomas Guyot-Sionnest10-60/+85
(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 versioningThomas Guyot-Sionnest13-29/+0
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 cleanupThomas Guyot-Sionnest3-9/+9
$ 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 ↵Thomas Guyot-Sionnest1-10/+9
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
2008-11-05Need to add in the libgnu.la for Solaris and other platformsTon Voon1-1/+1
where missing functions have been replaced by GNUlib git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@2071 f882894a-f735-0410-b71e-b25c423dba1c
2008-11-05Fix calculation of extra-opts parameters.Thomas Guyot-Sionnest2-4/+3
By reading the current list instead of the additional one when counting parameters, extra-opts calculation was allocating insuficient space for the final array if later sections contained more arguments than the sum of all previously parsed sections. git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@2069 f882894a-f735-0410-b71e-b25c423dba1c