diff options
Diffstat (limited to 'inc/collectd.inc.php')
-rw-r--r-- | inc/collectd.inc.php | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/inc/collectd.inc.php b/inc/collectd.inc.php index 18f56c8..e5a7df4 100644 --- a/inc/collectd.inc.php +++ b/inc/collectd.inc.php | |||
@@ -204,15 +204,15 @@ function collectd_flush($identifier) { | |||
204 | 204 | ||
205 | $r = fwrite($socket, $cmd, strlen($cmd)); | 205 | $r = fwrite($socket, $cmd, strlen($cmd)); |
206 | if ($r === false || $r != strlen($cmd)) { | 206 | if ($r === false || $r != strlen($cmd)) { |
207 | printf('ERROR: Failed to write full command to unix-socket: %d out of %d written', | 207 | error_log(sprintf('ERROR: Failed to write full command to unix-socket: %d out of %d written', |
208 | $r === false ? -1 : $r, strlen($cmd)); | 208 | $r === false ? -1 : $r, strlen($cmd))); |
209 | return FALSE; | 209 | return FALSE; |
210 | } | 210 | } |
211 | 211 | ||
212 | $resp = fgets($socket); | 212 | $resp = fgets($socket); |
213 | if ($resp === false) { | 213 | if ($resp === false) { |
214 | printf('ERROR: Failed to read response from collectd for command: %s', | 214 | error_log(sprintf('ERROR: Failed to read response from collectd for command: %s', |
215 | trim($cmd)); | 215 | trim($cmd))); |
216 | return FALSE; | 216 | return FALSE; |
217 | } | 217 | } |
218 | 218 | ||
@@ -224,8 +224,8 @@ function collectd_flush($identifier) { | |||
224 | 224 | ||
225 | return TRUE; | 225 | return TRUE; |
226 | } else { | 226 | } else { |
227 | printf('ERROR: Failed to open unix-socket to collectd: %d: %s', | 227 | error_log(sprintf('ERROR: Failed to open unix-socket to collectd: %d: %s', |
228 | $u_errno, $u_errmsg); | 228 | $u_errno, $u_errmsg)); |
229 | return FALSE; | 229 | return FALSE; |
230 | } | 230 | } |
231 | } | 231 | } |