Add possibility to monitor the php-fpm service with the unix agent and (#14173)

not only with SNMP agent

Co-authored-by: Ambroise Rosset <ambroise.rosset@unil.ch>
This commit is contained in:
Ambroise
2022-08-03 15:31:06 +02:00
committed by GitHub
parent b124008614
commit 0f37f68bfd
3 changed files with 13 additions and 3 deletions

View File

@@ -1320,6 +1320,10 @@ The application should be auto-discovered as described at the top of
the page. If it is not, please follow the steps set out under `SNMP
Extend` heading top of page.
### Agent
[Install the agent](Agent-Setup.md) on this device if it isn't already
and copy the `phpfpmsp` script to `/usr/lib/check_mk_agent/local/`
## Pi-hole
### SNMP Extend

View File

@@ -3,9 +3,14 @@
use LibreNMS\RRD\RrdDefinition;
$name = 'php-fpm';
$options = '-Oqv';
$oid = '.1.3.6.1.4.1.8072.1.3.2.3.1.2.8.112.104.112.102.112.109.115.112';
$phpfpm = snmp_walk($device, $oid, $options);
if (! empty($agent_data['app'][$name])) {
$phpfpm = $agent_data['app'][$name];
} else {
$options = '-Oqv';
$oid = '.1.3.6.1.4.1.8072.1.3.2.3.1.2.8.112.104.112.102.112.109.115.112';
$phpfpm = snmp_walk($device, $oid, $options);
}
[$pool,$start_time,$start_since,$accepted_conn,$listen_queue,$max_listen_queue,$listen_queue_len,$idle_processes,
$active_processes,$total_processes,$max_active_processes,$max_children_reached,$slow_requests] = explode("\n", $phpfpm);

View File

@@ -55,6 +55,7 @@ if ($device['os_group'] == 'unix' || $device['os'] == 'windows') {
'ceph',
'mysql',
'nginx',
'php-fpm',
'powerdns',
'powerdns-recursor',
'proxmox',