From: Florian Forster Date: Mon, 5 Jul 2010 07:45:19 +0000 (+0200) Subject: contrib/exec-nagios.px: Escape the hostname. X-Git-Tag: collectd-5.0.0-beta0~94 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=f558b0dae60f18b6596d596cdcebb913756ce9f1;p=collectd.git contrib/exec-nagios.px: Escape the hostname. --- diff --git a/contrib/exec-nagios.px b/contrib/exec-nagios.px index 938721fc..b26981fb 100755 --- a/contrib/exec-nagios.px +++ b/contrib/exec-nagios.px @@ -235,6 +235,7 @@ sub handle_performance_data my $type = shift; my $time = shift; my $line = shift; + my $ident = "$host/$plugin-$pinst/$type-$tinst"; my $tinst; my $value; @@ -250,7 +251,9 @@ sub handle_performance_data return; } - print "PUTVAL $host/$plugin-$pinst/$type-$tinst interval=$Interval ${time}:$value\n"; + $ident =~ s/"/\\"/g; + + print qq(PUTVAL "$ident" interval=$Interval ${time}:$value\n); } sub execute_script