Active Topics

 



Notices


Reply
Thread Tools
Posts: 9 | Thanked: 1 time | Joined on Mar 2010
#211
Originally Posted by KiberGus View Post
May be you should make asynchronous communication with executed commands?
That's a good thought. I was really liking this widget until it locked up sometimes when roaming. I realised like you guys here, its that some commands don't complete.

In particular, any use of wget requires the "-T" option be set.

I like the real IP preloaded command, by adding "-T 5" it now never locks up.

Maybe at the least, improve the default scripts not to lock up.

Later you can try a "throw and catch" execution model.

Great widget,

orac.
 

The Following User Says Thank You to orac For This Useful Post:
Posts: 9 | Thanked: 1 time | Joined on Jan 2010
#212
can anyone help me out, i would like to use this widget to check the status of a webserver, does anyone have a cmd that does that?
 
Posts: 539 | Thanked: 165 times | Joined on Feb 2010 @ Berlin, Germany
#213
Originally Posted by TheSov View Post
can anyone help me out, i would like to use this widget to check the status of a webserver, does anyone have a cmd that does that?
What do you mean with status? The Webserver (http-Server) can be checked with a wget command. Whether the machine itself is up and running could be tested with a simple ping. For nearly any service running there is a simple tool to check it's status.
 
Posts: 9 | Thanked: 1 time | Joined on Jan 2010
#214
Originally Posted by x-lette View Post
What do you mean with status? The Webserver (http-Server) can be checked with a wget command. Whether the machine itself is up and running could be tested with a simple ping. For nearly any service running there is a simple tool to check it's status.
status like to see if its running the site, so i could use wget to get the file but how do i signal to the widget if it fails?

i consulted some people and the best i have is this

wget --timeout=10 --tries=1 http://mywebsite/sometestfile.txt
echo "$?"

thats it.

Last edited by TheSov; 2010-03-29 at 17:53.
 
Posts: 539 | Thanked: 165 times | Joined on Feb 2010 @ Berlin, Germany
#215
that might work if you know what the return codes mean. easier might be clear text message like following:
wget .... && echo "success" || echo "fail"
the last echo will only fire up if one of the previous commands fails and an echo never fails
 
Posts: 9 | Thanked: 1 time | Joined on Jan 2010
#216
I was actually able to accomplish it by this thanks to the awesome people on freenode's #linux

first i created a script called qwebcheck in /usr/bin
Code:
wget --timeout=10 -O /dev/null http://theserveruwanttocheck.xxx/somefile.html
if [ $? -eq 1 ] ; then exit 2 ; fi
echo "System OK"
chmod the script +x and then add a new command and type in your script name and WALA!

Last edited by TheSov; 2010-03-30 at 04:59.
 
Posts: 9 | Thanked: 1 time | Joined on Mar 2010
#217
Here is my solution since I am interested in the return code:

Add a desktop widget command that contains the following line:

perl -lae '$_=`sh -c "wget -T 10 --tries=1 --spider http://www.yourserver.com/" 2>&1`;@a=split(/g\ response\.\.\.\ /s,$_);@b=split(/\n/,@a[$#a]);if (!((/failed/)||(/error/))) {print @b[0];} else {print "Error"};'

I think its safe, it should not lock up, but it does sometimes need you click it a few times to confirm its not just a network error on the way to your server.

If you can, I would recommend using the IP of your server to prevent name lookups everytime you run it.

orac.
 
Posts: 539 | Thanked: 165 times | Joined on Feb 2010 @ Berlin, Germany
#218
Originally Posted by orac View Post
If you can, I would recommend using the IP of your server to prevent name lookups everytime you run it.
Raw IP will work only if you are running a dedicated server (or virtual server) with own IP. If you only got webspace somewhere this would not ensure that your website can get accessed.
 
Posts: 9 | Thanked: 1 time | Joined on Mar 2010
#219
Originally Posted by x-lette View Post
Raw IP will work only if you are running a dedicated server (or virtual server) with own IP. If you only got webspace somewhere this would not ensure that your website can get accessed.
Which is why I am interested in the status response and why I started with if you can.
 
Posts: 243 | Thanked: 146 times | Joined on Dec 2009 @ Knowhere
#220
Originally Posted by TheSov View Post
can anyone help me out, i would like to use this widget to check the status of a webserver, does anyone have a cmd that does that?
Consider installing Queen Beecon

The following script was posted on Reddit by theSov:

before we start install queenbeecon drop to a shell and create the following script in your /usr/bin

wget -O /dev/null http://theserveruwanttocheck.xxx/somefile.html

if [ $? -eq 1 ] ; then exit 2 ; fi

echo "System OK"

save it, chmod +x it.

then you add a widget for queenbeecon

edit the widget, click on add command type any name u want and the name of the script you created under "command" set any settings u want. select "when connected" and your auto update at the bottom of the widget properties and there you go, remote monitoring on the go.

screens: http://imgur.com/WfosH.png http://imgur.com/QtyLo.png



Haven't tried it yet as just being lazy at the moment.

Edit. Note that Queen Beecon is in Extras Dev so usual warnings apply
__________________
Please don't clutter the forum with questions that have been answered many times previously. Either use Power Search or check the following useful threads.

http://wiki.maemo.org/Frequently_asked_questions
http://en.wikipedia.org/wiki/Nokia_N900
http://wiki.maemo.org/N900

Last edited by hellnick; 2010-03-30 at 08:31.
 
Reply


 
Forum Jump


All times are GMT. The time now is 08:03.