From d5a5a717f6886698a4c0cb1e33a092696b413290 Mon Sep 17 00:00:00 2001 From: slerena Date: Thu, 21 Jun 2012 10:06:19 +0000 Subject: [PATCH] 2012-06-21 Sancho Lerena * lib/PandoraFMS/NetworkServer.pm: SNMP values starting with quotes are now stripped of starting/ending double quotes. This will help to get numeric (float data) as strings. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@6646 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f --- pandora_server/ChangeLog | 6 ++++++ pandora_server/lib/PandoraFMS/NetworkServer.pm | 8 +++++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/pandora_server/ChangeLog b/pandora_server/ChangeLog index 342406999a..903d2387e9 100644 --- a/pandora_server/ChangeLog +++ b/pandora_server/ChangeLog @@ -1,3 +1,9 @@ +2012-06-21 Sancho Lerena + + * lib/PandoraFMS/NetworkServer.pm: SNMP values starting with quotes + are now stripped of starting/ending double quotes. This will help to + get numeric (float data) as strings. + 2012-06-12 Dario Rodriguez * lib/PandoraFMS/Core.pm: Fixed an error with group_statistics agent diff --git a/pandora_server/lib/PandoraFMS/NetworkServer.pm b/pandora_server/lib/PandoraFMS/NetworkServer.pm index af9a39a0ab..6a2bdbedd3 100644 --- a/pandora_server/lib/PandoraFMS/NetworkServer.pm +++ b/pandora_server/lib/PandoraFMS/NetworkServer.pm @@ -290,7 +290,13 @@ sub pandora_snmp_get_command ($$$$$$$$$) { } } - return $output; + # Remove starting & ending double quotes, to easily parse numeric data on String types + if ($output =~ /^\"(.*)\"$/){ + return $1; + } + else { + return $output; + } }