regilero / check_phpfpm_status

Nagios check for php-fpm status report
GNU General Public License v3.0
39 stars 19 forks source link

Feature Request: Being able to connect to a socket file #19

Open noudAndi opened 7 years ago

noudAndi commented 7 years ago

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',
);
regilero commented 7 years ago

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.

noudAndi commented 7 years ago

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

regilero commented 7 years ago

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

siklosipeter commented 6 years ago

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!

kosli commented 6 years ago

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

magenbrot commented 5 years ago

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