github.com/netdata/go.d.plugin@v0.58.1/modules/phpdaemon/metadata.yaml (about) 1 plugin_name: go.d.plugin 2 modules: 3 - meta: 4 id: collector-go.d.plugin-phpdaemon 5 plugin_name: go.d.plugin 6 module_name: phpdaemon 7 monitored_instance: 8 name: phpDaemon 9 link: https://github.com/kakserpom/phpdaemon 10 icon_filename: php.svg 11 categories: 12 - data-collection.apm 13 keywords: 14 - phpdaemon 15 - php 16 related_resources: 17 integrations: 18 list: [] 19 info_provided_to_referring_integrations: 20 description: "" 21 most_popular: false 22 overview: 23 data_collection: 24 metrics_description: | 25 This collector monitors phpDaemon instances. 26 method_description: "" 27 supported_platforms: 28 include: [] 29 exclude: [] 30 multi_instance: true 31 additional_permissions: 32 description: "" 33 default_behavior: 34 auto_detection: 35 description: "" 36 limits: 37 description: "" 38 performance_impact: 39 description: "" 40 setup: 41 prerequisites: 42 list: 43 - title: Enable phpDaemon's HTTP server 44 description: | 45 Statistics expected to be in JSON format. 46 47 <details> 48 <summary>phpDaemon configuration</summary> 49 50 Instruction from [@METAJIJI](https://github.com/METAJIJI). 51 52 To enable `phpd` statistics on http, you must enable the http server and write an application. 53 Application is important, because standalone application [ServerStatus.php](https://github.com/kakserpom/phpdaemon/blob/master/PHPDaemon/Applications/ServerStatus.php) provides statistics in html format and unusable for `netdata`. 54 55 ```php 56 // /opt/phpdaemon/conf/phpd.conf 57 58 path /opt/phpdaemon/conf/AppResolver.php; 59 Pool:HTTPServer { 60 privileged; 61 listen '127.0.0.1'; 62 port 8509; 63 } 64 ``` 65 66 ```php 67 // /opt/phpdaemon/conf/AppResolver.php 68 69 <?php 70 71 class MyAppResolver extends \PHPDaemon\Core\AppResolver { 72 public function getRequestRoute($req, $upstream) { 73 if (preg_match('~^/(ServerStatus|FullStatus)/~', $req->attrs->server['DOCUMENT_URI'], $m)) { 74 return $m[1]; 75 } 76 } 77 } 78 79 return new MyAppResolver; 80 ``` 81 82 ```php 83 /opt/phpdaemon/conf/PHPDaemon/Applications/FullStatus.php 84 85 <?php 86 namespace PHPDaemon\Applications; 87 88 class FullStatus extends \PHPDaemon\Core\AppInstance { 89 public function beginRequest($req, $upstream) { 90 return new FullStatusRequest($this, $upstream, $req); 91 } 92 } 93 ``` 94 95 ```php 96 // /opt/phpdaemon/conf/PHPDaemon/Applications/FullStatusRequest.php 97 98 <?php 99 namespace PHPDaemon\Applications; 100 101 use PHPDaemon\Core\Daemon; 102 use PHPDaemon\HTTPRequest\Generic; 103 104 class FullStatusRequest extends Generic { 105 public function run() { 106 $stime = microtime(true); 107 $this->header('Content-Type: application/javascript; charset=utf-8'); 108 109 $stat = Daemon::getStateOfWorkers(); 110 $stat['uptime'] = time() - Daemon::$startTime; 111 echo json_encode($stat); 112 } 113 } 114 ``` 115 116 </details> 117 configuration: 118 file: 119 name: go.d/phpdaemon.conf 120 options: 121 description: | 122 The following options can be defined globally: update_every, autodetection_retry. 123 folding: 124 title: Config options 125 enabled: true 126 list: 127 - name: update_every 128 description: Data collection frequency. 129 default_value: 1 130 required: false 131 - name: autodetection_retry 132 description: Recheck interval in seconds. Zero means no recheck will be scheduled. 133 default_value: 0 134 required: false 135 - name: url 136 description: Server URL. 137 default_value: http://127.0.0.1:8509/FullStatus 138 required: true 139 - name: timeout 140 description: HTTP request timeout. 141 default_value: 2 142 required: false 143 - name: username 144 description: Username for basic HTTP authentication. 145 default_value: "" 146 required: false 147 - name: password 148 description: Password for basic HTTP authentication. 149 default_value: "" 150 required: false 151 - name: proxy_url 152 description: Proxy URL. 153 default_value: "" 154 required: false 155 - name: proxy_username 156 description: Username for proxy basic HTTP authentication. 157 default_value: "" 158 required: false 159 - name: proxy_password 160 description: Password for proxy basic HTTP authentication. 161 default_value: "" 162 required: false 163 - name: method 164 description: HTTP request method. 165 default_value: GET 166 required: false 167 - name: body 168 description: HTTP request body. 169 default_value: "" 170 required: false 171 - name: headers 172 description: HTTP request headers. 173 default_value: "" 174 required: false 175 - name: not_follow_redirects 176 description: Redirect handling policy. Controls whether the client follows redirects. 177 default_value: false 178 required: false 179 - name: tls_skip_verify 180 description: Server certificate chain and hostname validation policy. Controls whether the client performs this check. 181 default_value: false 182 required: false 183 - name: tls_ca 184 description: Certification authority that the client uses when verifying the server's certificates. 185 default_value: "" 186 required: false 187 - name: tls_cert 188 description: Client TLS certificate. 189 default_value: "" 190 required: false 191 - name: tls_key 192 description: Client TLS key. 193 default_value: "" 194 required: false 195 examples: 196 folding: 197 title: Config 198 enabled: true 199 list: 200 - name: Basic 201 description: A basic example configuration. 202 config: | 203 jobs: 204 - name: local 205 url: http://127.0.0.1:8509/FullStatus 206 - name: HTTP authentication 207 description: HTTP authentication. 208 config: | 209 jobs: 210 - name: local 211 url: http://127.0.0.1:8509/FullStatus 212 username: username 213 password: password 214 - name: HTTPS with self-signed certificate 215 description: HTTPS with self-signed certificate. 216 config: | 217 jobs: 218 - name: local 219 url: http://127.0.0.1:8509/FullStatus 220 tls_skip_verify: yes 221 - name: Multi-instance 222 description: | 223 > **Note**: When you define multiple jobs, their names must be unique. 224 225 Collecting metrics from local and remote instances. 226 config: | 227 jobs: 228 - name: local 229 url: http://127.0.0.1:8509/FullStatus 230 231 - name: remote 232 url: http://192.0.2.1:8509/FullStatus 233 troubleshooting: 234 problems: 235 list: [] 236 alerts: [] 237 metrics: 238 folding: 239 title: Metrics 240 enabled: false 241 description: "" 242 availability: [] 243 scopes: 244 - name: global 245 description: These metrics refer to the entire monitored application. 246 labels: [] 247 metrics: 248 - name: phpdaemon.workers 249 description: Workers 250 unit: workers 251 chart_type: line 252 dimensions: 253 - name: alive 254 - name: shutdown 255 - name: phpdaemon.alive_workers 256 description: Alive Workers State 257 unit: workers 258 chart_type: line 259 dimensions: 260 - name: idle 261 - name: busy 262 - name: reloading 263 - name: phpdaemon.idle_workers 264 description: Idle Workers State 265 unit: workers 266 chart_type: line 267 dimensions: 268 - name: preinit 269 - name: init 270 - name: initialized 271 - name: phpdaemon.uptime 272 description: Uptime 273 unit: seconds 274 chart_type: line 275 dimensions: 276 - name: time