mirror of
https://github.com/munin-monitoring/contrib.git
synced 2018-11-08 00:59:34 +01:00
29 lines
547 B
PHP
29 lines
547 B
PHP
<?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";
|
|
}
|
|
?>
|