From 721455a0d7b9e452c2b6b4d634102f2bf1fb37fd Mon Sep 17 00:00:00 2001 From: Clint Armstrong Date: Thu, 16 Jul 2015 11:10:32 -0400 Subject: [PATCH 1/3] don't override the socket option --- html/includes/collectd/config.php | 6 ------ 1 file changed, 6 deletions(-) diff --git a/html/includes/collectd/config.php b/html/includes/collectd/config.php index 812c5857a..ec1326a2e 100644 --- a/html/includes/collectd/config.php +++ b/html/includes/collectd/config.php @@ -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) From 3edce4d7e15bcadc630e4463d1feeac1b0c0667f Mon Sep 17 00:00:00 2001 From: Clint Armstrong Date: Thu, 16 Jul 2015 11:11:11 -0400 Subject: [PATCH 2/3] remove checks for options that socket does not use --- html/includes/collectd/functions.php | 20 -------------------- 1 file changed, 20 deletions(-) diff --git a/html/includes/collectd/functions.php b/html/includes/collectd/functions.php index b004f832d..e0cad177b 100644 --- a/html/includes/collectd/functions.php +++ b/html/includes/collectd/functions.php @@ -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)) { From 6e74c9da45248780f29a29e91bcc9e4981a0047d Mon Sep 17 00:00:00 2001 From: Clint Armstrong Date: Thu, 16 Jul 2015 11:14:02 -0400 Subject: [PATCH 3/3] document the option --- doc/Support/Configuration.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/doc/Support/Configuration.md b/doc/Support/Configuration.md index aa29e5c52..e2288aef2 100644 --- a/doc/Support/Configuration.md +++ b/doc/Support/Configuration.md @@ -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/"; ```