Online / Offline Status Notification System via push
-
Ok, good part of Webinterface is done now.
One problem, I was trying to use fetch instead of wget (as sudgested earlier) but a) I cant make it to work b) it doesnt work as spiderSo, is it posible to install WGET to the system and include it in the distribution?
-
What doesn't work with fetch?
-
everithing, I tryed all posible syntax and never got it to work …
Can you give me a sample code on using fatch to open lets say http://example.com and do not download any info?
-
What do you mean "do not download any info?"
Do you mean quiet?
-
Spider mode = no downloads
quite mode = no outputTechnicaly i need them both
-
Quiet and no downloads? Sorry but I dont follow you. The point of fetch and wget is to download/fetch a page.
-
who cares about original point :-P
i used wget yo open the remote webpage and transfer variables to remote server via HTTP POST -this is called -spider in wgetwger –spider -q "http://ecample.com?cmd=Hello2%World"
This will send Hello World to remote webserver. and at the same time will not download or save anything. Well some times i can run as spider but not in quite mode so i can see if the requested page returns me an error. This technique is used by google and paypal
-
fetch -o - "http://blah.url.com/test.php?testing=test&propermodulation=true" >/dev/null
-
Ok good seams to work :-) Tnx
Now I have to join the GUI with the script and set DNS and i'm done on the client side ;D -
I jaws was trying to use my GUI to modify crontabfile but no luck… i went to actual file and found out this message:
DO NOT EDIT THIS FILE - edit the master and reinstall.
(/tmp/crontab.lfJ3UAOksN installed on Thu Nov 9 04:03:50 2006)
(Cron version – $FreeBSD: src/usr.sbin/cron/crontab/crontab.c,v 1.22 2004/09/14 19:01:19 dds Exp $)
*/60 * * * * sh /usr/local/StatusNotifier/server_status.sh >/dev/null 2>&1
The cron that is there is the one that i installed but I want to let my GUI to be able to edit cron job, but as file says I cant edit it? :o as i would normally do under linux. So how can I edit cron file with out reinstalling it? I dont think I can reinstalll it via script, one way or another its alternating and saving the file content.
Well maybe i missing something? Any ideas?
-
Edit /etc/crontab
killall -HUP cron
-
ok Clinent Side is 98% Done, Server side is 30% Done
-
I still have no idea what your working on but good luck. ;)
One bit about that fetch command… Do check the shell return code. fetch will fail if a problem occurred.
I apologize if you are already doing so.
-
" fetch will fail if a problem occurred" - do you mean problem w/ connection or remote server? If so well i'll live w/ it for now… I alredu had enough headach transforming script from Linux to BSD, and then making GUI working the way it should.
As to what im doing is something like SNMP but in reverse... im my case router send its status to the server. If router doesnt send its status server marks device as of line and notifies device owner about the failute. Also owner can look up curent WAN Ip and other config in central location on the web...
-
It is the shell return code. What if the remote server is off line? You are assuming the update went through ok?
-
Well if remote server is ofline then it a problem at this moment. In future if ppl will be using the feasture I add backup server support, and buffer, to store data untill we got connection
-
do you mean like fetch {print $0}? or something else?
Im not too good in linux/bsd scripting -
Simply test $? after the fetch command.
fetch -o -o "http://pfsense.com/fake.txt" >/dev/null
if [ $? != 0 ]; then
# command failed!
echo "pfsense fake: Nope, didnt work"
fifetch -o -o "http://www.pfsense.com" >/dev/null
if [ $? != 0 ]; then
# command failed!
echo "pfsense failed"
else
echo "pfsense worked"
fi -
Ok I can add that but, what will it give me? Server stil doesnt gets the report, well i can set another cron to exevute in say 10 min or something, or I dono yet…
my brain is fried today
-
As long as there are no negative issues if the commands fail then don't worry about it. I don't know your source code so I am just preaching best practices at this point.