Pandora FMS Community

BAD XML - why?

qus · 21 may 2009, 2:25 · 11 mensajes · 49 visitas

  1. Inicio del debate

    Hello, Here's an XML message I am passing to my Pandora server, this message works and gives no errors: queue generic_data 0 kolejka status generic_proc 1 Czy dziala But this message doesn't get processed, it stays in data_in directory, renamed to BADXML: status generic_proc 0 Czy dziala Only thing I can suspect is that there might be some invisible special characters. I am attaching a file here, so you can check it. (this is of course not doc, but palin text, but I couldn't attach it without renaming)

  2. Hi qus, Well, the XML format that I have in my server differ from yours... Are you generating this by yourself? Could you post your pandora_agent.conf file here? Try to force encoding in the header: Follow an example of the beggining of my XML file at the server: Regards.

  3. This is not generated by pandora_agent.conf, it is generated by perl (or python) monitor. As you see there are two files - one that works (without this strange ![CDATA[]] formatting), another one doesn't... That's all there is... OK, it is Python. See for yourself: #!/usr/bin/env python import time import pexpect import sys import re try: child = pexpect.spawn('ftp 10.139.106.38') child.expect('(?i)name .*: ') child.sendline('0000') child.expect('(?i)password') child.sendline('0000') child.expect('ftp> ') #child.sendline('cd /Sent') #child.expect('ftp> ') child.sendline('dir') ktory=child.readline() #dupa que=0 sent=0 while not re.search('226 Closing data',ktory): if ktory[53:54]=="O": que=que+1 elif ktory[53:54]=="S": sent=sent+1 ktory=child.readline() if child.isalive(): child.sendline('bye') # Try to ask ftp child to exit. child.close() timestring = time.strftime("%Y-%m-%d %H:%M:%S", time.localtime(time.time())) print '' % timestring print '' print 'queue' print 'generic_data' print '%s' % que print 'kolejka' print '' print '' print 'status' print 'generic_proc' print '1' print 'Czy dziala' print '' print '' except pexpect.TIMEOUT: timestring = time.strftime("%Y-%m-%d %H:%M:%S", time.localtime(time.time())) print '' % timestring print '' print 'status' print 'generic_proc' print '0' print 'Czy dziala' print '' print '' print ''

  4. Ok Qus... Unfortunatly, I'm using basicaly agents to set my monitors... I think I will not able to help you with this issue. Hope some other guy appear here to give as an explanation of what is happening... Good luck.

  5. Take a look at (Link not available anymore) Try to debug the xml that fails following the instructions given there: You can see in your browser the content of the data files, just adding the next files and changing the headers of the .data file (they are, in the end, xml files): * Add to the data file: * Create file pandora_agent.dtd: * Create file pandora_agent.xsl: Pandora Agent

    Name

    Type

    Data

    Description

    Then, you can open the data file in your browser, easier to debug. If you have any problem showing some characters, try to put encoding to "ISO-8859-1".

  6. Well - it works perfectly. Shows me a neat table: Name Type Data Description status generic_proc 0 Czy dziala Without any error. Which was obvious from the beginning, as this xml doesn't differ from the one that works. So it seems - it's a bug in Pandora...

  7. Seems that you don't have the encoding header. Also datetime format is with "-" instead with "/". Anyway, have you checked your pandora_server.error file and pandora_server.log ?. It probably give us a clue.

  8. OK, I will check these logs. Note that I pass many different messages without headers and with "-" date separator without any problem.

  9. Uff, I have no idea without more information. If you don't get anything, try to raise log verbosity to 10.

  10. There's nothing interesting in .log (from today), bur .error is full of errors (this log is 134038185 bytes!), they look more or less like this: Argument "83%" isn't numeric in sprintf at /usr/lib/perl5/site_perl/5.10.0/PandoraFMS/DB.pm line 905. Argument "100%" isn't numeric in sprintf at /usr/lib/perl5/site_perl/5.10.0/PandoraFMS/DB.pm line 905. Argument "88%" isn't numeric in sprintf at /usr/lib/perl5/site_perl/5.10.0/PandoraFMS/DB.pm line 905.

  11. Delete the entire log, try to parse only the xml that are giving you problems and put here the contents of the log (and the XML, if this is different from the first you put here). Seems to be a problem because is receiving numerical data as "83%" and the "%" is not understood and discards it, but you XML don't have any % character ¿?¿?

Entra en tu cuenta para publicar.