Hi,
I'm encountering the same issue as #835 .
We have telegraf 1.0.1 gathering php5-fpm metrics, using sockets.
We're on Debian wheezy. The php5-fpm sockets are owned by www-data, telegraf is a member of the www-data group.
Here is the config file were using :
[[inputs.phpfpm]]
urls = ["/var/run/xxxxxxx.sock"]
In the log file we have :
ERROR in input [phpfpm]: Unable parse phpfpm status. Error: Primary script unknown
<nil>
Do you guys have an idea on what's wrong ?
did you try the workaround that was mentioned in #835?
Goodness I figured this out. This was on me, but maybe I'll make a PR for the docs.
I didn't have the FPM status running on php7.0, only on php5.6. If you run into this error, go to your php's pool.d/www.conf and make sure pm.status_path = /status is uncommented
@sparrc : Thanks for your answer.
We're only using php5-fpm. All the status path are correctly declared in the php5-fpm.conf file.
try seeing if you can narrow the problem down, I'd recommend testing telegraf with different user privileges and see what happens:
run as root:
sudo telegraf --config /etc/telegraf/telegraf.conf --input-filter phpfpm --test
run as telegraf:
sudo -u telegraf telegraf --config /etc/telegraf/telegraf.conf --input-filter phpfpm --test
Hello,
It seems that my config file is not xell formated :
sudo telegraf --config telegraf.conf --input-filter phpfpm --test
2016/11/08 10:33:54 Error: no inputs found, did you provide a valid config file?
My configuration file seems to be good :
[[inputs.phpfpm]]
urls = ["/var/run/xxxxxxx.sock"]
I've just retried on another machine and the error message is the same.
What can I do now to give you more informations regarding this issue ?
something is wrong with the config file, can you try regenerating it using telegraf --sample-config?
The configuration file is deployed by ansible. I don't have any problems with it on any machine using this configuration file.
The machine where the phpfpm plugin is declared are sending metrics correctly except phpfpm.
The error "Error: no inputs found, did you provide a valid config file?" is displayed only when using the "--test " statement.
if the config file has the phpfpm input defined then I don't think it's possible to get this error.....can you please provide your full config file?
Here is the telegraf.conf :
# Telegraf configuration
[tags]
# Configuration for telegraf agent
[agent]
interval = "10s"
debug = false
hostname = "xxxxxxxxxxxxxxxx"
round_interval = true
flush_interval = "10s"
flush_jitter = "0s"
###############################################################################
# OUTPUTS #
###############################################################################
[[outputs.influxdb]]
urls = ["http://xxxxxxxxx:8086"]
database = "telegraf"
precision = "s"
###############################################################################
# INPUTS #
###############################################################################
[[inputs.cpu]]
percpu = true
[[inputs.disk]]
[[inputs.io]]
[[inputs.mem]]
[[inputs.net]]
[[inputs.system]]
[[inputs.swap]]
[[inputs.netstat]]
Here is the phpfpm.conf (inside telegraf.d):
[[inputs.phpfpm]]
urls = ["/var/run/php5-fpm-xxxxxxxx.sock"]
@adeleglise put inputs.phpfpm into telegraf.conf and then please run the test output again with different user permissions. Please then submit all commands run and the output of all of those commands.
I've added the phpfpm input in the main telegraf.conf file:
sudo telegraf --config telegraf.conf --input-filter phpfpm --test
* Plugin: phpfpm, Collection 1
2016/11/09 16:20:34 Unable parse phpfpm status. Error: Primary script unknown
<nil>
can you run ls -ls /var/run/php5-fpm-xxxxxxxx.sock?
Also are you able to directly connect to the socket outside of telegraf? I found some debugging and connection tips here: https://www.thatsgeeky.com/2012/02/directly-connecting-to-php-fpm/
As I told when I opened this issue, all the sockets are owned by www-data and telegraf is a member of the www-data group.
ls -al /var/run/php5-fpm-xxxxxxxx.sock
srw-rw---- 1 www-data www-data 0 nov. 8 XX:XX /var/run/php5-fpm-xxxxxxxx.sock
Thanks for the link , but the cgi-fcgi tool is not installed on the machine and I can't install it. :\
OK, sorry @adeleglise but I'm going to have to close the issue. If you can't provide steps to reproduce or more debugging information than I'm afraid there's that we can do from a telegraf development perspective.
All that I can tell is that you will need to modify & test with different phpfpm settings, if you find a solution please follow-up here or post a PR for the README.
Did you actually enabled status_path in phpfpm config?
For example:
pm.status_path = /status
You have to tell telegraf where to find the status page.
urls = ["/run/php-fpm/example.org.sock:fpm-status"]
Most helpful comment
Did you actually enabled status_path in phpfpm config?
For example:
pm.status_path = /status