[pve-devel] [PATCH manager] fix #1683: do not send non-numeric values to graphite

Dominik Csapak d.csapak at proxmox.com
Thu Mar 1 16:44:45 CET 2018


the graphite daemons which accept the data (carbon), only
accepts numeric values, and logs all invalid lines

since that were about 5 values per vm/ct this generated lot of noise
in the carbon log

Signed-off-by: Dominik Csapak <d.csapak at proxmox.com>
---
 PVE/Status/Graphite.pm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/PVE/Status/Graphite.pm b/PVE/Status/Graphite.pm
index 849930f0..636b9566 100644
--- a/PVE/Status/Graphite.pm
+++ b/PVE/Status/Graphite.pm
@@ -93,7 +93,7 @@ sub write_graphite {
         if ( defined $value ) {
             if ( ref $value eq 'HASH' ) {
                 write_graphite($carbon_socket, $value, $ctime, $path);
-            }else {
+            } elsif ($value =~ m/^[+-]?(?:[0-9]*\.)?[0-9]+$/){
                 $carbon_socket->send( "$path $value $ctime\n" );
             }
         }
-- 
2.11.0





More information about the pve-devel mailing list