Bug 1830611 - nsca-client 2.10.0-1 0 data packet(s) sent after upgrade from 2.9.2-8
Summary: nsca-client 2.10.0-1 0 data packet(s) sent after upgrade from 2.9.2-8
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: nsca
Version: 31
Hardware: Unspecified
OS: Unspecified
unspecified
high
Target Milestone: ---
Assignee: Xavier Bachelot
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2020-05-03 01:08 UTC by Rick Dicaire
Modified: 2020-05-21 04:16 UTC (History)
3 users (show)

Fixed In Version: nsca-2.10.0-2.fc31 nsca-2.10.0-2.fc32 nsca-2.10.0-2.fc30 nsca-2.10.0-2.el8 nsca-2.10.0-2.el6 nsca-2.10.0-2.el7
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2020-05-14 02:28:39 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Rick Dicaire 2020-05-03 01:08:39 UTC
Description of problem:

Upgrade of nsca-client from 2.9.2-8 to 2.10.0-1 stopped client communication to nsca server 2.9.2.

Version-Release number of selected component (if applicable):

Name         : nsca-client
Version      : 2.10.0
Release      : 1.fc31
Architecture : x86_64
Size         : 74 k
Source       : nsca-2.10.0-1.fc31.src.rpm
Repository   : @System
From repo    : updates
Summary      : Client application for sending updates to a nsca server
URL          : http://www.nagios.org/
License      : GPLv2+
Description  : Client application for sending updates to a nsca server.


How reproducible:

dnf update when nsca-client 2.9.2-8 is installed, 2.10.0-1 will be installed.
Attempt to send data to nsca server, get:

0 data packet(s) sent to host successfully.

Steps to Reproduce:
1.
2.
3.

Actual results:
0 data packet(s) sent to host successfully.

Expected results:
1 data packet(s) sent to host successfully.

Additional info:
No configuration change involved. Just a pkg update with expectation that things should continue to work.

I had to downgrade nsca-client back to 2.9.2-8 in order to be able to continue to monitor passively from this host (Fedora Server 31). The nsca server is 2.9.2 on Ubuntu.

Comment 1 Rick Dicaire 2020-05-04 14:15:02 UTC
If there are troubleshooting steps to run, I'm willing to do so, at present I don't know what else to do, there was nothing in logs indicating a problem, only that output from the commandline.

Comment 2 Xavier Bachelot 2020-05-04 15:08:47 UTC
This is really curious, I don't see what could be causing this and I cannot reproduce locally (I used an F32 box, with the nsca 2.10 and nsca-client 2.9)
Could you try to reproduce such a setup with only Fedora to rule out the Ubuntu nsca server ?
Do you have access to the nsca server logs ?

Comment 3 Rick Dicaire 2020-05-04 18:14:28 UTC
You have it reversed, the nsca server is 2.9.2,  nsca-client was 2.10.0.
nsca/nsca-client 2.10 are not available as pkgs for ubuntu 18.04, which is what our nagios server is running.

From syslog on the nsca server:

<30>Apr 29 21:35:08 nagios nsca[3977]: Handling the connection...
<31>Apr 29 21:35:08 nagios nsca[3977]: Connection from 192.168.15.20 port 58343
<30>Apr 29 21:35:08 nagios nsca[3975]: Handling the connection...
<31>Apr 29 21:35:08 nagios nsca[3975]: Connection from 192.168.15.20 port 57831
<30>Apr 29 21:35:08 nagios nsca[3976]: Handling the connection...
<31>Apr 29 21:35:08 nagios nsca[3976]: Connection from 192.168.15.20 port 58087

I can try and install nsca 2.9.2 server on a F31 installation and see if nsca-client 2.10.0 will talk to it.

Comment 4 Xavier Bachelot 2020-05-04 20:36:33 UTC
You're right, I did it the wrong way, sorry about that...
I did the test again with a 2.9.2 nsca server and a 2.10.0 nsca client.

If I feed valid input to send_nsca, it works.

$ echo -e 'localhost\ttest\t0\tOK\n' | sudo send_nsca -H localhost
1 data packet(s) sent to host successfully.

If I feed an invalid input, it doesn't.

$ echo -e 'This is invalid' | sudo send_nsca -H localhost
0 data packet(s) sent to host successfully.

The corresponding (redacted) logs with nsca server in debug mode are:
- Valid packet (the error about the command file is expected, this box is not running nagios)
nsca[26767]: Connection from 127.0.0.1 port 33423
nsca[26767]: Handling the connection...
nsca[26767]: Time difference in packet: 0 seconds for host localhost
nsca[26767]: SERVICE CHECK -> Host Name: 'localhost', Service Description: 'test', Return Code: '0', Output: 'OK'
nsca[26767]: Attempting to write to nagios command pipe
nsca[26767]: Command file '/var/spool/nagios/cmd/nagios.cmd' does not exist, attempting to use alternate dump file '/var/spool/nagios/cmd/nsca.dump' for output
nsca[26767]: End of connection...

- Invalid packet
nsca[26739]: Connection from 127.0.0.1 port 28815
nsca[26739]: Handling the connection...
nsca[26739]: End of connection...

Could that be something in what you feed to send_nsca that works with 2.9.2 but doesn't with 2.10.0 ?

Comment 5 Rick Dicaire 2020-05-04 22:21:26 UTC
Successful sends from 2.9.2 look like the above in logs.
Fails show as:
May  4 17:01:23 nagios nsca[15306]: Connection from 192.168.15.7 port 31928
May  4 17:01:23 nagios nsca[15306]: Handling the connection...
May  4 17:01:24 nagios nsca[15306]: End of connection...

Example data:
echo "localhost,0,Host UP at $(date)"|/usr/sbin/send_nsca -H 192.168.15.28 -d ','

Ok, found something new...with 2.10 the delim char works using

-d 0x2C

instead of

-d ','

2.10:
 [delim]            = Delimiter to use when parsing input (defaults to a tab).
                      Honors hex formatted values, e.g. 0x09.

2.9.2:
 [delim]        = Delimiter to use when parsing input (defaults to a tab)

Variations of -d, -d ' -d',' all fail..only hex values now work?

Thats a pretty significant difference. Checking Changelog:

2.10 - 2020-04-02
Changed release date to ISO format (yyyy-mm-dd) (John Frickson)
Add --quiet mode to send_nsca (Timo Juhani Lindfors)
Add --ds to specify block delimiters (for sending multiple checks at once) in send_nsca (Nate Rini)
Add legacy_2_7_mode (for sending to nsca 2.7.x) to send_nsca (Adrian Freihofer, Xavier Bachelot)
Add foreground mode (Nate Rini)
Send errors to stderr, where they belong (Bas Couwenberg / Sean Finney)
Fix crashes on ECONNABORTED (Craig Leres)
Fix potential buffer overflow (Bas Couwenberg)
Spelling fixes (Josh Soref, Lajos Veres, Bas Couwenberg)
Removed escape newlines so that long output works (Bryan Heden)

No mention...

Comment 6 Rick Dicaire 2020-05-04 22:40:16 UTC
I filed issue at github https://github.com/NagiosEnterprises/nsca/issues/44 requesting changing the documentation to note REQUIRED use of HEX instead of "honoring" as its current documentation states.

This can be closed as its not a bug, but a change in argument usage. Short of Nagios team fixing the documentation, maybe your team can update any documentation?

Thanks for your time and troubleshooting help.

Comment 7 Xavier Bachelot 2020-05-05 09:53:49 UTC
Here's the scratch build I wrote about in the upstream bug:
https://koji.fedoraproject.org/koji/taskinfo?taskID=44115409

Comment 8 Xavier Bachelot 2020-05-05 10:06:30 UTC
The previous comment was a bit short on details...
The scratch build is nsca 2.10.0 with an added patch that drops support for hex formatted delimiters and thus restores the previous behaviour.
https://github.com/xavierba/nsca/commit/8ca02b67dc015b81c4d32eff6491346a13b3728f

Comment 9 Rick Dicaire 2020-05-05 14:05:48 UTC
rpm -qa|grep nsca
nsca-client-2.10.0-2.fc31.x86_64

echo "localhost,0,Host UP at now"|/usr/sbin/send_nsca -H 192.168.15.28 -d ','
1 data packet(s) sent to host successfully.

echo "localhost,0,Host UP at now"|/usr/sbin/send_nsca -H 192.168.15.28 -d 0x2c
0 data packet(s) sent to host successfully.

Revert seems to be working.

##########################

The CHANGELOG for 2.10 mentions "Send errors to stderr, where they belong (Bas Couwenberg / Sean Finney)"

Return status for the command that results with "0 data packet(s) sent to host successfully." is 0.
Is that intentional, if so do I need to file a separate bug report?

root@daw3:~# echo "localhost,0,Host UP at now"|/usr/sbin/send_nsca -H 192.168.15.28 -d 0x2c
0 data packet(s) sent to host successfully.
root@daw3:~# echo $?
0

Comment 10 Xavier Bachelot 2020-05-05 14:42:57 UTC
Thanks for testing. I'll make a real build for all supported releases asap.

And yes, it looks like you may have found another bug, although with way less damage potential than the first one. Please file it upstream.

Comment 11 Fedora Update System 2020-05-05 14:57:36 UTC
FEDORA-2020-5136a26843 has been submitted as an update to Fedora 31. https://bodhi.fedoraproject.org/updates/FEDORA-2020-5136a26843

Comment 12 Fedora Update System 2020-05-05 14:57:36 UTC
FEDORA-2020-be02512922 has been submitted as an update to Fedora 30. https://bodhi.fedoraproject.org/updates/FEDORA-2020-be02512922

Comment 13 Fedora Update System 2020-05-05 14:57:37 UTC
FEDORA-EPEL-2020-55ca7ea1da has been submitted as an update to Fedora EPEL 6. https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2020-55ca7ea1da

Comment 14 Fedora Update System 2020-05-05 14:57:38 UTC
FEDORA-EPEL-2020-a359910824 has been submitted as an update to Fedora EPEL 7. https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2020-a359910824

Comment 15 Fedora Update System 2020-05-05 14:57:39 UTC
FEDORA-EPEL-2020-fc472cc3f4 has been submitted as an update to Fedora EPEL 8. https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2020-fc472cc3f4

Comment 16 Fedora Update System 2020-05-05 14:57:39 UTC
FEDORA-2020-267df5d597 has been submitted as an update to Fedora 32. https://bodhi.fedoraproject.org/updates/FEDORA-2020-267df5d597

Comment 17 Rick Dicaire 2020-05-05 15:57:58 UTC
(In reply to Xavier Bachelot from comment #10)
> Thanks for testing. I'll make a real build for all supported releases asap.
> 
> And yes, it looks like you may have found another bug, although with way
> less damage potential than the first one. Please file it upstream.

Filed as https://github.com/NagiosEnterprises/nsca/issues/45

Thanks

Comment 18 Fedora Update System 2020-05-06 02:23:28 UTC
FEDORA-2020-267df5d597 has been pushed to the Fedora 32 testing repository.
In short time you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --advisory=FEDORA-2020-267df5d597`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2020-267df5d597

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 19 Fedora Update System 2020-05-06 02:59:01 UTC
FEDORA-2020-5136a26843 has been pushed to the Fedora 31 testing repository.
In short time you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --advisory=FEDORA-2020-5136a26843`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2020-5136a26843

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 20 Fedora Update System 2020-05-06 05:11:12 UTC
FEDORA-EPEL-2020-fc472cc3f4 has been pushed to the Fedora EPEL 8 testing repository.

You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2020-fc472cc3f4

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 21 Fedora Update System 2020-05-06 06:03:16 UTC
FEDORA-2020-be02512922 has been pushed to the Fedora 30 testing repository.
In short time you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --advisory=FEDORA-2020-be02512922`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2020-be02512922

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 22 Fedora Update System 2020-05-06 06:14:45 UTC
FEDORA-EPEL-2020-55ca7ea1da has been pushed to the Fedora EPEL 6 testing repository.

You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2020-55ca7ea1da

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 23 Fedora Update System 2020-05-06 06:16:00 UTC
FEDORA-EPEL-2020-a359910824 has been pushed to the Fedora EPEL 7 testing repository.

You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2020-a359910824

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 24 Fedora Update System 2020-05-14 02:28:39 UTC
FEDORA-2020-5136a26843 has been pushed to the Fedora 31 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 25 Fedora Update System 2020-05-14 02:35:40 UTC
FEDORA-2020-267df5d597 has been pushed to the Fedora 32 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 26 Fedora Update System 2020-05-14 09:52:17 UTC
FEDORA-2020-be02512922 has been pushed to the Fedora 30 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 27 Fedora Update System 2020-05-21 03:40:57 UTC
FEDORA-EPEL-2020-fc472cc3f4 has been pushed to the Fedora EPEL 8 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 28 Fedora Update System 2020-05-21 04:14:43 UTC
FEDORA-EPEL-2020-55ca7ea1da has been pushed to the Fedora EPEL 6 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 29 Fedora Update System 2020-05-21 04:16:14 UTC
FEDORA-EPEL-2020-a359910824 has been pushed to the Fedora EPEL 7 stable repository.
If problem still persists, please make note of it in this bug report.


Note You need to log in before you can comment on or make changes to this bug.