monitoring-plugins
monitoring-plugins copied to clipboard
Question: t/check_snmp.t fails - it's me?
I try to improve #1542... But first things first, I tried to run all the check_snmp tests, and it fails.
I run everything in the Container like the GitHub workflow: https://github.com/monitoring-plugins/monitoring-plugins/blob/master/.github/workflows/test.yml
I build a local container:
FROM debian:testing
VOLUME /media/ramdisk2/
ADD . /src/
WORKDIR /src/
RUN .github/prepare_debian.sh
ENV NPTEST_ACCEPTDEFAULT=1
ENV NPTEST_CACHE="/src/.github/NPTest.cache"
CMD /bin/sh
Build it: podman build -t mon .
Run it:
$ podman run -ti --rm mon bash
root@492e89f82a1e:/src# tools/setup
[...]
root@492e89f82a1e:/src# ./configure --enable-libtap --with-ipv6=no
[...]
root@492e89f82a1e:/src# make
[...]
root@492e89f82a1e:/src# cd plugins
root@492e89f82a1e:/src/plugins# service snmpd status
snmpd is running.
root@492e89f82a1e:/src/plugins# export NP_HOST_SNMP=127.0.0.1
root@492e89f82a1e:/src/plugins# export NP_SNMP_COMMUNITY=public
root@492e89f82a1e:/src/plugins# perl t/check_snmp.t
1..63
Testing: ./check_snmp -t 1
ok 1 - No host name
ok 2
Testing: ./check_snmp -H fakehostname
ok 3 - No OIDs specified
ok 4
Testing: ./check_snmp -H fakehost -o oids -P 3 -U not_a_user --seclevel=rubbish
ok 5 - Invalid seclevel
ok 6
Testing: ./check_snmp -H fakehost -o oids -P 3c
ok 7 - Invalid protocol
ok 8
Testing: ./check_snmp -H 127.0.0.1 -C public -o system.sysUpTime.0 -w 1: -c 1:
ok 9 - Exit OK when querying uptime
ok 10 - String contains SNMP OK
ok 11 - Got a time value
ok 12 - Got perfdata with value '472823' in it
Testing: ./check_snmp -H 127.0.0.1 -C public -o system.sysUpTime.0 -c 1
ok 13 - Threshold test -c 1
Testing: ./check_snmp -H 127.0.0.1 -C public -o system.sysUpTime.0 -c 1:
ok 14 - Threshold test -c 1:
Testing: ./check_snmp -H 127.0.0.1 -C public -o system.sysUpTime.0 -c ~:1
ok 15 - Threshold test -c ~:1
Testing: ./check_snmp -H 127.0.0.1 -C public -o system.sysUpTime.0 -c 1:10
ok 16 - Threshold test -c 1:10
Testing: ./check_snmp -H 127.0.0.1 -C public -o system.sysUpTime.0 -c @1:10
ok 17 - Threshold test -c @1:10
Testing: ./check_snmp -H 127.0.0.1 -C public -o system.sysUpTime.0 -c 10:1
ok 18 - Threshold test -c 10:1
Testing: ./check_snmp -H 127.0.0.1 -C public -o .1.3.6.1.2.1.1.3.0 -w 1: -c 1:
ok 19 - Test with numeric OID (no mibs loaded)
ok 20 - String contains SNMP OK
Testing: ./check_snmp -H 127.0.0.1 -C public -o system.sysDescr.0
ok 21 - Exit OK when querying sysDescr
ok 22 - Perfdata doesn't contain string values
Testing: ./check_snmp -H 127.0.0.1 -C public -o system.sysDescr.0,system.sysDescr.0
ok 23 - Exit OK when querying two string OIDs, comma-separated
ok 24 - String contains SNMP OK
Testing: ./check_snmp -H 127.0.0.1 -C public -o system.sysDescr.0 -o system.sysDescr.0
ok 25 - Exit OK when querying two string OIDs, repeated option
ok 26 - String contains SNMP OK
Testing: ./check_snmp -H 127.0.0.1 -C public -o host.hrSWRun.hrSWRunTable.hrSWRunEntry.hrSWRunIndex.1 -w 1:1 -c 1:1
not ok 27 - Exit OK when querying hrSWRunIndex.1
# Failed test 'Exit OK when querying hrSWRunIndex.1'
# at t/check_snmp.t line 90.
# got: 3
# expected: 0
not ok 28 - String fits SNMP OK and output format
# Failed test 'String fits SNMP OK and output format'
# at t/check_snmp.t line 91.
# 'External command error: Error in packet
# Reason: (noSuchName) There is no such variable name in this MIB.
# Failed object: HOST-RESOURCES-MIB::hrSWRunIndex.1
# '
# doesn't match '/^SNMP OK - 1\s.*$/'
Testing: ./check_snmp -H 127.0.0.1 -C public -o host.hrSWRun.hrSWRunTable.hrSWRunEntry.hrSWRunIndex.1 -w 0 -c 1:
not ok 29 - Exit WARNING when querying hrSWRunIndex.1 and warn-th doesn't apply
# Failed test 'Exit WARNING when querying hrSWRunIndex.1 and warn-th doesn't apply '
# at t/check_snmp.t line 94.
# got: 3
# expected: 1
not ok 30 - String matches SNMP WARNING and output format
# Failed test 'String matches SNMP WARNING and output format'
# at t/check_snmp.t line 95.
# 'External command error: Error in packet
# Reason: (noSuchName) There is no such variable name in this MIB.
# Failed object: HOST-RESOURCES-MIB::hrSWRunIndex.1
# '
# doesn't match '/^SNMP WARNING - \*1\*\s.*$/'
Testing: ./check_snmp -H 127.0.0.1 -C public -o host.hrSWRun.hrSWRunTable.hrSWRunEntry.hrSWRunIndex.1 -w :0 -c 0
not ok 31 - Exit CRITICAL when querying hrSWRunIndex.1 and crit-th doesn't apply
# Failed test 'Exit CRITICAL when querying hrSWRunIndex.1 and crit-th doesn't apply'
# at t/check_snmp.t line 98.
# got: 3
# expected: 2
not ok 32 - String matches SNMP CRITICAL and output format
# Failed test 'String matches SNMP CRITICAL and output format'
# at t/check_snmp.t line 99.
# 'External command error: Error in packet
# Reason: (noSuchName) There is no such variable name in this MIB.
# Failed object: HOST-RESOURCES-MIB::hrSWRunIndex.1
# '
# doesn't match '/^SNMP CRITICAL - \*1\*\s.*$/'
Testing: ./check_snmp -H 127.0.0.1 -C public -o ifIndex.2,ifIndex.1 -w 1:2 -c 1:2
not ok 33 - Checking two OIDs at once
# Failed test 'Checking two OIDs at once'
# at t/check_snmp.t line 102.
# got: 3
# expected: 0
not ok 34 - Got two values back
# Failed test 'Got two values back'
# at t/check_snmp.t line 103.
# 'External command error: Error in packet
# Reason: (noSuchName) There is no such variable name in this MIB.
# Failed object: IF-MIB::ifIndex.1
#
# Error in packet
# Reason: (noSuchName) There is no such variable name in this MIB.
# Failed object: IF-MIB::ifIndex.2
# '
# doesn't match '/^SNMP OK - 2 1/'
not ok 35 - Got 1st perf data
# Failed test 'Got 1st perf data'
# at t/check_snmp.t line 104.
# '472823'
# doesn't match '/ifIndex.2=2/'
not ok 36 - Got 2nd perf data
# Failed test 'Got 2nd perf data'
# at t/check_snmp.t line 105.
# '472823'
# doesn't match '/ifIndex.1=1/'
Testing: ./check_snmp -H 127.0.0.1 -C public -o ifIndex.2,ifIndex.1 -w 1:2,1:2 -c 2:2,2:2
not ok 37 - Checking critical threshold is passed if any one value crosses
# Failed test 'Checking critical threshold is passed if any one value crosses'
# at t/check_snmp.t line 108.
# got: 3
# expected: 2
not ok 38 - Got two values back
# Failed test 'Got two values back'
# at t/check_snmp.t line 109.
# 'External command error: Error in packet
# Reason: (noSuchName) There is no such variable name in this MIB.
# Failed object: IF-MIB::ifIndex.1
#
# Error in packet
# Reason: (noSuchName) There is no such variable name in this MIB.
# Failed object: IF-MIB::ifIndex.2
# '
# doesn't match '/^SNMP CRITICAL - 2 *1*/'
not ok 39 - Got 1st perf data
# Failed test 'Got 1st perf data'
# at t/check_snmp.t line 110.
# '472823'
# doesn't match '/ifIndex.2=2/'
not ok 40 - Got 2nd perf data
# Failed test 'Got 2nd perf data'
# at t/check_snmp.t line 111.
# '472823'
# doesn't match '/ifIndex.1=1/'
Testing: ./check_snmp -H 127.0.0.1 -C public -o host.hrStorage.hrMemorySize.0,host.hrSystem.hrSystemProcesses.0 -w 1:,1: -c 1:,1:
not ok 41 - Exit OK when querying hrMemorySize and hrSystemProcesses
# Failed test 'Exit OK when querying hrMemorySize and hrSystemProcesses'
# at t/check_snmp.t line 114.
# got: 3
# expected: 0
not ok 42 - String contains hrMemorySize and hrSystemProcesses
# Failed test 'String contains hrMemorySize and hrSystemProcesses'
# at t/check_snmp.t line 115.
# 'External command error: Error in packet
# Reason: (noSuchName) There is no such variable name in this MIB.
# Failed object: HOST-RESOURCES-MIB::hrMemorySize.0
# '
# doesn't match '/^SNMP OK - \d+ \d+/'
Testing: ./check_snmp -H 127.0.0.1 -C public -o host.hrSWRun.hrSWRunTable.hrSWRunEntry.hrSWRunIndex.1 -w @:0 -c @0
not ok 43 - Exit OK with inside-range thresholds
# Failed test 'Exit OK with inside-range thresholds'
# at t/check_snmp.t line 118.
# got: 3
# expected: 0
not ok 44 - String matches SNMP OK and output format
# Failed test 'String matches SNMP OK and output format'
# at t/check_snmp.t line 119.
# 'External command error: Error in packet
# Reason: (noSuchName) There is no such variable name in this MIB.
# Failed object: HOST-RESOURCES-MIB::hrSWRunIndex.1
# '
# doesn't match '/^SNMP OK - 1\s.*$/'
Testing: ./check_snmp -H 127.0.0.1 -C public -o enterprises.ucdavis.laTable.laEntry.laLoad.3
Testing: ./check_snmp -H 127.0.0.1 -C public -o enterprises.ucdavis.laTable.laEntry.laLoad.3 -w 472822.95 -c 472823.05
not ok 45 - Exit WARNING with fractionnal arguments
# Failed test 'Exit WARNING with fractionnal arguments'
# at t/check_snmp.t line 126.
# got: 3
# expected: 1
Testing: ./check_snmp -H 127.0.0.1 -C public -o system.sysUpTime.0,host.hrSWRun.hrSWRunTable.hrSWRunEntry.hrSWRunIndex.1 -w ,:0 -c ,:2
not ok 46 - Exit WARNING on 2nd threshold
# Failed test 'Exit WARNING on 2nd threshold'
# at t/check_snmp.t line 129.
# got: 3
# expected: 1
not ok 47 - First OID returned as string, 2nd checked for thresholds
# Failed test 'First OID returned as string, 2nd checked for thresholds'
# at t/check_snmp.t line 130.
# 'External command error: Error in packet
# Reason: (noSuchName) There is no such variable name in this MIB.
# Failed object: HOST-RESOURCES-MIB::hrSWRunIndex.1
# '
# doesn't match '/^SNMP WARNING - Timeticks:\s\(\d+\)\s+(?:\d+ days?,\s+)?\d+:\d+:\d+\.\d+\s+\*1\*\s.*$/'
Testing: ./check_snmp -H 127.0.0.1 -C public -o host.hrSWRun.hrSWRunTable.hrSWRunEntry.hrSWRunIndex.1 -w '' -c ''
not ok 48 - Empty thresholds doesn't crash
# Failed test 'Empty thresholds doesn't crash'
# at t/check_snmp.t line 133.
# got: 3
# expected: 0
Testing: ./check_snmp -H 127.0.0.1 -C public -o host.hrStorage.hrMemorySize.0,host.hrSystem.hrSystemProcesses.0 -w ,,1 -c ,,2
not ok 49 - Skipping first two thresholds on 2 OID check
# Failed test 'Skipping first two thresholds on 2 OID check'
# at t/check_snmp.t line 136.
# got: 3
# expected: 0
not ok 50 - Skipping first two thresholds, result printed rather than parsed
# Failed test 'Skipping first two thresholds, result printed rather than parsed'
# at t/check_snmp.t line 137.
# 'External command error: Error in packet
# Reason: (noSuchName) There is no such variable name in this MIB.
# Failed object: HOST-RESOURCES-MIB::hrMemorySize.0
# '
# doesn't match '/^SNMP OK - \d+ \w+ \d+\s.*$/'
Testing: ./check_snmp -H 127.0.0.1 -C public -o host.hrStorage.hrMemorySize.0,host.hrSystem.hrSystemProcesses.0 -w ,, -c ,,
not ok 51 - Skipping all thresholds
# Failed test 'Skipping all thresholds'
# at t/check_snmp.t line 140.
# got: 3
# expected: 0
not ok 52 - Skipping all thresholds, result printed rather than parsed
# Failed test 'Skipping all thresholds, result printed rather than parsed'
# at t/check_snmp.t line 141.
# 'External command error: Error in packet
# Reason: (noSuchName) There is no such variable name in this MIB.
# Failed object: HOST-RESOURCES-MIB::hrMemorySize.0
# '
# doesn't match '/^SNMP OK - \d+ \w+ \d+\s.*$/'
Testing: ./check_snmp -H 127.0.0.1 -C public -o system.sysUpTime.0 -c 1000000000000: -u '1/100 sec'
ok 53 - Timetick used as a threshold
ok 54 - Timetick used as a threshold, parsed as numeric
Testing: ./check_snmp -H 127.0.0.1 -C public -o system.sysUpTime.0
ok 55 - Timetick used as a string
ok 56 - Timetick used as a string, result printed rather than parsed
Testing: ./check_snmp -H 127.0.0.1 -C public -o HOST-RESOURCES-MIB::hrSWRunName.1
not ok 57 - snmp response without datatype
# Failed test 'snmp response without datatype'
# at t/check_snmp.t line 152.
# got: 3
# expected: 0
not ok 58 - snmp response without datatype
# Failed test 'snmp response without datatype'
# at t/check_snmp.t line 153.
# 'External command error: Error in packet
# Reason: (noSuchName) There is no such variable name in this MIB.
# Failed object: HOST-RESOURCES-MIB::hrSWRunName.1
# '
# doesn't match '/^SNMP OK - "(systemd|init)" \| $/'
ok 59 # skip no SNMP user defined
Testing: ./check_snmp -H 192.168.1.2 -C np_foobar -o system.sysUpTime.0 -w 1: -c 1:
ok 60 - Exit CRITICAL with non responsive host
ok 61 - String matches timeout problem
Testing: ./check_snmp -H nosuchhost -C np_foobar -o system.sysUpTime.0 -w 1: -c 1:
ok 62 - Exit UNKNOWN with non responsive host
ok 63 - String matches invalid host
# Looks like you failed 28 tests of 63.
For example:
./check_snmp -H localhost -o host.hrSWRun.hrSWRunTable.hrSWRunEntry.hrSWRunIndex.1
External command error: Error in packet
Reason: (noSuchName) There is no such variable name in this MIB.
Failed object: HOST-RESOURCES-MIB::hrSWRunIndex.1
It's me, isn't it?
What I'm doing wrong? What can I improve?
Thanks for any advice. Robert
Hi @rbo , I tried to replicate this, but it fails on initializing apache :-)
😅 now it fails with snmpd...
root@ca151fc781bd:/src/plugins# service snmpd status
snmpd is not running ... failed!
root@ca151fc781bd:/src/plugins#
@RincewindsHat thanks for your time. It's not easy to contribute
Indeed, the test cases are a pain with all those components. Too be honest I mostly just push that stuff to github and look at the test cases there. If I find the time, it would be good to try to simplify that. Maybe create a guide to setup a proper environment.
I did the same, enabled GitHub actions in my fork and created a dummy PR.
So created a fedora 36 VM and a XFS volume for podman storage and mount option pquota
this is important for the volume create -o size=...
.
[root@fedora monitoring-plugins]# mount | grep podman
/dev/mapper/fedora_fedora-podman on /var/lib/containers/storage/volumes type xfs (rw,relatime,seclabel,attr2,inode64,logbufs=8,logbsize=32k,prjquota)
[root@fedora monitoring-plugins]#
Adapt .github/workflows/test.yml to podman:
#!/usr/bin/env bash
if [ $UID -ne '0' ] ; then
echo "Please run as root..."
exit 1;
fi
set -x
podman volume create --driver local --opt type=tmpfs --opt device=tmpfs --opt o=size=100m,uid=1000 tmp-vol
podman run \
-e NPTEST_ACCEPTDEFAULT=1 \
-e NPTEST_CACHE="/src/.github/NPTest.cache" \
-w /src -v ${PWD}:/src:z \
--tmpfs /media/ramdisk1 \
-v /var/run/utmp:/var/run/utmp \
--mount type=volume,source=tmp-vol,target=/media/ramdisk2 \
debian:testing \
/bin/sh -c 'bash .github/prepare_debian.sh && \
tools/setup && \
./configure --enable-libtap --with-ipv6=no && \
make && \
make test'
podman container prune -f
podman volume prune -f
snmp test pass, but some other tests fail, that might be related to podman.
Here all details
cd lib && make test
make[1]: Entering directory '/src/lib'
cd tests && make test
make[2]: Entering directory '/src/lib/tests'
perl -MTest::Harness -e '$Test::Harness::switches=""; runtests(map {$_ .= ".t"} @ARGV)' test_utils test_disk test_tcp test_cm
d test_base64 test_ini1 test_ini3 test_opts1 test_opts2 test_opts3
test_utils.t ... ok
test_disk.t .... ok
test_tcp.t ..... ok
# Running plain echo command, set one
# Running plain echo command, set two
test_cmd.t ..... ok
test_base64.t .. ok
test_ini1.t .... ok
test_ini3.t .... ok
test_opts1.t ... ok
test_opts2.t ... ok
test_opts3.t ... ok
All tests successful.
Files=10, Tests=309, 1 wallclock secs ( 0.02 usr 0.00 sys + 0.26 cusr 0.06 csys = 0.34 CPU)
Result: PASS
make[2]: Leaving directory '/src/lib/tests'
make[1]: Leaving directory '/src/lib'
if test "" != ""; then cd perlmods && make test; fi
cd plugins && make test
make[1]: Entering directory '/src/plugins'
perl -I .. -I .. ../test.pl
No application (check_mysql) found for test harness (check_mysql.t)
No application (check_mysql_query) found for test harness (check_mysql_query.t)
./t/check_apt.t ........ ok
# Failed test 'Exit with return code 0'
# at ./t/check_by_ssh.t line 49.
# got: 254
# expected: 0
# Failed test 'Status text is correct for check 0'
# at ./t/check_by_ssh.t line 50.
# got: 'Linux 1cebfd990aa2 6.0.5-200.fc36.x86_64 #1 SMP PREEMPT_DYNAMIC Wed Oct 26 15:55:21 UTC 2022 x86_64
#
# The programs included with the Debian GNU/Linux system are free software;
# the exact distribution terms for each program are described in the
# individual files in /usr/share/doc/*/copyright.
#
# Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
# permitted by applicable law.'
# expected: 'OK: Everything is fine'
# Failed test 'Exit with return code 1'
# at ./t/check_by_ssh.t line 49.
# got: 254
# expected: 1
# Failed test 'Status text is correct for check 1'
# at ./t/check_by_ssh.t line 50.
# got: 'Linux 1cebfd990aa2 6.0.5-200.fc36.x86_64 #1 SMP PREEMPT_DYNAMIC Wed Oct 26 15:55:21 UTC 2022 x86_64
#
# The programs included with the Debian GNU/Linux system are free software;
# the exact distribution terms for each program are described in the
# individual files in /usr/share/doc/*/copyright.
#
# Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
# permitted by applicable law.'
# expected: 'WARNING: Hey, pick me, pick me'
# Failed test 'Exit with return code 2'
# at ./t/check_by_ssh.t line 49.
# got: 254
# expected: 2
# Failed test 'Status text is correct for check 2'
# at ./t/check_by_ssh.t line 50.
# got: 'Linux 1cebfd990aa2 6.0.5-200.fc36.x86_64 #1 SMP PREEMPT_DYNAMIC Wed Oct 26 15:55:21 UTC 2022 x86_64
#
# The programs included with the Debian GNU/Linux system are free software;
# the exact distribution terms for each program are described in the [440/1814]
# individual files in /usr/share/doc/*/copyright.
#
# Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
# permitted by applicable law.'
# expected: 'CRITICAL: Shit happens'
# Failed test 'Exit with return code 3'
# at ./t/check_by_ssh.t line 49.
# got: 254
# expected: 3
# Failed test 'Status text is correct for check 3'
# at ./t/check_by_ssh.t line 50.
# got: 'Linux 1cebfd990aa2 6.0.5-200.fc36.x86_64 #1 SMP PREEMPT_DYNAMIC Wed Oct 26 15:55:21 UTC 2022 x86_64
#
# The programs included with the Debian GNU/Linux system are free software;
# the exact distribution terms for each program are described in the
# individual files in /usr/share/doc/*/copyright.
#
# Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
# permitted by applicable law.'
# expected: 'UNKNOWN: What can I do for ya'
# Failed test 'Exit with return code 0 (OK)'
# at ./t/check_by_ssh.t line 56.
# got: 254
# expected: 0
# Failed test 'Status text if command returned none (OK)'
# at ./t/check_by_ssh.t line 57.
# got: 'Linux 1cebfd990aa2 6.0.5-200.fc36.x86_64 #1 SMP PREEMPT_DYNAMIC Wed Oct 26 15:55:21 UTC 2022 x86_64
#
# The programs included with the Debian GNU/Linux system are free software;
# the exact distribution terms for each program are described in the
# individual files in /usr/share/doc/*/copyright.
#
# Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
# permitted by applicable law.'
# expected: 'OK - check_by_ssh: Remote command 'exit 0' returned status 0'
# Failed test 'Exit with return code 1 (WARNING)'
# at ./t/check_by_ssh.t line 62.
# got: 254
# expected: 1
# Failed test 'Status text if command returned none (WARNING)'
# at ./t/check_by_ssh.t line 63.
# got: 'Linux 1cebfd990aa2 6.0.5-200.fc36.x86_64 #1 SMP PREEMPT_DYNAMIC Wed Oct 26 15:55:21 UTC 2022 x86_64
#
# The programs included with the Debian GNU/Linux system are free software;
# the exact distribution terms for each program are described in the
# individual files in /usr/share/doc/*/copyright.
#
# Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
# permitted by applicable law.'
# expected: 'WARNING - check_by_ssh: Remote command 'exit 1' returned status 1'
# Failed test 'Exit with return code 2 (CRITICAL)'
# at ./t/check_by_ssh.t line 68.
# got: 254
# expected: 2
# Failed test 'Status text if command returned none (CRITICAL)'
# at ./t/check_by_ssh.t line 69.
# got: 'Linux 1cebfd990aa2 6.0.5-200.fc36.x86_64 #1 SMP PREEMPT_DYNAMIC Wed Oct 26 15:55:21 UTC 2022 x86_64
#
# The programs included with the Debian GNU/Linux system are free software;
# the exact distribution terms for each program are described in the
# individual files in /usr/share/doc/*/copyright.
#
# Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
# permitted by applicable law.'
# expected: 'CRITICAL - check_by_ssh: Remote command 'exit 2' returned status 2'
# Failed test 'Exit with return code 3 (UNKNOWN)'
# at ./t/check_by_ssh.t line 74.
# got: 254
# expected: 3
# Failed test 'Status text if command returned none (UNKNOWN)'
# at ./t/check_by_ssh.t line 75.
# got: 'Linux 1cebfd990aa2 6.0.5-200.fc36.x86_64 #1 SMP PREEMPT_DYNAMIC Wed Oct 26 15:55:21 UTC 2022 x86_64
#
# The programs included with the Debian GNU/Linux system are free software;
# the exact distribution terms for each program are described in the
# individual files in /usr/share/doc/*/copyright.
#
# Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
# permitted by applicable law.'
# expected: 'UNKNOWN - check_by_ssh: Remote command 'exit 3' returned status 3'
# Failed test 'Exit with return code 7 (out of bounds)'
# at ./t/check_by_ssh.t line 80.
# got: 254
# expected: 7
# Failed test 'Status text if command returned none (out of bounds)'
# at ./t/check_by_ssh.t line 81.
# got: 'Linux 1cebfd990aa2 6.0.5-200.fc36.x86_64 #1 SMP PREEMPT_DYNAMIC Wed Oct 26 15:55:21 UTC 2022 x86_64
#
# The programs included with the Debian GNU/Linux system are free software;
# the exact distribution terms for each program are described in the
# individual files in /usr/share/doc/*/copyright.
#
# Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
# permitted by applicable law.'
# expected: 'UNKNOWN - check_by_ssh: Remote command 'exit 7' returned status 7'
# Failed test 'Exit with return code 8 (out of bounds)'
# at ./t/check_by_ssh.t line 86.
# got: 254
# expected: 8
# Failed test 'Return proper status text even with unknown status codes'
# at ./t/check_by_ssh.t line 87.
# got: 'Linux 1cebfd990aa2 6.0.5-200.fc36.x86_64 #1 SMP PREEMPT_DYNAMIC Wed Oct 26 15:55:21 UTC 2022 x86_64
#
# The programs included with the Debian GNU/Linux system are free software;
# the exact distribution terms for each program are described in the
# individual files in /usr/share/doc/*/copyright.
#
# Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
# permitted by applicable law.'
# expected: 'WOOPS: What did I smoke'
# Failed test 'Exit with return code 0 (OK)'
# at ./t/check_by_ssh.t line 92.
# got: 254
# expected: 0
# Failed test 'Status text if command returned none (OK)'
# at ./t/check_by_ssh.t line 93.
# got: 'Linux 1cebfd990aa2 6.0.5-200.fc36.x86_64 #1 SMP PREEMPT_DYNAMIC Wed Oct 26 15:55:21 UTC 2022 x86_64
#
# The programs included with the Debian GNU/Linux system are free software;
# the exact distribution terms for each program are described in the
# individual files in /usr/share/doc/*/copyright.
#
# Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
# permitted by applicable law.'
# expected: 'OK - check_by_ssh: Remote command 'exit 0' returned status 0'
# Failed test 'Multiple checks always return OK'
# at ./t/check_by_ssh.t line 99.
# got: 254
# expected: 0
# Failed test 'multiple checks status text is correct for line 0'
# at ./t/check_by_ssh.t line 111.
# got: 'Linux 1cebfd990aa2 6.0.5-200.fc36.x86_64 #1 SMP PREEMPT_DYNAMIC Wed Oct 26 15:55:21 UTC 2022 x86_64'
# expected: 'WARNING: Hey, pick me, pick me'
# Failed test 'multiple check status code is correct for line 0'
# at ./t/check_by_ssh.t line 112.
# got: ''
# expected: 'STATUS CODE: 1'
# Failed test 'multiple checks status text is correct for line 2'
# at ./t/check_by_ssh.t line 111.
# got: 'The programs included with the Debian GNU/Linux system are free software;'
# expected: 'OK: Everything is fine'
# Failed test 'multiple check status code is correct for line 2'
# at ./t/check_by_ssh.t line 112.
# got: 'the exact distribution terms for each program are described in the'
# expected: 'STATUS CODE: 0'
# Failed test 'multiple checks status text is correct for line 4'
# at ./t/check_by_ssh.t line 111.
# got: 'individual files in /usr/share/doc/*/copyright.'
# expected: 'UNKNOWN: What can I do for ya'
# Failed test 'multiple check status code is correct for line 4'
# at ./t/check_by_ssh.t line 112.
# got: ''
# expected: 'STATUS CODE: 3'
# Failed test 'multiple checks status text is correct for line 6'
# at ./t/check_by_ssh.t line 111.
# got: 'Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent'
# expected: 'CRITICAL: Shit happens'
# Failed test 'multiple check status code is correct for line 6'
# at ./t/check_by_ssh.t line 112.
# got: 'permitted by applicable law.'
# expected: 'STATUS CODE: 2'
# Failed test 'Exit always ok on passive checks'
# at ./t/check_by_ssh.t line 120.
# got: 3
# expected: 0
# Failed test 'One passive result for one check performed'
# at ./t/check_by_ssh.t line 124.
# got: 0
# expected: 1
# Failed test 'proper result for passive check'
# at ./t/check_by_ssh.t line 129.
# Failed test 'Exit always ok on passive checks'
# at ./t/check_by_ssh.t line 138.
# got: 3
# expected: 0
# Failed test 'Five passive result for five checks performed'
# at ./t/check_by_ssh.t line 142.
# got: 0
# expected: 5
# Failed test 'proper result for passive check 0'
# at ./t/check_by_ssh.t line 149.
# Failed test 'proper result for passive check 1'
# at ./t/check_by_ssh.t line 149.
# Failed test 'proper result for passive check 2'
# at ./t/check_by_ssh.t line 149.
# Failed test 'proper result for passive check 3'
# at ./t/check_by_ssh.t line 149.
# Failed test 'proper result for passive check 4'
# at ./t/check_by_ssh.t line 149.
# Looks like you failed 41 tests of 42.
./t/check_by_ssh.t .....
Dubious, test returned 41 (wstat 10496, 0x2900)
Failed 41/42 subtests
./t/check_cluster.t .... ok
./t/check_curl.t ....... ok
./t/check_dbi.t ........ ok
# Failed test 'Found monitoring-plugins.org'
# at ./t/check_dig.t line 58.
# got: 2
# expected: 0
# Failed test 'Output OK'
# at ./t/check_dig.t line 59.
# 'CRITICAL - Plugin timed out while executing system call'
# doesn't match '/DNS OK - [\.0-9]+ seconds? response time/'
# Failed test 'Warning threshold passed'
# at ./t/check_dig.t line 65.
# got: 2
# expected: 1
# Failed test 'Found monitoring-plugins.org on 8.8.8.8'
# at ./t/check_dig.t line 74.
# got: 2
# expected: 0
# Failed test 'Output OK'
# at ./t/check_dig.t line 75.
# 'CRITICAL - Plugin timed out while executing system call'
# doesn't match '/DNS OK - [\.0-9]+ seconds? response time/'
# Failed test 'Found monitoring-plugins.org on 8.8.8.8'
# at ./t/check_dig.t line 78.
# got: 2
# expected: 0
# Failed test 'Output OK for IPv4'
# at ./t/check_dig.t line 79.
# 'CRITICAL - Plugin timed out while executing system call'
# doesn't match '/DNS OK - [\.0-9]+ seconds? response time/'
# Failed test 'Got expected address'
# at ./t/check_dig.t line 82.
# got: 2
# expected: 0
# Failed test 'Got wrong address'
# at ./t/check_dig.t line 85.
# got: 2
# expected: 1
# Failed test 'Got expected fqdn'
# at ./t/check_dig.t line 90.
# got: 2
# expected: 0
# Failed test 'Output OK'
# at ./t/check_dig.t line 91.
# 'CRITICAL - Plugin timed out while executing system call'
# doesn't match '/DNS OK - [\.0-9]+ seconds? response time/'
# Looks like you failed 11 tests of 14.
./t/check_dig.t ........
Dubious, test returned 11 (wstat 2816, 0xb00)
Failed 11/14 subtests
One mountpoints has average inodes free - cannot do rest of test at ./t/check_disk.t line 81.
# Looks like your test exited with 255 just after 2.
./t/check_disk.t .......
Dubious, test returned 255 (wstat 65280, 0xff00)
Failed 76/78 subtests
# Failed test 'Found monitoring-plugins.org on 8.8.8.8'
# at ./t/check_dns.t line 81.
# got: 2
# expected: 0
# Failed test 'Output OK'
# at ./t/check_dns.t line 82.
# 'CRITICAL - Plugin timed out while executing system call'
# doesn't match '/DNS OK: [\.0-9]+ seconds? response time/'
# Looks like you failed 2 tests of 23.
./t/check_dns.t ........
Dubious, test returned 2 (wstat 512, 0x200)
Failed 2/23 subtests
./t/check_dummy.t ...... ok
# Failed test 'Responsive host returns OK'
# at ./t/check_fping.t line 27.
# got: 3
# expected: 0
# Failed test 'Non-Responsive host returns Critical'
# at ./t/check_fping.t line 30.
# got: 3
# expected: 2
# Looks like you failed 2 tests of 3.
./t/check_fping.t ......
Dubious, test returned 2 (wstat 512, 0x200)
Failed 2/3 subtests
./t/check_ftp.t ........ ok
./t/check_hpjd.t ....... ok
./t/check_http.t ....... ok
./t/check_imap.t ....... ok
./t/check_jabber.t ..... ok
# Failed test 'output ok'
# at ./t/check_ldap.t line 35.
# got: 'CRITICAL - Socket timeout after 5 seconds'
# expected: 'Could not bind to the LDAP server'
# Looks like you failed 1 test of 16.
./t/check_ldap.t .......
Dubious, test returned 1 (wstat 256, 0x100)
Failed 1/16 subtests
./t/check_load.t ....... ok
./t/check_nagios.t ..... ok
./t/check_ntp.t ........ ok
# Failed test 'Syntax ok'
# at ./t/check_ping.t line 33.
# got: '3'
# expected: '0'
# Failed test 'Output OK'
# at ./t/check_ping.t line 34.
# 'CRITICAL - You need more args!!!
# Could not open pipe: '
# doesn't match '/PING (ok|OK) - Packet loss = +[0-9]{1,2}\%, +RTA = [\.0-9]+ ms/'
# Failed test 'Syntax ok, with forced warning'
# at ./t/check_ping.t line 39.
# got: '3'
# expected: '1'
# Failed test 'Output OK'
# at ./t/check_ping.t line 40.
# 'CRITICAL - You need more args!!!
# Could not open pipe: '
# doesn't match '/Packet loss = +[0-9]{1,2}\%, +RTA = [\.0-9]+ ms/'
# Failed test 'Syntax ok, with forced critical'
# at ./t/check_ping.t line 45.
# got: '3'
# expected: '2'
# Failed test 'Output OK'
# at ./t/check_ping.t line 46.
# 'CRITICAL - You need more args!!!
# Could not open pipe: '
# doesn't match '/Packet loss = +[0-9]{1,2}\%, +RTA = [\.0-9]+ ms/'
# Failed test 'Old syntax ok'
# at ./t/check_ping.t line 51.
# got: '3'
# expected: '0'
# Failed test 'Output OK'
# at ./t/check_ping.t line 52.
# 'CRITICAL - You need more args!!!
# Could not open pipe: '
# doesn't match '/PING (ok|OK) - Packet loss = +[0-9]{1,2}\%, +RTA = [\.0-9]+ ms/'
# Failed test 'Old syntax, with forced critical'
# at ./t/check_ping.t line 57.
# got: '3'
# expected: '2'
# Failed test 'Output OK'
# at ./t/check_ping.t line 58.
# 'CRITICAL - You need more args!!!
# Could not open pipe: '
# doesn't match '/Packet loss = +[0-9]{1,2}\%, +RTA = [\.0-9]+ ms/'
# Failed test 'Timeout 1 second - host nonresponsive'
# at ./t/check_ping.t line 76.
# got: '3'
# expected: '2'
# Failed test 'Error contains 'timed out' string'
# at ./t/check_ping.t line 80.
# 'CRITICAL - You need more args!!!
# Could not open pipe: '
# doesn't match '/timed out/'
# Failed test 'Timeout 15 seconds - host nonresponsive'
# at ./t/check_ping.t line 86.
# got: '3'
# expected: '2'
# Failed test 'Error contains '100%' string (for 100% packet loss)'
# at ./t/check_ping.t line 87.
# 'CRITICAL - You need more args!!!
# Could not open pipe: '
# doesn't match '/100%/'
# Failed test 'Old syntax: Timeout - host nonresponsive'
# at ./t/check_ping.t line 95.
# got: '3'
# expected: '2'
# Failed test 'Error contains '100%' string (for 100% packet loss)'
# at ./t/check_ping.t line 96.
# 'CRITICAL - You need more args!!!
# Could not open pipe: '
# doesn't match '/100%/'
# Looks like you failed 16 tests of 20.
./t/check_ping.t .......
Dubious, test returned 16 (wstat 4096, 0x1000)
Failed 16/20 subtests
./t/check_pop.t ........ ok
./t/check_procs.t ...... ok
./t/check_smtp.t ....... ok
./t/check_snmp.t ....... ok
./t/check_ssh.t ........ ok
./t/check_swap.t ....... ok
./t/check_tcp.t ........ ok
./t/check_time.t ....... ok
./t/check_udp.t ........ ok
# Test 3 got: "0" (../NPTest.pm at line 271 fail #2)
# Expected: "2"
# Test 4 got: "USERS OK - 0 users currently logged in |users=0;0;0;0" (../NPTest.pm at line 279 fail #2)
# Expected: "/^USERS CRITICAL - [0-9]+ users currently logged in/"
# Test 7 got: "0" (../NPTest.pm at line 271 fail #4)
# Expected: "2"
# Test 8 got: "USERS OK - 0 users currently logged in |users=0;0:0;0:0;0" (../NPTest.pm at line 279 fail #4)
# Expected: "/^USERS CRITICAL - [0-9]+ users currently logged in/"
./t/check_users.t ......
Dubious, test returned 4 (wstat 1024, 0x400)
Failed 4/8 subtests
./t/negate.t ........... ok
./tests/check_curl.t ... ok
./tests/check_http.t ... ok
./tests/check_nt.t ..... ok
./tests/check_procs.t .. ok
./tests/check_snmp.t ... ok
Test Summary Report
-------------------
./t/check_by_ssh.t (Wstat: 10496 (exited 41) Tests: 42 Failed: 41)
Failed tests: 1-23, 25-42
Non-zero exit status: 41
./t/check_dig.t (Wstat: 2816 (exited 11) Tests: 14 Failed: 11)
Failed tests: 1-2, 4, 7-14
Non-zero exit status: 11
./t/check_disk.t (Wstat: 65280 (exited 255) Tests: 2 Failed: 0)
Non-zero exit status: 255
Parse errors: Bad plan. You planned 78 tests but ran 2.
./t/check_dns.t (Wstat: 512 (exited 2) Tests: 23 Failed: 2)
Failed tests: 7-8
Non-zero exit status: 2
./t/check_fping.t (Wstat: 512 (exited 2) Tests: 3 Failed: 2)
Failed tests: 1-2
Non-zero exit status: 2
./t/check_ldap.t (Wstat: 256 (exited 1) Tests: 16 Failed: 1)
Failed test: 4
Non-zero exit status: 1
./t/check_ping.t (Wstat: 4096 (exited 16) Tests: 20 Failed: 16)
Failed tests: 1-16
Non-zero exit status: 16
./t/check_users.t (Wstat: 1024 (exited 4) Tests: 8 Failed: 4)
Failed tests: 3-4, 7-8
Non-zero exit status: 4
Files=36, Tests=1100, 387 wallclock secs ( 0.20 usr 0.05 sys + 4.34 cusr 2.32 csys = 6.91 CPU)
Result: FAIL
Failed 8/36 test programs. 77/1100 subtests failed.
make[1]: *** [Makefile:2904: test] Error 255
make[1]: Leaving directory '/src/plugins'
make: *** [Makefile:1987: test] Error 2
+ podman container prune -f
1cebfd990aa241beeecb76684adb453e25b6c95dd3817cb080486714586b2903
+ podman volume prune -f
tmp-vol
I don't have any further questions. PR #1813 is on the way, let's see. Thanks @RincewindsHat for your help.