Lorenz Kästle
f855c5b5bb
general refactorin in lib, more local variables, real booleans
2025-09-15 14:06:55 +02:00
Lorenz Kästle
802e46f8ea
Run clang-format again
2025-09-15 12:59:37 +02:00
Lorenz Kästle
87195f5511
check_snmp: refactoring + fixes
...
This commit moves the state retention logic to check_snmp as it is only
used there and I do not want it to be used at all, so it doesn't get a
place in the lib.
Otherwise this adapts tests and fixes the rate computing in the
refactored version of check_snmp.
Also fixes some bugs detected with the tests
2025-09-08 15:57:06 +02:00
Lorenz Kästle
59e0a258f9
Migrate disk tests from lib, tool
2025-03-18 15:57:44 +01:00
Lorenz Kästle
0645c9fc2c
Implement new output functionality
2025-02-18 21:58:34 +01:00
RincewindsHat
880e57271d
lib: clang-format
2024-10-31 01:30:50 +01:00
Lorenz Kästle
ee1ba32099
lib: clang-format
2024-10-17 17:57:50 +02:00
RincewindsHat
ddbabaa3b6
Replace all old school booleans in lib witch C99 ones
2023-10-15 18:21:31 +02:00
RincewindsHat
4b9d90f31c
Whitespace fixes in lib
2023-10-15 18:17:36 +02:00
Jan Wagner
0f3703e641
Fix a lot of typos reported by codespell
2023-04-14 18:35:00 +00:00
Lorenz Kästle
ce1453a45a
Fix hashes in tests since we are using sha256 now
2023-02-01 11:46:52 +01:00
Lorenz Kästle
dd91860a46
Also link LIB_CRYPTO against tests
2023-02-01 01:23:04 +01:00
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