1
0
Fork 0
mirror of https://github.com/munin-monitoring/contrib.git synced 2025-07-21 10:39:53 +00:00
Munin-Contrib/plugins/php/php_opcache.php
Lars Kruse 17f784270a Whitespace cleanup
* remove trailing whitespace
* remove empty lines at the end of files
2018-08-02 02:33:25 +02:00

29 lines
615 B
PHP
Executable file

<?php
/**
* Part of Munin PHP OPcache plugin - Refer to php_opcache for installation instructions.
*/
if (function_exists('opcache_get_status'))
{
$data = opcache_get_status(false);
$output = array(
'mem_used.value' => $data['memory_usage']['used_memory'],
'mem_free.value' => $data['memory_usage']['free_memory'],
'mem_wasted.value' => $data['memory_usage']['wasted_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";
}
?>