Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added support for connecting to an UNIX socket #22

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

magenbrot
Copy link
Contributor

Hi @regilero!

Here's a merge request that adds support for UNIX sockets.
Notes: when --unixsocket is used, -f --fastcgi is implied

root@nginx1-ha1:/usr/lib/nagios/plugins# ./check_phpfpm_status.pl -H 127.0.0.1 --fastcgi --unixsocket /run/php/php7.1-fpm.sock -u /fpm-status -w 1,1,1 -c 0,2,2
PHP-FPM OK - www, 0.051 sec. response time, Busy/Idle 1/149, (max: 1, reached: 0), ReqPerSec 0.0, Queue 0 (len: 0, reached: 0)|Idle=149 Busy=1 MaxProcesses=1 MaxProcessesReach=0 Queue=0 MaxQueueReach=0 QueueLen=0 ReqPerSec=0.000000

@regilero
Copy link
Owner

regilero commented Jun 7, 2019

Hello, I'll need to test that, but at first impression it seems good. Thanks. Hope I can take some time soon to review it more deeply.

@@ -107,6 +108,8 @@ sub help {
ServerName, (host header of HTTP request) use it if you specified an IP in -H to match the good Virtualhost in your target
-f, --fastcgi
Connect directly to php-fpm via network or local socket, using fastcgi protocol instead of HTTP.
-u, --unixsocket
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The -u option is already used as a shortcut for --url. My perl is a bit rusty, but it looks like there is no short form for the --unixsocket option at all?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thx, you are right. The problem is that the most useful short forms are already in use (-u -U -s -S). I'm considering to give --unixsocket no short form (like --verifyssl). Someone else having an idea? :)

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Personally, I am happy with the long form - it's an icinga plugin, so not something we need to type regularly :)

check_phpfpm_status.pl Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants