Update: Ignore this post - I think I have found the problem - see below. If it's not the problem then try this...
Arr... Me thinks me spoke too soon and too foolishly. I took your XML (which looks fine). It wouldn't parse in anything but only because phpBB had put some spaces in front of every line. Removing them from the first line so the
<?xml is right at the start of the line (the others are irrelivant) shows it as valid and it loads into FreeNATS fine (I put it in the filesystem and then just pulled a URL of /home/dcutting/aday.xml).
Just to confirm - the file does start <? without any leading whitespace?
My system log shows the following during import:
And they then show up in the node edit screen (which is where incidentally you should see any nodeside tests once they have pushed/pulled once):
The Win32 does check it gets a '1' back from the nodeside.post.php script before saying "success" which should indicate the Win32 one succeeded. This should mean the XML has parsed ok etc.
Can you check the end of your node.vbs which should look like this:
Code: Select all
If Right(response,1) = "1" Then
WScript.Echo "Post Successful"
Else
WScript.Echo "Encountered An Error:"
WScript.Echo response
End If
End If
I'm hoping it doesn't and I've mucked up releasing the nodeside tester - you're getting a success message but actually it's failing.
If they are all failing with that XML error then it certainly points toward an environmental problem with the XML parser (or rather my use of it!).
If just the Linux push and pulls are failing and in fact the Win32 one is working then that is so weird I'm just going to ignore it as a possibility for the time being.
Assuming it is the XML server environment we can try the following:
Local file load
- Create a new node (bob), set it's interval to 0.
Enable it, enable nodeside testing, nodeside pull.
Make sure ping test and require ping are disabled.
Copy your XML output file from the node to /somewhere/file.xml
Set the key to nothing and the pull URL to /somewhere/file.xml
Go into Configure - System Settings - System Variables and set the value of log.level to 10
On one console cd to server/bin and do php logwatch.php -f (which will start tailing the system log - my example output is above)
On another console cd to server/bin and do php tester.php bob
Hopefully the system log will show some more useful output than is just shown to the normal run console. Control-C to exit the log watcher (you may want to wait a few secs at least after the run for useful output to be shown as it only polls every second or so for new entries).
Oh and you'll probably want to set log.level back to something around 5-ish to avoid tonnes of stuff clogging up your fnlog table too much.
Discovery and Import Tools
If this doesn't provide any illumation another quick check of a similar bit of the system that uses XML parsing is the discovery and import tools. You can see if they are working without affecting the database.
- cd to server/bin
you'll need to be root or sudo the discover.php command as it uses a low level ping
do: php discover.php 127.0.0.1
a discover.xml file should be generated which should be valid
do: php import.php discover.xml
don't worry - it doesn't do a live import but it should show you a breakdown which would indicate the XML parser is in fact working. Hopefully though it'll give an error like "sorry this isn't working because you need to change true to false on line 455 of some.freenats.file.php" (you never know... I live in hope).
Doing this I get the following:
Code: Select all
[dcutting@shark bin]$ sudo php discover.php 127.0.0.1
FreeNATS Discover Started
Live: No Debug: No
File: discover.xml
Ranges: 1
127.0.0.1 2130706433-2130706433 127.0.0.1-127.0.0.1
+ 127.0.0.1 - 127.0.0.1
- Ping Returned - Host Active
- Name: shark
- NodeID: shark
Finish... Writing File...
[dcutting@shark bin]$ ls
cleanup.php clearbigrecords.sh import.php resettester.sh tester.sh
cleanup.sh discover.php include.php setvar.sh test-threaded.php
clearalert.sh discover.xml logwatch.php tester.php test-threaded.sh
[dcutting@shark bin]$ more discover.xml
<?xml version="1.0" encoding="UTF-8"?>
<freenats-data>
<default TYPE="node">
<nodeenabled>1</nodeenabled>
<pingtest>0</pingtest>
</default>
<default TYPE="localtest">
<testenabled>1</testenabled>
<testrecord>0</testrecord>
</default>
<node NODEID="shark">
<nodeid>shark</nodeid>
<hostname>127.0.0.1</hostname>
<nodedesc>shark</nodedesc>
</node>
</freenats-data>
[dcutting@shark bin]$ sudo php import.php discover.xml
FreeNATS Bulk Importer - www.purplepixie.org/freenats
Importing File: discover.xml => Live Import: No
Node Default Section Starting
Default: nodeenabled => 1
Default: pingtest => 0
Default Section End
Localtest Default Section Starting
Default: testenabled => 1
Default: testrecord => 0
Default Section End
Node Data: shark
Node Data: 127.0.0.1
Node Data: shark
Nodes: 1 Local Tests: 0
NodeID: shark - Parsing Properties...
nodeenabled => 1
pingtest => 0
nodeid => shark
hostname => 127.0.0.1
nodedesc => shark
Live Import: No
[dcutting@shark bin]$
Let me know how you get on.
If this doesn't work feel free to email me if it's possible to get on for some remote diagnostics.
Cheers,
Dave.