Commit graph

274 commits

Author SHA1 Message Date
lorenzg
c410ad3879 add tests for check_log 2023-01-20 09:11:26 +01:00
lgmu
b153a8c499 Fix indents 2023-01-20 09:11:26 +01:00
lgmu
db1f87c39e Added --exclude, cleanup args, fix -a count bug
Added --exclude to exclude patterns
Cleaned up duplicated code in the args
Fixed a bug when using --all because the count always returned "1" even when nothing matched

entry=$($GREP "$query" "$tempdiff")
count=$(echo "$entry" | wc -l)

Example:

$ touch testfile
$ TEST123=$(grep 'test' testfile)
$ echo "$TEST123" | wc -l
1
2023-01-20 09:11:26 +01:00
andrew bezella
916572c1ae Fixing nullmailer regex
attached is a patch that updates the format expected in the nullmailer
mailq output.  the regex is a little more flexible and less specific
than the previous version.
2023-01-18 22:09:12 +01:00
Lorenz
1ec6b162cb
Replace egrep with grep -E (#1791)
Replace egrep with grep -E to avoid the deprecation warnings
2022-10-07 11:44:47 +02:00
CDMIUB
d63bb62e5d
Cdmiub (#1770)
* added timout option to check_disk_smb
2022-06-18 09:15:58 +02:00
Tobias Fiebig
066b6e6824
remove duplicate W=i/C=i args (#1755)
Co-authored-by: Tobias Fiebig <t.fiebig@tudelft.nl>
2022-03-26 12:55:23 +01:00
Claudio Kuenzler
9a659f46ff
Add configfile feature to check_disk_smb (#1402) 2022-03-17 10:01:50 +01:00
Andreas Motl
6c8b45a169 check_uptime: Fix lowercase typo in plugin output 2022-02-15 16:31:23 +01:00
Andreas Motl
c99a166a43 check_uptime: Add option to report uptime in days instead of seconds
Currently, the plugin output is:

  CRITICAL: Uptime is 38829029 seconds.

When using the proposed `--days|-d` option, it will be:

  CRITICAL: Uptime is 449 days.
2022-02-15 16:09:47 +01:00
Lorenz
c255656a4c
Rebase to master (#1731) 2022-01-21 15:12:35 +01:00
Lorenz
78a999edd4
Merge pull request #1679 from RincewindsHat/shell_check_check_sensors.sh
check_sensors.sh: Make shellcheck happier
2021-12-21 10:57:53 +01:00
rincewind
763b7ab0c4 check_sensors.sh: Make shellcheck happier 2021-12-21 10:19:32 +01:00
RincewindsHat
c1bf69c3a6 Apparently Dash is not Bash, so -v does not work 2021-12-20 00:08:24 +01:00
RincewindsHat
5a81bd813e Missing oldlog now aborts check_log 2021-12-02 17:10:57 +01:00
RincewindsHat
911e44045d
Merge branch 'master' into fix/shellcheck 2021-12-02 16:42:05 +01:00
RincewindsHat
8df8460c6c
Fix syntax error resulting from merging 2021-12-02 15:26:31 +01:00
RincewindsHat
df1e9e975f
Merge branch 'master' into mailq-add-config-dir 2021-12-02 15:11:21 +01:00
RincewindsHat
5e2c399220 Make size parameter a little bit more intelligible 2021-11-29 17:27:57 +01:00
RincewindsHat
f589b7041f
Merge pull request #1493 from darksoul42/master
Fix regexp for nullmailer "mailq" output.
Looks good. Thank you very much.
2021-11-29 15:39:28 +01:00
RincewindsHat
d752c891f4
Merge pull request #1692 from RincewindsHat/modernize_check_log
Modernize check log
2021-11-28 14:30:22 +01:00
Lorenz Kästle
03028d23b6 Add comment to make the purpose of the nickname fix more obvious 2021-10-20 11:14:44 +02:00
Lorenz Kästle
ead405515f Restrict the nickname length of the test user for check_ircd
check_ircd was using the string `ircd` plus the PID as a nickname
for connecting to a IRC network by default.
This caused errors, when the PID was too high and the network
restricted the length of the nickname to 9 characters.
This patch "fixes" this by just cutting it of, if it gets too big.
2021-10-20 11:14:44 +02:00
Peter Newman
1fb635d869
Re-attach a comment to where it actually belongs 2021-07-22 13:33:14 +01:00
rincewind
10db89344a Add quoting for the remaining variables 2021-07-05 09:56:19 +02:00
rincewind
53b77dee91 Add -a option to print all matching lines and -p and -e options for perl and extended RE 2021-07-02 18:38:12 +02:00
rincewind
c2aa1a5fa2 Add extended and perl regex 2021-07-02 18:01:47 +02:00
rincewind
14e1d7f6af Apply shellcheck 2021-07-02 17:39:47 +02:00
rincewind
3abcf83af4 Remove modified note, since this is a git repository 2021-07-02 10:37:35 +02:00
Sven Nierlein
aa79ab278f check_mailq: restore accidentially removed options
with https://github.com/monitoring-plugins/monitoring-plugins/issues/381 -W and -C have been removed. It
would have been sufficient to only remove the long options. Restoring short options..

 - fixes https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=954961
2020-12-08 16:24:10 +01:00
Sven Nierlein
660e0cf4e2 tests: skip some tests if Monitoring::Plugin::Range isn't available
The check_file_age uses Monitoring::Plugin::Range internally. Skip thoses tests
if the module isn't available.
2018-12-04 14:54:12 +01:00
Bernd Arnold
6a8564fb44 Fixed error message, added comment 2018-06-17 09:42:25 +02:00
Bernd Arnold
37f9b45266 Drop uptime binary call
No need to call /bin/uptime, since the string can be generated with strftime(...).
2018-06-17 09:36:13 +02:00
Bernd Arnold
28f4d144f2 Added help text for range support 2018-06-17 09:20:16 +02:00
Bernd Arnold
b40d660bb3 Remove useless (empty) print 2018-06-17 09:19:55 +02:00
Sven Nierlein
0b9c85109b fix typo in check_uptime 2018-06-13 20:23:21 +02:00
Sven Nierlein
ae7c16306c add check_uptime to makefile 2018-06-13 20:23:07 +02:00
Bernd Arnold
cf157ef845 Refactoring
Better alignment.
Avoid duplications ("Exceeds ... threshold").
2018-06-13 17:28:53 +02:00
Bernd Arnold
558090a7d8 Added tests for range values 2018-06-13 17:26:51 +02:00
Bernd Arnold
db499b6f5b Introducing ranges for warning and critical
Works as before:
-w 1w -c 2w

New (as before, but also warn if uptime < 5m, and crit if uptime < 2m):
-w 5m:1w -c 2m:2w

(idea by @sni)

Also refactored the time calculation, if a suffix is present:
New sub calc_as_seconds($)
2018-06-13 16:56:22 +02:00
Bernd Arnold
a784b19d6f Modified alignment 2018-06-13 16:10:17 +02:00
Bernd Arnold
9ee884b3de Fix: Use macro for perl binary
I've messed that up in the previous commit 554b702f9d.
2018-06-13 15:57:16 +02:00
Bernd Arnold
5a73671ec6 Fix: Initialize values
Otherwise, there's a warning about unitialized values:
Use of uninitialized value $hours in numeric gt (>) at ...
Use of uninitialized value $days in numeric gt (>) at ...
2018-06-09 10:02:23 +02:00
Bernd Arnold
554b702f9d Fix: uptime_file variable was declared too late
When called with --help, the following error was shown:
Use of uninitialized value $uptime_file in concatenation (.) or string at
2018-06-03 20:55:42 +02:00
Bernd Arnold
250adb31ef Added test file 2018-06-03 16:51:43 +02:00
Bernd Arnold
d5fbf8ae93 Added suffix "s" for seconds in perfdata output 2018-06-03 16:42:34 +02:00
Bernd Arnold
44816b4979 Rename to .pl
All other check script also have the .pl ending
2018-06-03 16:05:54 +02:00
Bernd Arnold
de0872e2d7 Replaced my values with macros 2018-05-30 19:11:06 +02:00
Bernd Arnold
96c8dd8935 My version of check_uptime
Derived from check_mailq
2018-05-30 19:03:43 +02:00
Stephane Lapie
541322969e Fix regexp for nullmailer "mailq" output
As it currently is, the regular expression does not match mailq command
output on a Debian Jessie setup.

Three erroneous behaviors fixed :
- Meaningful lines do not end with the "bytes" word
- There might be one or more space before the byte count, not 2
- Time match was completely broken, it only accounted for 0-29 minutes
and 0-29 seconds.
2017-06-07 15:12:53 +09:00