check_phpfpm_status icon indicating copy to clipboard operation
check_phpfpm_status copied to clipboard

Feature Request: Being able to connect to a socket file

Open noudAndi opened this issue 7 years ago • 6 comments

Hi, it would be great to be able to connect to a socket file, e.g. /var/lib/php7.0-fpm/www.sock.

Do you think it is possible to implement this?

I'm no Perl Pro, but I did some ugly hacking, which is only a Proof of Concept, but it would work in general.

#    my $sock = IO::Socket::INET->new(
#        PeerAddr => $override_ip,
#        PeerPort => $o_port,
#    );
use IO::Socket::UNIX;
my $sock = IO::Socket::UNIX->new(
    Type => SOCK_STREAM,
    Peer => '/var/lib/php7.0-fpm/web3.sock',
);

noudAndi avatar Mar 23 '17 10:03 noudAndi

Yes, that would quite certainly work. Is it Ok on your side? I mean using the FCGI::Client on this sock works?

Full feature would need an option to pass the socket path.

regilero avatar Apr 11 '17 10:04 regilero

Hi @regilero :

Thanks for replying. I've seen that @gvogets has already implemented this in a fork. Maybe you want to merge it back into your project.

https://github.com/gvogets/check_phpfpm_status/commit/a2831167c3397ba0deef90ad6f8f2ede62127f28

noudAndi avatar Apr 11 '17 15:04 noudAndi

thanks for the research. I'll have a look.

regilero avatar Apr 14 '17 07:04 regilero

I implemented the very same functionality as @gvogets and wanted to post it here when I found this issue.

Please merge this feature into your plugin!

siklosipeter avatar May 16 '18 09:05 siklosipeter

I implemented something similiar before I saw this issue here. The version from @gvogets works like a charm. Plesae merge into into your plugin.

kosli avatar May 21 '18 14:05 kosli

damnit :open_mouth: now about 3 people added support for UNIX sockets.. I saw this issue here too late and did that too. @regilero you could simply merge my PR #22

magenbrot avatar May 24 '19 14:05 magenbrot