• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

NGINX: Problems with netstat display

P_heck

Basic Pleskian
Hello,

OS Debian 7.8
Plesk version 12.0.18 Update #62

Changed from Apache to NGINX and everything works fine - only problem I have is with the monitoring with OMD/check_mk using the nginx_status plugin:

The plugin states a "netstat -tlnp" (line 35) and then looks for a process called "nginx" (definition in line 45).

After I have changed nginx related entries in the Plesk panel, nginx will be automatically restarted by Plesk and the output from netstat now shows:

"1511/nginx: worker"

So the plugin returns an empty value (as it expects nginx without the colon) causing a warning in the OMD console.

After restarting NGINX on the commandline (service nginx restart), the netstat output now reads:

"5368/nginx"

which is then ok for the monitoring!

Looks for me, that the restart initiated by the panel is causing this different behavior.

Anyone any idea how to avoid nginx starting with the ":_ worker" parameter?

Ciao Peter
 
Why you do not use Plesk watchdog instead of this nginx plugin?
And actually it is not Plesk related issue. Plesk calls reload only, but name of process sets nginx.
I'd suggest you modify plugin so it did readlink /proc/PID/exe and compares it with /usr/sbin/nginx:

[root@ppu12-0 ~]# netstat -tlnp | grep nginx
tcp 0 0 10.58.103.102:443 0.0.0.0:* LISTEN 3399/nginx
tcp 0 0 10.58.103.102:80 0.0.0.0:* LISTEN 3399/nginx

[root@ppu12-0 ~]# readlink /proc/3399/exe
/usr/sbin/nginx
 
Hello Igor,

thanks for the response! Will have a look at Plesk Watchdog.
Will see what I can do with NGINX support. Anyway, a bugfix of the script has already been propagated as a suggestion to GitHub following a bug report I issued there:

41 - pid, proc = parts[6].split('/')
41 + pid, proc = parts[6].lstrip(":").split('/')

Ciao Peter
 
Back
Top