December 14, 2017, 05:10:56 am *
Welcome, Guest. Please login or register.
News:
 
   Forum Home   Search Login Register OBiTALK  
Pages: [1] 2
  Print  
Author Topic: OBi110 scheduled reboot  (Read 131143 times)
dialtone
Jr. Member
**
Posts: 31


« on: July 11, 2011, 02:14:31 am »

Is it possible to schedule an OBi110 to reboot at a specific time?
For instance, I want it to reboot at 4am when I am not at my desk.
Logged
infin8loop
Full Member
***
Posts: 219


My code doesn't abend, it loops to ∞


« Reply #1 on: July 15, 2011, 11:13:22 am »

If you have a windows machine always running on the network with the Obi you could run the attached script via Task Scheduler at the appropriate time.  You will first need to change the IP address and password in the script to those of your Obi.  The script simply posts the same page that clicking on the "Reboot" button does on the local Obi Admin pages.

* obi-reboot.vbs (0.36 KB - downloaded 1280 times.)
« Last Edit: July 15, 2011, 11:22:29 am by infin8loop » Logged

"This has not only been fun, it's been a major expense." - Gallagher
JTravers
Newbie
*
Posts: 5


« Reply #2 on: August 05, 2011, 10:35:52 am »

If you have a windows machine always running on the network with the Obi you could run the attached script via Task Scheduler at the appropriate time.  You will first need to change the IP address and password in the script to those of your Obi.  The script simply posts the same page that clicking on the "Reboot" button does on the local Obi Admin pages.

Works perfectly.
I've found that I need to reboot my OBi110 every once in a while or I sometimes end up with one-way audio. This should fix the problem.

Thanks!
Logged
earthtoobi
Full Member
***
Posts: 126


« Reply #3 on: August 05, 2011, 04:27:08 pm »

if you use linux and have this module try this:

 lwp-request -C admin:<password> -e -d http://192.168.x.x/rebootgetconfig.htm
Logged
infin8loop
Full Member
***
Posts: 219


My code doesn't abend, it loops to ∞


« Reply #4 on: August 05, 2011, 08:35:41 pm »

if you use linux and have this module try this:

 lwp-request -C admin:<password> -e -d http://192.168.x.x/rebootgetconfig.htm

I fired up Ubuntu in VirtualBox and tried the above command.  Works great.  I learned something.  Thanks.
The thought of writing a java or perl script for linux made my dinosaur mainframer brain hurt.  This cmd is much easier!     
Logged

"This has not only been fun, it's been a major expense." - Gallagher
earthtoobi
Full Member
***
Posts: 126


« Reply #5 on: August 05, 2011, 09:23:28 pm »

you can add it to cron tab to schedule it.
if you have webmin installed, it makes it much more easier to schedule cron jobs and in general manage your Ubuntu/Linux.
Logged
QBZappy
Hero Member & Beta Tester
*****
Posts: 2322



« Reply #6 on: August 05, 2011, 09:56:33 pm »

infin8loop,

Hi,
My OBi is registered as an extension to a Grandstream GXE PBX. I've been trying to do something similar to what you are doing with the OBi with the PBX. I have figured out that I can telnet to the PBX and at terminal I can type reboot, and it reboots. I need to figure out how to automate this under the task scheduler, or use your approach which accomplishes the same thing.

Using firefox addon firebug, I have been able to figure out the following to get to the reboot page of the GXE. My programming skills are nil. Using your method, I can only take it this far. It doesn't reboot the PBX. There isn't much code, perhaps you can have a look at the VBS script and maybe you can spot why it didn't work. Thanks.

strURL = "http://192.16.240.3:8083/cgi-bin/ccgi?pageID=27"
''change xxx.xxx.xxx.xxx above to the local IP address of your GXE

strPassword = "12345"
''change GXEpassword above to the password of your local GXE page login

Set objHTTP = CreateObject("Microsoft.XMLHTTP")
objHTTP.open "POST", strURL, False, "admin", strPassword
objHTTP.send
Set objHTTP = Nothing
« Last Edit: August 05, 2011, 10:00:06 pm by QBZappy » Logged

Owner of the 1st OBi110/100 units in service in Canada & South America. 1st OBi202 on my street. 1st OBi1032 in Montreal.
QBZappy
Hero Member & Beta Tester
*****
Posts: 2322



« Reply #7 on: August 08, 2011, 02:07:39 pm »

Bump,

Anybody
Logged

Owner of the 1st OBi110/100 units in service in Canada & South America. 1st OBi202 on my street. 1st OBi1032 in Montreal.
QBZappy
Hero Member & Beta Tester
*****
Posts: 2322



« Reply #8 on: August 11, 2011, 11:42:53 am »

Decided to use a Telnet Scripting Tool a.k.a TST10.exe. Easy to setup and run under task scheduler. (Google it if you need more info).

To download:
http://support.moonpoint.com/downloads/windows/network/Telnet/tst10.php
(Click on "More info" to get a complete set of instructions.)
Logged

Owner of the 1st OBi110/100 units in service in Canada & South America. 1st OBi202 on my street. 1st OBi1032 in Montreal.
infin8loop
Full Member
***
Posts: 219


My code doesn't abend, it loops to ∞


« Reply #9 on: August 11, 2011, 06:08:28 pm »

There isn't much code, perhaps you can have a look at the VBS script and maybe you can spot why it didn't work. Thanks.

Sorry I didn't notice the question sooner.  I cut and pasted your script (which was basically my script with the strURL and strPassword changed) into a test.vbs.  I changed the strURL and strPassword back to my obi110 and ran the script and it worked.

If physically typing "http://192.16.240.3:8083/cgi-bin/ccgi?pageID=27" into a browser window reboots your device then it's probably the correct URL.  Otherwise, perhaps it's a slightly different URL that is POSTed when clicking a button on the page that causes a reboot.

Otherwise, perhaps the login id "admin" needs to be changed to the login id (if not "admin) of your device in the line:
           objHTTP.open "POST", strURL, False, "admin", strPassword

Or maybe you don't have Windows Scripting Host (WSH) installed.  Do you get a listing of options if you go to a command line prompt and type "cscript" (without quotes of course)?  I've never had to install it but perhaps I'm just lucky.  

WSH can be downloaded from:
Windows XP (and probably later versions of Windows?): http://www.microsoft.com/download/en/details.aspx?id=8247
Windows 2000: http://www.microsoft.com/download/en/details.aspx?id=20240

I pretty much have stuck with Windows XP because that's what the company I work for is still using for our desktops.
No reason I can think of why WSH wouldn't work for your device if given the correct strURL, strPassword, and login id and you have WSH installed.

If none of this works then you might try invoking your script
at a command line (and task scheduler):   cscript c:\complete-path-here\script-name.vbs    (c: or actual drive letter:)
and look for any errror messages.

Decided to use a Telnet Scripting Tool a.k.a TST10.exe. Easy to setup and run under task scheduler. (Google it if you need more info).
I see you have developed a solution using a different scripting language.  Feel free to post the script as an attachment. I'm at a loss because you apparently figured out the correct parameters (URL, login id, and password) to pass using the other scripting language.
« Last Edit: August 11, 2011, 06:10:53 pm by infin8loop » Logged

"This has not only been fun, it's been a major expense." - Gallagher
QBZappy
Hero Member & Beta Tester
*****
Posts: 2322



« Reply #10 on: August 11, 2011, 07:53:05 pm »

infin8loop,

Hi, thanks for your reply.

At this point it is academic as I have a working solution. However it would be interesting to learn how to accomplish using web browser as not all devices can be controlled using telnet. I can confirm having Windows Scripting Host (WSH) is installed.

Typing in the url does not reboot the PBX. With your script and this url "http://192.16.240.3:8083/cgi-bin/ccgi?pageID=27", I can take to the web page were I need to press the reboot button. I think there is HTTP command to do this step.

Otherwise, perhaps it's a slightly different URL that is POSTed when clicking a button on the page that causes a reboot.

I think this is more than likely the case. Do you know how to press the button via script?

(See attached image)

Using telnet uses a different approach. It didn't require an url. In my case to telnet into the PBX only the IP address, password and script command to "reboot" + keyboard equivalent of pressing "enter" into the terminal window was sufficient to reboot the unit.


* GXE Reboot.jpg (116 KB, 1024x768 - viewed 2468 times.)
Logged

Owner of the 1st OBi110/100 units in service in Canada & South America. 1st OBi202 on my street. 1st OBi1032 in Montreal.
infin8loop
Full Member
***
Posts: 219


My code doesn't abend, it loops to ∞


« Reply #11 on: August 12, 2011, 03:48:45 am »

Hi QBZappy,

Ok, I follow you now.  The Shotgun School of Programming and Bartending is now in session.
My script doesn't press buttons, it POSTs a page. We need to find the page that's POSTed when you click the Submit button.  Put your mouse over the white area where the "Reboot" and "Reset to Default" radio buttons are located and right click, choose "View Page Source" (or if in a frame "This Frame" then "View Page Source").
Look for radio buttons in the source code, something like:
<input type="radio" name="somename" value="somevalue1" />Reboot
<input type="radio" name="somename" value="somevalue2" />Reset to Default
The name "somename" will be the same on both buttons since only the selected button value is sent.  Then look for the URL of the page that's sent for the Submit button.  It's probably in a FORM/ACTION statement.  If action="thatpage.htm" then the strURL for my script would be something like "http://youripaddress/thatpage.htm?somename=somevalue1".  If action already contains a ?x=y name/value pair then append the somename=somevalue1 onto it using &somename=somevalue1.   Just make sure you replace youripaddress, thatpage.htm, somename, and somevalue1 with the appropriate values.  And don't use "somevalue2" unless you want the thing reset to default!  Whatever strURL you come up with should work by just typing it into a browser window first, before trying to use it in the script.  Good Luck!  And send any cool weather south to Texas.



Logged

"This has not only been fun, it's been a major expense." - Gallagher
QBZappy
Hero Member & Beta Tester
*****
Posts: 2322



« Reply #12 on: August 12, 2011, 06:05:10 am »

infin8loop,

Thanks. I learn something new everyday. I will try it tonight.

We have a cool and intermittent rainy day here today. I'll try to send some good weather vibes down your way.
Logged

Owner of the 1st OBi110/100 units in service in Canada & South America. 1st OBi202 on my street. 1st OBi1032 in Montreal.
guyinsb
Jr. Member
**
Posts: 40


« Reply #13 on: September 29, 2011, 09:01:44 pm »

if you use linux and have this module try this:

 lwp-request -C admin:<password> -e -d http://192.168.x.x/rebootgetconfig.htm

Also works with Mac OSX 10.6.8 (and probably many other versions)
Logged
neilio
Jr. Member
**
Posts: 31


« Reply #14 on: October 02, 2011, 07:48:35 pm »

Thanks for this!

Does anyone have an idea of how long the OBI can go before needing to be rebooted? I've set mine to run at 5am every day, but was curious if the problem was so bad that more frequent rebooting is required.
Logged
RonR
Forum Member

Posts: 4528


« Reply #15 on: October 02, 2011, 08:00:06 pm »

Does anyone have an idea of how long the OBI can go before needing to be rebooted?

A properly operating OBi should *NEVER* need to be rebooted.
Logged
tome
Full Member
***
Posts: 167


« Reply #16 on: October 02, 2011, 08:30:55 pm »

if you use linux and have this module try this:

 lwp-request -C admin:<password> -e -d http://192.168.x.x/rebootgetconfig.htm

Also works with Mac OSX 10.6.8 (and probably many other versions)

In Lion (10.7.1) I had to specify the method (POST) and hit ctrl D after issuing this, otherwise I was getting the error: lwp-request5: LWP-REQUEST5 is not an allowed method

This worked:
lwp-request -m POST -C admin:password -e -d http://192.168.X.X:WEBSRVRPORTNUM/rebootgetconfig.htm  ^D

WEBSRVRPORTNUM is required if you changed it from default in:
System Management -> Device Admin -> Web Server -> Port

Tom
Logged
neilio
Jr. Member
**
Posts: 31


« Reply #17 on: October 03, 2011, 05:07:07 pm »

Does anyone have an idea of how long the OBI can go before needing to be rebooted?

A properly operating OBi should *NEVER* need to be rebooted.

Right. It seems like there are a bunch of people with this problem, though, so I don't know if this is specific to the firmware or if it's a hardware defect. At any rate it really needs to be addressed.
Logged
QBZappy
Hero Member & Beta Tester
*****
Posts: 2322



« Reply #18 on: October 03, 2011, 05:20:41 pm »

If you really feel like you need to reboot the OBi, wouldn't it be easier to attach the power plug of the OBi to a timer? I've seen timers which can be scheduled daily/weekly. Simpler and you won't need a computer to be on.
Logged

Owner of the 1st OBi110/100 units in service in Canada & South America. 1st OBi202 on my street. 1st OBi1032 in Montreal.
SeaObi
Newbie
*
Posts: 6


« Reply #19 on: October 03, 2011, 06:57:17 pm »

I don't get all this stuff about rebooting on a schedule.  My Obi110 went for 2 months without a reboot and I use it for many calls and many hours a day without a problem.
Logged
Pages: [1] 2
  Print  
 
Jump to:  

Powered by SMF 1.1.11 | SMF © 2006-2009, Simple Machines LLC