Commit graph

299 commits

Author SHA1 Message Date
Lorenz Kästle
faacf5525b Fix wrong exit codes 2025-02-19 19:44:17 +01:00
Sven Nierlein
ad99acbb8b check_rpc: recognize capitalized "Program" in rpcinfo output (fixes #1488)
Signed-off-by: Sven Nierlein <sven@consol.de>
2024-10-31 22:33:07 +01:00
Lorenz Kästle
d6d6d00daf
Merge pull request #1637 from aanriot/master
check_ifstatus: Add -d switch
2024-10-15 23:27:25 +02:00
alvar
93cd51bc62
check_ircd: IPv6 support (#1995)
The prior bindRemote function was restricted to IPv4 by explicitly using
address family specific functions as pack_sockaddr_in or unparametrized
gethostbyname. Since Perl 5.14, released in early 2013, there is
IO::Socket::IP, which supports lookups and connects for a dual stacked
network.

By switching the connection establishment code, the plugin is now able
to establish connections to IPv6-only hosts. Furthermore, additional -4
and -6 flags were introduced to enforce a specific address family.

> $ netstat -p tcp -ln | grep 6667
> tcp6         0      0  *.6667                 *.*                    LISTEN
> $ ./plugins-scripts/check_ircd -H localhost
> IRCD ok - Current Local Users: 4
> $ ./plugins-scripts/check_ircd -H localhost -4
> IRCD UNKNOWN: Could not start socket (Connection refused)
> $ ./plugins-scripts/check_ircd -H localhost -6
> IRCD ok - Current Local Users: 4
2024-03-18 10:05:04 +01:00
RincewindsHat
ec913afbda Shellcheck fixes for check_oracle 2023-11-05 22:32:48 +01:00
Sven Nierlein
03bde80abb check_mailq: exit on empty strings and exit early
in case of $utils::PATH_TO_MAILQ beeing an empty string, the "defined" is still true
and leads to misleading error messages.

While on it, rewrite cascaded if/elsifs to more readably exit-early ifs.
2023-10-26 11:26:41 +02:00
Sven Nierlein
db76f6867c check_mailq: unify tabs/spaces 2023-10-26 11:20:00 +02:00
Sven Nierlein
4e430f577a check_mailq: remove trailing whitespaces 2023-10-26 11:04:36 +02:00
Stuart Henderson
c2f20fdd94 use pack_sockaddr_in rather than hand-rolled
On some OS, sockaddr structs include a length field. Perl's pack_sockaddr_in
takes this into account; the hand-rolled "pack('S n a4 x8'..." doesn't do so,
resulting in connection failures.
2023-10-06 11:15:35 +02:00
Lorenz Kästle
d31dddadaf
Merge pull request #1411 from glensc/pld/nagios-plugins-check_disk_smb-zero-cap.patch
check_disk_smb: allow checking 0-sized resource (ex. IPC$)
2023-10-03 22:57:51 +02:00
Lorenz Kästle
a5ba424f85
Merge branch 'master' into master 2023-09-20 08:16:11 +02:00
RincewindsHat
42f593c5f2 check_breeze, check_wave, unset CDPATH env var 2023-09-07 20:56:15 +02:00
RincewindsHat
4b58104107 Use compile time determined path to snmpget in check_wave 2023-09-07 17:37:34 +02:00
RincewindsHat
0ee08563c5 Add dynamic path to snmpget to perl utils 2023-09-07 17:34:14 +02:00
MisterMountain
21885d85d5 also fixed the --help returns 2023-05-02 09:40:35 +02:00
Björn Berg
e14f1ad7c3
Merge branch 'monitoring-plugins:master' into fix_version_return_code 2023-05-02 09:31:32 +02:00
Jan Wagner
0f3703e641 Fix a lot of typos reported by codespell 2023-04-14 18:35:00 +00:00
MisterMountain
3dc677e4f1 fixed the identation (and also patched -V on check_oracle to behave exactly like --version again) 2023-04-11 17:11:06 +02:00
MisterMountain
5af4db7b41 fixed the outputs of the --versions options on 3 scripts 2023-04-11 16:26:12 +02:00
Lorenz
18be352f0f
Merge pull request #1852 from RincewindsHat/check_mssql
Actually build check_mssql too
2023-03-27 13:05:35 +02:00
RincewindsHat
c668f53035 Actually build check_mssql too 2023-03-15 18:16:04 +01:00
Lorenz
5077120a25
Merge branch 'master' into master 2023-03-10 11:33:25 +01:00
Jan Wagner
12ae1fb662 check_mailq.pl: separate submission queue
check_mailq.pl ignores the separate submission queue used in (modern?) sendmail
implementations.

For the queue output below with one message in the submission queue and no
messages in the transport queue, check_mailq.pl reports zero messages in the
queue because the request count from the last queue always overwrites previous
queues. If the sendmail MTA isn't running or has become wedged, messages will
sit in the submission queue forever.

The attached patch fixes this in a backwards compatible way (i.e., it shouldn't
break any of the currently supported formats).
--
Just turning attached patch of github issue #972 into a push request.
(Closes #972)
2023-02-03 14:44:52 +00:00
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