Discussion:
[Nagios-users] NSClient++ - System holding port 5666 open, cannot rebind to it
Hari Sekhon
2007-12-07 16:53:02 UTC
Permalink
Hi,

I've been playing with my expanding my nsclient++ setups and
deployments today and as such have been restarted nsclient++ lots. The
problem is that now when I restart it, I cannot get any response on nrpe
calls to the default port 5666 despite the port being open.

The problem is seems is that there is some phantom remnant holding that
port open and preventing the new instance of nsclient++ from binding to it.

Netstat shows:
TCP x.x.x.x:5666 y.y.y.y:35719 CLOSE_WAIT 2616
[System]

TCP x.x.x.x:5666 y.y.y.y:60362 CLOSE_WAIT 2616
[System]

TCP x.x.x.x:5666 y.y.y.y:35750 CLOSE_WAIT 2616
[System]

TCP x.x.x.x:5666 y.y.y.y:35738 CLOSE_WAIT 2616
[System]

TCP x.x.x.x:5666 y.y.y.y:51457 CLOSE_WAIT 2616
[System]

TCP x.x.x.x:5666 y.y.y.y:35742 CLOSE_WAIT 2616
[System]

TCP x.x.x.x:5666 y.y.y.y:51459 CLOSE_WAIT 2616
[System]

TCP x.x.x.x:5666 y.y.y.y:35745 CLOSE_WAIT 2616
[System]

TCP x.x.x.x:5666 y.y.y.y:35748 CLOSE_WAIT 2616
[System]


where x.x.x.x is obviously the server ip address and y.y.y.y is my
workstation ip address that I am testing it from.


TcpView shows:

<non-existent>:2616 TCP servername:5666 servername:0
LISTENING


There are definitely no processes with Pids 616 or 2616.

Any ideas on how to solve this short of a reboot?

-h
--
Hari Sekhon
Hari Sekhon
2007-12-07 17:03:41 UTC
Permalink
Post by Hari Sekhon
Hi,
I've been playing with my expanding my nsclient++ setups and
deployments today and as such have been restarted nsclient++ lots. The
problem is that now when I restart it, I cannot get any response on
nrpe calls to the default port 5666 despite the port being open.
The problem is seems is that there is some phantom remnant holding
that port open and preventing the new instance of nsclient++ from
binding to it.
TCP x.x.x.x:5666 y.y.y.y:35719 CLOSE_WAIT 2616
[System]
TCP x.x.x.x:5666 y.y.y.y:60362 CLOSE_WAIT 2616
[System]
TCP x.x.x.x:5666 y.y.y.y:35750 CLOSE_WAIT 2616
[System]
TCP x.x.x.x:5666 y.y.y.y:35738 CLOSE_WAIT 2616
[System]
TCP x.x.x.x:5666 y.y.y.y:51457 CLOSE_WAIT 2616
[System]
TCP x.x.x.x:5666 y.y.y.y:35742 CLOSE_WAIT 2616
[System]
TCP x.x.x.x:5666 y.y.y.y:51459 CLOSE_WAIT 2616
[System]
TCP x.x.x.x:5666 y.y.y.y:35745 CLOSE_WAIT 2616
[System]
TCP x.x.x.x:5666 y.y.y.y:35748 CLOSE_WAIT 2616
[System]
where x.x.x.x is obviously the server ip address and y.y.y.y is my
workstation ip address that I am testing it from.
<non-existent>:2616 TCP servername:5666
servername:0 LISTENING
There are definitely no processes with Pids 616 or 2616.
Any ideas on how to solve this short of a reboot?
-h
Solved it. Sometimes it just helps to talk about it to figure it out!

Turns out there was a process that was for some reason stuck and this
caused the previous incarnation to never truly die, System that sly
process kept it open but the actual process could not be found.

This actually happened because I'm fiddling around with writing another
event handler to be called through NSClient++ and it's this event
handler than has caused the problem by the look of it by not fully closing.

-h
--
Hari Sekhon
Loading...