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

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