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:
parent
279697003a
commit
cde616b8d0
2 changed files with 86 additions and 0 deletions
28
plugins/php/php_opcache.php
Normal file
28
plugins/php/php_opcache.php
Normal 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";
|
||||
}
|
||||
?>
|
Loading…
Add table
Add a link
Reference in a new issue