PHP-FPM SNMP Extension not working

Hello,

I’m trying to understand why the PHP-FPM Extension is not working.

I followed the instructions on https://docs.librenms.org/#Extensions/Applications/#php-fpm but I do not have any information from php-fpm.

I have information from php-fpm if I do the following:

  • run the script in the php-fpm machine
  • curl http://127.0.0.1/status?full on the php-fpm machine
  • run snmpget from the poller machine to the php-fpm machine

But after running the discovery and polling the machine I do not have any information from snmp.

The distro snmp extension works fine, and on this machine I also have the mariadb server, nginx and memcached, and I can get information from all of them using the check_mk_agent.

What else do I need to check for the PHP-FPM work? Do I need to change something manually in the database? To get memcached working I needed to set the app_instance manually on the database.

Solved the problem.

It was related to the file the generates the graphs.

/opt/librenms/html/includes/graphs/application/php-fpm_stats.inc.php

The code that looked for the file was using the function is_file, which looks for a file locally, instead of talking with the RRDCached server.

Changing is_file to rrdtool_check_rrd_exists, which is the function used on the other graph scripts, solves the problem.

if (rrdtool_check_rrd_exists($rrd_filename)) {
    foreach ($array as $ds => $var) {
        $rrd_list[$i]['filename'] = $rrd_filename;
        $rrd_list[$i]['descr']    = $var['descr'];
        $rrd_list[$i]['ds']       = $ds;
        $rrd_list[$i]['colour']   = $var['colour'];
        $i++;
    }
} else {
    echo "file missing: $rrd_filename";
}

The same thing was happening for Squid, I’ve changed the graph scripts for php-fpm and squid and made a pull request: https://github.com/librenms/librenms/pull/8152