Help with source install

The forum for help and support with FreeNATS as well as any useful hints and tips
Post Reply
duckdive99
Posts: 5
Joined: Wed Dec 15, 2010 10:30 pm

Help with source install

Post by duckdive99 » Wed Feb 16, 2011 7:31 am

Hello,

So I gave up on the VM running in VirtualBox, and I built an Ubuntu LAMP server in VirtualBox. Of course, I will be happy to post if someone wants to use it... assuming I can get it working.

I have the FreeNats website running. But I do not have any monitoring results.

I followed the Wiki to set the cron minute changes, and I expected to see results shortly after. But I do not see any test results. I don't think my cron stuff is set properly.

So now, I thought I'd try to run the test/ping.sh and test/test.sh scripts to see if everything is set up properly. But I don't know how to run those, and the wiki doesn't give any CLI advice. I did find another post in the forum that specifies "php tester.php <node>"

Here is my output:
jcolinger@ubuntu-vm://home/jcolinger/public_html/freenats/server/bin$ php tester.php ts-cv
NATS Tester Script Starting: Node ts-cv
Test ID: 1 (Started at 22:22:49 15/02/2011)

NodeID: ts-cv
Ping Test: Yes
PHP Warning: socket_create(): Unable to create socket [1]: Operation not permitted in /home/jcolinger/public_html/freenats/server/base/tests/ppping.inc.php on line 263
Ping Returned: -3
Trying Ping Again - X2
PHP Warning: socket_create(): Unable to create socket [1]: Operation not permitted in /home/jcolinger/public_html/freenats/server/base/tests/ppping.inc.php on line 263
Ping Returned: -3
Ping Test: Failed
Ping Fatal: Yes - Not Continuing
Doing Local Tests
Nodeside Testing
Highest Alert Level: 2
Alert Count : 1
Alerts: ping failed,

Finished Tests... Finishing Off
Summary: Tester 1 Highest Level 2, Alerts 1
NATS Stopped... Finished

-----------

I wondering if the issue has to do with the location/permissions with where I put the FreeNats files.

Help.

John

dave
Site Admin
Posts: 260
Joined: Fri May 30, 2008 9:09 pm
Location: UK
Contact:

Re: Help with source install

Post by dave » Wed Feb 16, 2011 11:08 am

Hi,

Your problem running the script here is caused by permissions - the test must run as a user with access to low-level sockets.

Usually this basically means as root.

If you execute the tester as root either through sudo, su or just logging in as root it should work ok.

As for your cron; check the file output is being piped to from your exec file in /etc/cron.minute (usually something in /tmp) - you should see the file in existance and also having content if it's working properly.

Cheers,

Dave.

duckdive99
Posts: 5
Joined: Wed Dec 15, 2010 10:30 pm

Re: Help with source install

Post by duckdive99 » Wed Feb 16, 2011 5:36 pm

When I ran it with sudo, it was successful.

But I don't know how to make the cron's run with root. Do simply change the owner on those cron files that I created?

dave
Site Admin
Posts: 260
Joined: Fri May 30, 2008 9:09 pm
Location: UK
Contact:

Re: Help with source install

Post by dave » Fri Feb 18, 2011 7:41 pm

Hi there,

The job is run as root by cron automatically if you have the standard crontab setting e.g.

* * * * * root run-parts /etc/cron.minute


What I'd suggest you do is this - edit your /etc/cron.minute/freenats-tester and change the /dev/null bit of the pipe to be /tmp/freenats-run

You should then see this file get created and can have a look at it to see what the tester has output.

In your system logs you should see the tester firing every minute as well.

Note a common problem is having a . in your cron script name; on most cron setups /etc/cron.minute/freenats.sh won't work but /etc/cron.minute/freenats will.

Cheers,

Dave.

Post Reply