Commit graph

84 commits

Author SHA1 Message Date
Holger Weiss
eb85a612a3 Add UID to state retention file path
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-21 15:15:44 +02:00
Davide Madrisan
546e15a8e8 build - avoid deprecated INCLUDES
Signed-off-by: Davide Madrisan <davide.madrisan@gmail.com>
2014-03-09 11:02:18 +01:00
Thomas Guyot-Sionnest
bc92b93920 Add tests for negative thresholds in test_utils 2014-01-31 00:04:23 -05:00
Thomas Guyot-Sionnest
7310030ae7 Add tests for mp_translate_state() 2014-01-29 22:03:04 -05:00
Thomas Guyot-Sionnest
189e2aa344 Rename MP_STATE_DIRECTORY to MP_STATE_PATH 2014-01-27 08:35:23 -05:00
Thomas Guyot-Sionnest
68fe713335 Ignore MP_STATE_DIRECTORY in suid plugins
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-25 04:22:09 -05:00
Thomas Guyot-Sionnest
4caf4ce4fe Rename ENV variable, keep backward compatibility
Rename NAGIOS_PLUGIN_STATE_DIRECTORY to MP_STATE_DIRECTORY
2014-01-25 03:35:46 -05:00
Thomas Guyot-Sionnest
f1e9ebd037 Update comments
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-24 02:32:45 -05:00
Monitoring Plugins Development Team
63734f52ab Project rename initial commit.
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.
2014-01-19 14:18:47 -05:00
Holger Weiss
7573aa1616 Minor cosmetic changes 2013-09-12 21:50:18 +02:00
Holger Weiss
e8044713d4 check_tcp: Properly deal will partial recv(3)s
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-12 21:37:20 +02:00
Holger Weiss
662997251d Improve interface of np_expect_match() function
Replace the three boolean parameters of lib/utils_tcp.c's
np_expect_match() function with a single "flags" parameter.
2013-09-12 17:42:10 +02:00
Holger Weiss
d4a781817c Fix GCC's -Wuninitialized warnings
Fix the issues found by GCC when the -Wuninitialized flag is specified.
2013-09-10 20:52:13 +02:00
Dominique Broeglin
30bf8025d2 Adding tests for range @1:1 2013-08-17 17:19:34 +02:00
tonvoon
f324f5b94f Add test file directory 2010-06-25 07:52:59 +00:00
Ton Voon
2ad344a47b Cleanup some warnings displayed from IRIX tinderbox server 2010-06-24 10:08:13 +01:00
Ton Voon
18f6835eda Added state retention APIs. Implemented for check_snmp with --rate option.
See http://nagiosplugin.org/c-api-private for more details on the API.

Also updated check_snmp -l option to change the perfdata label.
2010-06-23 13:30:34 +00:00
Thomas Guyot-Sionnest
6e5d12b5d0 Use a more "natural" way of writing argument lists in extra-opts tests. 2009-06-11 00:14:23 -04:00
Thomas Guyot-Sionnest
ba132e9e52 Make extract_value more generic:
Add a separator argument passed using defines.
2009-01-26 02:05:21 -05:00
Thomas Guyot-Sionnest
0a74b6fda0 Remove the commented out blocks
The die tests are implemented in the test_*3.t files
2009-01-24 07:41:45 -05:00
Thomas Guyot-Sionnest
1b1dc7a48b Fix paths in test_ini tests 2009-01-24 00:41:00 -05:00
Thomas Guyot-Sionnest
8b103c0c77 Add die tests for parse_ini 2009-01-23 02:43:59 -05:00
Thomas Guyot-Sionnest
485f306868 Return UNKNOWN if none of the default files can be found.
It makes no sense to return unknown if an implicit section is not found, but
go on if the file is missing
2009-01-22 02:24:39 -05:00
Thomas Guyot-Sionnest
bf4abd5395 Add die tests for extra-opts 2009-01-22 02:04:31 -05:00
Thomas Guyot-Sionnest
a4647be424 Move check_ntp's extract_value to utils_base.c.
This function can also be used to parse performance data strings which
could be useful in the future.
2009-01-21 01:27:40 -05:00
Thomas Guyot-Sionnest
81871eaa82 Accidentally included built executables - also updated .gitignore 2009-01-21 01:25:06 -05:00
Thomas Guyot-Sionnest
3b69f13467 Some platform are missing setenv
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-20 23:58:02 -05:00
Thomas Guyot-Sionnest
26bf63a5bb Fix (or try at least) for IRIX compile to tap tests
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-20 22:28:30 -05:00
Thomas Guyot-Sionnest
82674792c7 Re-apply "Cleanup; fix the way libraries are linked; Make-It-Simple(tm)"
This reverts commit 7449b16b17.
2009-01-18 16:26:58 -05:00
Thomas Guyot-Sionnest
09f9ddd18d Typo 2009-01-15 06:12:04 -05:00
Thomas Guyot-Sionnest
f8c6d8b52e Fix test from last commit 2009-01-09 08:16:52 -05:00
Thomas Guyot-Sionnest
4d5eb82a47 basename check in test_utils.c was accidentaly added again.
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-09 02:44:36 -05:00
Thomas Guyot-Sionnest
7449b16b17 Revert "Cleanup; fix the way libraries are linked; Make-It-Simple(tm)"
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 a97e5fbda2.
2009-01-09 02:27:02 -05:00
Thomas Guyot-Sionnest
254baca111 Try to make IRIX happy (this fixes a similar warning in Solaris) 2009-01-08 08:14:19 -05:00
Thomas Guyot-Sionnest
a97e5fbda2 Cleanup; fix the way libraries are linked; Make-It-Simple(tm)
lib/Makefile.am       |    2 +-
 lib/tests/Makefile.am |   37 ++++---------------------------------
 2 files changed, 5 insertions(+), 34 deletions(-)
2009-01-07 04:41:54 -05:00
Thomas Guyot-Sionnest
2bbf2e6967 Add Libtap as a bundled library (does not change any behaviour without --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-29 04:38:54 -05:00
Thomas Guyot-Sionnest
538b97cea6 Revert inclusion of libtap into nagiosplugins
(except for the NEWS file)

This reverts the following commits (latest first): f3e0909, 9f16b54, be8df51, f31cd40, 5270c7d, a25083f, f1bfe40, c503d85 and 6c476db
2008-11-28 03:22:39 -05:00
Thomas Guyot-Sionnest
6fbd14fea5 Removing CVS/SVN tags and replacing with git-based versioning
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-23 05:38:47 +00:00
Ton Voon
a688e9338a Need to add in the libgnu.la for Solaris and other platforms
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-05 17:07:40 +00:00
Thomas Guyot-Sionnest
3011838fe9 Fix calculation of extra-opts parameters.
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
2008-11-05 16:15:59 +00:00
Thomas Guyot-Sionnest
cca36dc245 Fixed the test (not the bug yet) and added similar one to test_ini (that one works)
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@2066 f882894a-f735-0410-b71e-b25c423dba1c
2008-11-04 21:52:45 +00:00
Thomas Guyot-Sionnest
83ec9f2694 Corrected test_opts plan
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@2065 f882894a-f735-0410-b71e-b25c423dba1c
2008-11-04 21:31:10 +00:00
Thomas Guyot-Sionnest
5847c4eb83 Adding extra-opts check that crash on my prod servers (*** glibc detected *** malloc(): memory corruption: 0x0804e248 ***)
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@2064 f882894a-f735-0410-b71e-b25c423dba1c
2008-11-04 21:29:36 +00:00
Thomas Guyot-Sionnest
51ec51a8dc Make extra-opts (C plugins) behave more like N::P:
N::P allows both '#' and ';' for comments. Extra-opts used to allow only '#', it now allows both (';' is the standard for ini files)
  Extra-opts does not allow trailing comments anymore (like N::P)



git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@2063 f882894a-f735-0410-b71e-b25c423dba1c
2008-11-04 17:41:53 +00:00
Ton Voon
f31cd40f7a Correctly link to included libtap. Simplify invoking test scripts.
Removed basename test as we should use base_name from GNUlib which is
tested separately


git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@2042 f882894a-f735-0410-b71e-b25c423dba1c
2008-08-21 15:18:58 +00:00
Thomas Guyot-Sionnest
77362a18ba Typos in comments
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@2035 f882894a-f735-0410-b71e-b25c423dba1c
2008-08-21 04:17:25 +00:00
Ton Voon
f1bfe40afb Use tap.h from the libtap directory
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@2017 f882894a-f735-0410-b71e-b25c423dba1c
2008-07-02 20:07:00 +00:00
Ton Voon
6c476db6dc Adding libtap into distribution to help run C based tests
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@2013 f882894a-f735-0410-b71e-b25c423dba1c
2008-06-26 22:00:08 +00:00
Thomas Guyot-Sionnest
2a4640f671 make parse_ini die like in N::P if section isn't found
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1976 f882894a-f735-0410-b71e-b25c423dba1c
2008-04-04 10:11:22 +00:00
Thomas Guyot-Sionnest
815fbd802f Delete obsolete files
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1974 f882894a-f735-0410-b71e-b25c423dba1c
2008-04-02 09:19:26 +00:00