Bienvenido a la comunidad de Pandora FMS › Forums › Community support › Pandora Server generic_data_string markup problem
-
Pandora Server generic_data_string markup problem
Posted by Joao on febrero 6, 2006 at 21:10One of the great things on Pandora is that it’s extremely flexible.
While trying to send markup strings from a generic_data_string module, data packets were either:
1) being discarded and not processed
2) generating input as hash(x?x?) value on Pandora WebExamples of this are modules that return HTML input:
Pandora Web PageThe above string is interpreted by the server as XML and not as a string while processing the data packet (using XMLin input).
We have resolved this in the meantime by analysing if the incoming string is an XML value. If so, we transform it again to a string.
Code location: pandora_server/bin/pandora_db.pm
Code function: sub module_generic_data_string (%$$$$$)
Code inserted:
use XML::Simple;
(…)
if (ref($m_data) eq “HASH”) {
$m_data = XMLout($m_data, RootName=>undef);
}Hope this helps.
Cheersraul replied 18 years, 9 months ago 3 Members · 5 Replies -
5 Replies
-
-
::
I actually get some extrange data, for example
Data string:
Feb 7 02:07:00 rhino Pandora Web Page
Converts to:
Pandora Web Page
Feb 7 02:07:00 rhino XML conversion seems to be invalid :(, its better than nothing, but i need to improve it.
-
::
My modules that return XML/HTML markup always have a primary tag, like in
Pandora Web PageThe example you posted has some text before the tag making it an invalid XML/HTML subset. Unfortunately, I did not test the XML conversion this way.
Don’t know if you are aware of it but Data::Dumper extension could help in this case. Juse [m]use Data::Dumper[/m] in the beginning of the code and then [m]print Dumper($m_data)[/m] to get a representation of the XML tree structure. You might want probably to print it to the logger 😉 .
I’ll try to take a look into it. Should I find some additional info, I’ll post it 🙂
-
-