Welcome to Pandora FMS Community!

Find answers, ask questions, and connect with our community around the world.

Welcome to Pandora FMS Community Forums Community support Pandora Server generic_data_string markup problem

  • Pandora Server generic_data_string markup problem

    Posted by Joao on February 6, 2006 at 21:10

    One 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 Web

    Examples of this are modules that return HTML input:
    Pandora Web Page

    The 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.
    Cheers

    raul replied 18 years, 9 months ago 3 Members · 5 Replies
  • 5 Replies
  • Sancho

    Administrator
    February 6, 2006 at 21:25
    2215 Karma points
    Community awards: bulb Bright ideas
    Community rank: tentacle_master_icon Tentacle Master
    Like it
    Up
    0
    Down
    Drop it
    ::

    Thanks a lot for the fix !!.

    It will be tested and included for 1.2 release.

  • Sancho

    Administrator
    February 7, 2006 at 05:20
    2215 Karma points
    Community awards: bulb Bright ideas
    Community rank: tentacle_master_icon Tentacle Master
    Like it
    Up
    0
    Down
    Drop it
    ::

    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.

  • Joao

    Member
    February 7, 2006 at 12:36
    0 Karma points
    Community rank: tentacle-noob-1 Tentacle noob
    Like it
    Up
    0
    Down
    Drop it
    ::

    My modules that return XML/HTML markup always have a primary tag, like in
    Pandora Web Page

    The 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 🙂

  • raul

    Member
    February 7, 2006 at 13:45
    0 Karma points
    Community rank: tentacle-noob-1 Tentacle noob
    Like it
    Up
    0
    Down
    Drop it
    ::

    Labeled as bug PS-060103-1

  • raul

    Member
    February 7, 2006 at 22:20
    0 Karma points
    Community rank: tentacle-noob-1 Tentacle noob
    Like it
    Up
    0
    Down
    Drop it
    ::

    Solved in the last update of Pandora Server 1.2 Beta