Commit graph

82 commits

Author SHA1 Message Date
Sven Nierlein
f938327b49 Revert "adopt http test to changed ssl expire date output"
This reverts commit 6cd50bc42c.
2016-11-11 10:52:36 +01:00
Sven Nierlein
3bdf392ae5 tests: make tests reliable for forcing the locale to C
Signed-off-by: Sven Nierlein <sven@nierlein.de>
2016-11-11 10:52:19 +01:00
Sven Nierlein
6cd50bc42c adopt http test to changed ssl expire date output
Signed-off-by: Sven Nierlein <sven@nierlein.de>
2016-11-11 09:43:13 +01:00
Peter (pir) Radcliffe
2f2b2f1987 GMT expiry display
Change solution to display GMT time in the local display format with
the offset number of hours from GMT to be clear about what timezone
this is if the local display format does not include offset.
2016-11-07 22:42:40 +01:00
Peter (pir) Radcliffe
06059ecd0e Revert "Fix check_http test time output"
This reverts commit 2d9e61a438.
2016-11-07 22:42:40 +01:00
Peter (pir) Radcliffe
2efad48e8c Fix check_http test time output
Tests need to match new output time and timezone.
2016-11-07 22:42:40 +01:00
Sven Nierlein
9c32acf5bb fix tests for certificates expire date with seconds 2015-10-02 16:27:12 +02:00
Sven Nierlein
75d884ed1e fix snmp test for included threshold
since 6623a1 check_snmp prints the thresholds along the performance data.
This adjust our test cases accordingly.

Signed-off-by: Sven Nierlein <Sven.Nierlein@consol.de>
2015-04-12 14:29:05 +02:00
Sven Nierlein
a5b6d94fc6 tests: skip extented snmp tests if snmpd has no perl support
solaris snmpd has no perl support by default, so this test will fail.

Signed-off-by: Sven Nierlein <Sven.Nierlein@consol.de>
2014-07-31 21:07:18 +02:00
Holger Weiss
b785a770e4 plugins/tests/check_http.t: Adjust date strings
Adjust the expected date strings to the now-localized output produced by
plugins/sslutils.c.

Closes #1275.
2014-07-21 21:52:33 +02:00
Sven Nierlein
b2fed383b1 tests: freebsds snmpd does not use quotes
when returning syscontact. So make them optional since we want to test
check_snmp and not the snmpd.

Signed-off-by: Sven Nierlein <Sven.Nierlein@consol.de>
2014-06-13 16:34:03 +02:00
Sven Nierlein
4102eaae0e tests: check_proc tests fail if uid -2 does not map to nobody
so make sure our tests only run if -2 maps to nobody

Signed-off-by: Sven Nierlein <Sven.Nierlein@consol.de>
2014-06-13 15:57:21 +02:00
Sven Nierlein
fb89accaaa require at least HTTP::Daemon 6.01
since the test uses send_header from HTTP::Daemon::ClientConn which has been introduced in
HTTP::Daemon 6.01
2014-06-13 14:01:12 +02:00
Sven Nierlein
c5a6c5136a tests: testCmd has own timeout which overwrites local one
so add configurable/optional timeout to testCmd.

Signed-off-by: Sven Nierlein <Sven.Nierlein@consol.de>
2014-06-12 13:56:48 +02:00
Sven Nierlein
3529d7465d tests: parts of the check_procs test only work when uid -2 exists
skip those tests if the uid does not exist

Signed-off-by: Sven Nierlein <Sven.Nierlein@consol.de>
2014-06-12 11:45:49 +02:00
Sven Nierlein
385340a4ef check_procs test fails if there is no user with uid 501
thats because check_procs verifys there is a user for a
given uid filter. So even we use sample data for this
test, we still need a real user.

Signed-off-by: Sven Nierlein <Sven.Nierlein@consol.de>
2014-02-18 16:20:11 +01:00
Thomas Guyot-Sionnest
f3078c33f6 Add perfdata in check_proc output tests 2014-01-31 13:00:53 -05:00
Thomas Guyot-Sionnest
f45adede7d Fix snmpd tests 2014-01-31 12:30:11 -05:00
Thomas Guyot-Sionnest
1dd0e4c963 Enable tests in tests/ subdirs 2014-01-31 08:54:44 -05:00
Thomas Guyot-Sionnest
c4e3cd6efd Add tests for negative thresholds in check_snmp
Next commit will work on fixing these!
2014-01-31 00:48:49 -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
4caf4ce4fe Rename ENV variable, keep backward compatibility
Rename NAGIOS_PLUGIN_STATE_DIRECTORY to MP_STATE_DIRECTORY
2014-01-25 03:35:46 -05:00
Holger Weiss
6141cfebf6 New default installation prefix: /usr/local
Install into /usr/local instead of /usr/local/nagios by default, in
order to comply with the Filesystem Hierarchy Standard (FHS) and
presumably the expectations of most users.
2014-01-21 13:17:36 +01: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
717b0e8d9c Fix the "check_http -d" tests 2013-08-18 18:31:59 +02:00
linkslice
2a8eab6b31 added ability to check regex against http headers. booyah! 2013-08-18 18:23:11 +02:00
Holger Weiss
66003414af tests/check_http.t: Fix whitespace issues
In tests/check_http.t, tabs are used for indentation.

While at it, apply another few cosmetic changes.
2012-08-10 12:49:30 +02:00
Holger Weiss
3f944a50b7 tests/check_http.t: Update the number of SSL tests 2012-08-10 12:41:41 +02:00
Holger Weiss
62d01df1fd tests/check_http.t: Fix test case
Fix the test case which is meant to make sure that

	check_http -C <n>,<m> [...]

returns a CRITICAL state if <m> is large enough.
2012-08-10 12:35:16 +02:00
Sven Nierlein
843f954056 check_snmp: use single quotes for perf data labels 2012-06-27 00:02:09 +02:00
Sven Nierlein
9c886d049d Fix performance data label containing spaces in check_snmp (Jochen Bern)
Add --perf-oids option for check_snmp to retain optional 1.4.14 compatibility
2012-06-26 20:53:13 +02:00
William Leibzon
181260d636 added test case for certificate checs with both warning and critical values 2012-06-25 12:54:15 +02:00
Thomas Guyot-Sionnest
4611e41bc5 check_http: check for and print the certificate cn
This patch adds a check for the certificate cn (hostname) to normal
certificate checks. It returns CRITICAL if th cn is missing, otherwise it
prints it in the normal output.

Patch by Stéphane Urbanovski
2011-02-04 00:54:52 -05:00
Ton Voon
1a5a83bb82 Fix for regex input of '|', being output causing problems with Nagios' parsing of
performance data. Now replaced with ','
2011-01-21 13:14:33 +00:00
Thomas Guyot-Sionnest
ae2a669137 Test updates...
1. Timetick test could fail with uptime > 115 days. Thresholds are
double type, so it's safe to put a large number even for 32bit systems.
2. Add a test based on an invalid bug report, worthy anyway.
2011-01-05 23:09:54 -05:00
Thomas Guyot-Sionnest
c49fed07c3 Fix minor test issues
My Test::More wouldn't print the total number of tests anymore, moving
the plan at the top appears to fix it.

At the same time I made check-http.t eval the special modules so it can
skip the tests instead of failing.
2010-11-30 23:57:04 -05:00
Thomas Guyot-Sionnest
5a2814a21b Revert "check_snmp now considers strings returned by SNMP that contain just"
This reverts commit 896962a1ad.

Conflicts:

	NEWS
	plugins/tests/check_snmp.t

Notes:
	Reverting because I rebased a patch that was doing the same thing, plus
	fixing more related regressions, and both didn't work together.
	I kept the tests intact except for one that wouldn't pass on 1.4.14
	either
2010-11-30 22:48:43 -05:00
Thomas Guyot-Sionnest
811684ffe3 State-based tests enhancements
- Use /var/tmp for state if no state dir environment variable is set,
  this avoid the need for a writable localstatedir during tests.
- Use "rm -f", mostly to avoid printing out garbage of the directory
  doesn't exists
2010-11-30 22:33:34 -05:00
nagios
896962a1ad check_snmp now considers strings returned by SNMP that contain just
numbers (according to strtod) to be a numeric value for threshold and
performance data
2010-11-15 15:43:41 +00:00
tonvoon
5c72d075de Corrected rate_multiplier calculation 2010-06-30 13:16:32 +00:00
tonvoon
3444519014 Removed suffix of "-rate" and let user decide label via --label 2010-06-30 09:37:10 +00:00
tonvoon
752dbc20b2 Tests for --rate-multiplier option 2010-06-30 07:56:05 +00:00
tonvoon
b8e2850c1a Added option to invert search results 2010-06-23 15:56:29 +00:00
tonvoon
1252195ed5 Display missing search string and URL when failed (Duncan Ferguson #2999924) 2010-06-23 14:44:34 +00: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
00bf32bb60 Fix tests and update NEWS file 2010-04-21 23:04:06 -04:00
Thomas Guyot-Sionnest
582034478b Attempt at fixing check_snmp multiline output:
This patch tries to detect and output nicely multi-line strings. This
method is broken by design; only a count of double-quotes and escapes
could work in every situation.
2010-04-21 22:04:28 -04:00
Thomas Guyot-Sionnest
181ac1e018 Add a test that succeeds on check_snmp v1.4.13. Newer versions skip additional
lines so this new test fails on the current head.

Note: check_snmp v1.4.13 with multi-line strings return somewhat v3 output;
      it's not exactly what the specs say but it doesn't appears to break them
      either. The fix could eventually supports both v2 and v3 output formats.
2009-09-05 03:16:54 -04:00
Thomas Guyot-Sionnest
8a96ee4741 Add tests using custom snmp agent
Only multi-line string test for now (regression test), counter rollover
tests planed with my snmp_counters_new branch.

NB: 64bit counters are broken in NetSNMP::agent from NetSNMP version 5.4.1
    and lower, but might come in handy one day
2009-07-31 03:07:38 -04:00
Matthias Eble
8e4c885ee1 Fixed crash from check_nt when -H unspecified or given multiple times (sf.net #2731755, debian #521097) 2009-05-01 11:16:37 +02:00