1
0
Fork 0
mirror of https://github.com/munin-monitoring/contrib.git synced 2025-07-21 10:39:53 +00:00

Add PHP OPcache plugin

This commit is contained in:
Daniel Lo Nigro 2013-06-24 22:11:49 +10:00
parent 279697003a
commit cde616b8d0
2 changed files with 86 additions and 0 deletions

View file

@ -0,0 +1,28 @@
<?php
/**
* Part of Munin PHP OPcache plugin - Refer to php_opcache for installation instructions.
*/
if (function_exists('opcache_get_status'))
{
$data = opcache_get_status();
$output = array(
'mem_used.value' => $data['memory_usage']['used_memory'],
'mem_free.value' => $data['memory_usage']['free_memory'],
);
}
else
{
// OPCache not installed :(
$output = array(
'mem_used.value' => 0,
'mem_free.value' => 0,
);
}
header('Content-Type: text/plain');
foreach ($output as $key => $value)
{
echo $key, ' ', $value, "\n";
}
?>