github.com/mackerelio/mackerel-agent-plugins@v0.89.3/mackerel-plugin-php-opcache/README.md (about)

     1  # mackerel-plugin-php-opcache
     2  
     3  Get PHP OPcache metrics for Mackerel and Sensu.
     4  
     5  ## Usage (for Apache)
     6  
     7  ### Build this program
     8  
     9  Next, build this program.
    10  
    11  ```
    12  go get github.com/mackerelio/mackerel-agent-plugins/mackerel-plugin-php-opcache
    13  cd $GO_HOME/src/github.com/mackerelio/mackerel-agent-plugins/mackerel-plugin-php-opcache
    14  go test
    15  go build
    16  cp -a mackerel-plugin-php-opcache /usr/local/bin/
    17  mkdir DOCUMENT_ROOT/mackerel/
    18  cp -a php-opcache.php DOCUMENT_ROOT/mackerel/
    19  ```
    20  
    21  ### Set up your apache server
    22  
    23  You should enable to execute PHP program (e.g. mod_php).
    24  
    25  ### Add apache config
    26  
    27  Edit your apache config file to access metric from localhost only. For example is below.
    28  
    29  ```
    30  <Directory "HTTP_HOME/mackerel/">
    31      Order deny,allow
    32      Deny from all
    33      Allow from 127.0.0.1 ::1
    34  </Directory>
    35  ```
    36   
    37  And, reload apache configuration.
    38  
    39  ```
    40  sudo service httpd configtest
    41  sudo service httpd reload
    42  ```
    43  
    44  ### Execute this plugin
    45  
    46  And, you can execute this program :-)
    47  
    48  ```
    49  ./mackerel-plugin-php-opcache
    50  ```
    51  
    52  ### Add mackerel-agent.conf
    53  
    54  Finally, if you want to get php-opcache metrics via Mackerel, please edit mackerel-agent.conf. For example is below.
    55  
    56  ```
    57  [plugin.metrics.php-opcache]
    58  command = "/path/to/mackerel-plugin-php-opcache"
    59  type = "metric"
    60  ```
    61  
    62  ## For more information
    63  
    64  Please execute 'mackerel-plugin-php-opcache -h' and you can get command line options.
    65  
    66  ## Author
    67  
    68  [Yuichiro Mukai](https://github.com/yucchiy)