![]() |
Re: Desktop Command Execution Widget scripts
Quote:
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. |
Re: Desktop Command Execution Widget scripts
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?
|
Re: Desktop Command Execution Widget scripts
Quote:
|
Re: Desktop Command Execution Widget scripts
Quote:
i consulted some people and the best i have is this wget --timeout=10 --tries=1 http://mywebsite/sometestfile.txt echo "$?" thats it. |
Re: Desktop Command Execution Widget scripts
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 ;) |
Re: Desktop Command Execution Widget scripts
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 |
Re: Desktop Command Execution Widget scripts
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. |
Re: Desktop Command Execution Widget scripts
Quote:
|
Re: Desktop Command Execution Widget scripts
Quote:
|
Re: Desktop Command Execution Widget scripts
Quote:
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 |
All times are GMT. The time now is 05:53. |
vBulletin® Version 3.8.8