From f558b0dae60f18b6596d596cdcebb913756ce9f1 Mon Sep 17 00:00:00 2001 From: Florian Forster Date: Mon, 5 Jul 2010 09:45:19 +0200 Subject: [PATCH] contrib/exec-nagios.px: Escape the hostname. --- contrib/exec-nagios.px | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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 -- 2.11.0