NRDP change source port

An open discussion forum for obtaining help with Nagios Core. Nagios Core users of all experience levels are welcome here. Subforum have been created for the discussion of Nagios Core and Nagios Plugin development.

NOTE: The SourceForge.net mailing lists have been deprecated in favor of this forum in order to expedite support and provide additional features not available on the old mailing list.

NRDP change source port

Postby mstrasser » Tue Mar 13, 2018 10:12 am

Hello,

i want to change the source port of nrdp to a static value.
Is it possible to do so ?

For now it looks like, it uses some random highports !
I use Linux/Debian.

br,
Marcus
mstrasser
 
Posts: 3
Joined: Tue Mar 13, 2018 9:12 am

Re: NRDP change source port

Postby tmcdonald » Tue Mar 13, 2018 10:27 am

The term for what you are looking for is "bind() before connect()": https://idea.popcount.org/2014-04-03-bi ... e-connect/

Unfortunately this would require modification of the send_nrdp scripts. If you can come up with a good use case our developers might consider adding in a flag to set this, but I can't think of anything short of getting around restrictive firewall rules, and the solution to that is generally to speak with your network admin.
Former Nagios employee
tmcdonald
 
Posts: 9118
Joined: Mon Sep 23, 2013 8:40 am

Re: NRDP change source port

Postby mstrasser » Tue Mar 13, 2018 11:04 am

In our new system we need to specify the exact ports, or a small port-range, a programm is using.
Goes for sourceports and destinationports.

As example with nrpe only 1 specific port is required.
mstrasser
 
Posts: 3
Joined: Tue Mar 13, 2018 9:12 am

Re: NRDP change source port

Postby tmcdonald » Tue Mar 13, 2018 12:50 pm

So aside from editing the source code of the send_nrdp script (which you are of course welcome to do if you are comfortable with it) there was a quick little hack I found to temporarily restrict the outgoing ports, send the data, then open them up again:

https://superuser.com/questions/1118735 ... 52#1118752

This is probably not ideal, as restricting the number of outgoing (ephemeral) ports too much can cause instability.

I can ask our developers if this is a flag they would be willing to consider adding, but this is a pretty niche request and not one we have had before (to my knowledge).
Former Nagios employee
tmcdonald
 
Posts: 9118
Joined: Mon Sep 23, 2013 8:40 am

Re: NRDP change source port

Postby mstrasser » Wed Mar 14, 2018 1:53 am

Thank you!
I will try your solution and look if it runs stable.
mstrasser
 
Posts: 3
Joined: Tue Mar 13, 2018 9:12 am

Re: NRDP change source port

Postby scottwilkerson » Wed Mar 14, 2018 11:53 am

Let us know if you have further issues
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
User avatar
scottwilkerson
DevOps Engineer
 
Posts: 12594
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises


Return to Nagios Core

Who is online

Users browsing this forum: No registered users and 12 guests