etsy/nagios_tools — pull request #8 by ericedge (2014-10-19 18:43:03+00:00)
Title: don't skip 0.0 values and don't eval()

Similar to @whilp's #5, but hewing closer to the original
if-else logic instead of a -1 array index.

Details:

Previously we were testing boolean status of eval'd
values retrieved from graphite, which has two
potential problems:

1) eval() is potentially dangerous; if someone is able
to coax the graphite webserver into returning
code strings, they'll be happily executed.

2) By checking strictly for boolean truthiness, we end
up skipping all zero values; this is less an issue
when seconds <= sample_period, but can drastically
skew the averaging logic.

This should fix, and seems to stick to the original intent
given the comments preceding the if seconds <= sample_period
block.