Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help!! Why my XML data is not recorded in DB?
#1
I am generating simple XML data as below
<agent_data agent_name="test2" timestamp="2010-09-06 22:10:00" version="1.0" os="Other"
os_version="1.0">
<module>
<name>5min</name>
<type>generic_data</type>
<data>73.3</data>
<timestamp>2010-09-06 22:05:00</timestamp>
</module>
</agent_data>

I found that whenever if i have data of the same value in my next XML entry, the data will not be recorded in database. Can anyone explain why? How can I recover my data? Many thanks!!!

Cheers,
Chong
 Reply
#2
Excellent question. I've added also a FAQ entry here: http://openideas.info/wiki/index.php?tit...oesnt_work

Thanks for asking interesting things :-)

At first sight the XML lacks of interval parameter in <agent_data> and if my memory doesn't trick me, the timestamp information inside the module data is not allowed if it's not contained in a datalist structure. I'm almost sure that following XML would work:

<agent_data agent_name="test2" timestamp="2010-09-06 22:10:00" version="1.0" os="Other"
os_version="1.0" interval="300">
<module>
<name>5min</name>
<type>generic_data</type>
<datalist>
<data>
<value>73.3</value>
<timestamp>2010-09-06 22:05:00</timestamp>
</data>
</datalist>
</module>
</agent_data>

Or a simple one witout data information:

<agent_data agent_name="test2" timestamp="2010-09-06 22:10:00" version="1.0" os="Other"
os_version="1.0" interval="300">
<module>
<name>5min</name>
<type>generic_data</type>
<data>73.3</data>
</module>
</agent_data>


(09-06-2010, 02:40 PM)oneline link Wrote: I am generating simple XML data as below

<agent_data agent_name="test2" timestamp="2010-09-06 22:10:00" version="1.0" os="Other"
os_version="1.0">
<module>
<name>5min</name>
<type>generic_data</type>
<data>73.3</data>
<timestamp>2010-09-06 22:05:00</timestamp>
</module>
</agent_data>

I found that whenever if i have data of the same value in my next XML entry, the data will not be recorded in database. Can anyone explain why? How can I recover my data? Many thanks!!!

Cheers,
Chong
 Reply
#3
Thanks Sancho, in fact, my XML format was working fine. Just that, the data values will not be recorded in DB if you have the same data value for 2 consecutive entry with different timestamp. Eg.

<agent_data agent_name="test2" timestamp="2010-09-06 22:05:00" version="1.0" os="Other"
os_version="1.0">
<module>
<name>5min</name>
<type>generic_data</type>
<data>73.3</data>
<timestamp>2010-09-06 22:05:00</timestamp>
</module>
</agent_data>

and

<agent_data agent_name="test2" timestamp="2010-09-06 22:10:00" version="1.0" os="Other"
os_version="1.0">
<module>
<name>5min</name>
<type>generic_data</type>
<data>73.3</data>
<timestamp>2010-09-06 22:10:00</timestamp>
</module>
</agent_data>

The timestamp above is different but Pandora only takes 2010-09-06 22:05:00. I wonder this is a bug or if we can solve it using configurations or XML format.

I have given a try to your XML format. It seems like XML with <datalist> as below does not take my timestamp. It will only take system's timestamp. Can you advise ? Thanks.

<agent_data agent_name="test2" timestamp="2010-09-06 22:10:00" version="1.0" os="Other"
os_version="1.0" interval="300">
<module>
<name>5min</name>
<type>generic_data</type>
<datalist>
<data>
<value>73.3</value>
<timestamp>2010-09-06 22:05:00</timestamp>
</data>
</datalist>
</module>
</agent_data>
 Reply


Users browsing this thread: 1 Guest(s)


(c) 2006-2018 Artica Soluciones Tecnol├│gicas. Contents of this wiki are under Create Common Attribution v3 licence. | pandorafms.com | pandorafms.org

Theme © MyBB Themes