indygreg/collectd-carbon — pull request #13 by TimBaldoni (2011-10-28 19:06:24+00:00)
Title: check type of value to avoid trying to manipulate non-numbers

Skip data normalization if data can't be normalized (non-numbers).

The following are log entries from a server on which an NFSv3 mount (/www) was briefly unavailable resulting in collectd-carbon becoming wedged. With collectd-carbon wedged no data was sent to the carbon server and collectd had to be killed with SIGKILL.

```
Oct 28 01:06:48 HOSTNAME collectd[PID]: statvfs(/www) failed: Permission denied
Oct 28 01:06:48 HOSTNAME collectd[PID]: statvfs(/www) failed: Permission denied
Oct 28 01:06:58 HOSTNAME collectd[PID]: statvfs(/www) failed: Permission denied
Oct 28 01:07:08 HOSTNAME collectd[PID]: statvfs(/www) failed: Permission denied
Oct 28 01:10:53 HOSTNAME collectd[PID]: Unhandled python exception in write callback: TypeError: unsupported operand type(s) for /: 'NoneType' and 'float'
```

Looks like it tried to divide the new_value (None) by the interval (float):
```new_value = new_value / interval```