Merge pull request #1463 from clinta/collectd-flush

Collectd flush
This commit is contained in:
Neil Lathwood
2015-07-16 17:21:14 +01:00
3 changed files with 5 additions and 26 deletions
+5
View File
@@ -304,6 +304,11 @@ $config['collectd_dir'] = '/var/lib/collectd/rrd';
```
Specify the location of the collectd rrd files.
```php
$config['collectd_sock'] = 'unix:///var/run/collectd.sock';
```
Specify the location of the collectd unix socket. Using a socket allows the collectd graphs to be flushed to disk before being drawn. Be sure that your web server has permissions to write to this socket.
```php
$config['smokeping']['dir'] = "/var/lib/smokeping/";
```
-6
View File
@@ -86,12 +86,6 @@ $config['rrd_colors'] = array(
'h_13' => 'BBBBBB',
'f_13' => '555555',
);
/*
* URL to collectd's unix socket (unixsock plugin)
* enabled: 'unix:///var/run/collectd/collectd-unixsock'
* disabled: null
*/
$config['collectd_sock'] = null;
/*
* Path to TTF font file to use in error images
* (fallback when file does not exist is GD fixed font)
-20
View File
@@ -330,26 +330,6 @@ function collectd_flush($identifier) {
return false;
}
if (is_null($host) || !is_string($host) || strlen($host) == 0) {
return false;
}
if (is_null($plugin) || !is_string($plugin) || strlen($plugin) == 0) {
return false;
}
if (is_null($pinst) || !is_string($pinst)) {
return false;
}
if (is_null($type) || !is_string($type) || strlen($type) == 0) {
return false;
}
if (is_null($tinst) || (is_array($tinst) && count($tinst) == 0) || !(is_string($tinst) || is_array($tinst))) {
return false;
}
$u_errno = 0;
$u_errmsg = '';
if ($socket = @fsockopen($config['collectd_sock'], 0, $u_errno, $u_errmsg)) {