Skip to content

Instantly share code, notes, and snippets.

@alq666
Created January 29, 2013 04:23
Show Gist options
  • Save alq666/4661780 to your computer and use it in GitHub Desktop.
Save alq666/4661780 to your computer and use it in GitHub Desktop.
To fix a locale issue
diff --git a/checks/system/unix.py b/checks/system/unix.py
index 5ebc6b2..8be6c5c 100644
--- a/checks/system/unix.py
+++ b/checks/system/unix.py
@@ -626,7 +626,7 @@ class Cpu(Check):
def get_value(legend, data, name):
"Using the legend and a metric name, get the value or None from the data line"
if name in legend:
- return float(data[legend.index(name)])
+ return float(data[legend.index(name)].replace(",", "."))
else:
# FIXME return a float or False, would trigger type error if not python
self.logger.debug("Cannot extract cpu value %s from %s (%s)" % (name, data, legend))
@alq666
Copy link
Author

alq666 commented Jan 29, 2013

To apply this patch:

# get the file into your home directory
cd /usr/share/datadog/agent
sudo  patch -p1 < ~/unix.py.diff
sudo service datadog-agent restart

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment