SageTV Community  

Go Back   SageTV Community > SageTV Development and Customizations > SageTV v7 Customizations
Forum Rules FAQs Community Downloads Today's Posts Search

Notices

SageTV v7 Customizations This forums is for discussing and sharing user-created modifications for the SageTV version 7 application created by using the SageTV Studio or through the use of external plugins. Use this forum to discuss plugins for SageTV version 7 and newer.

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 03-06-2016, 09:42 AM
timg11's Avatar
timg11 timg11 is offline
Sage Aficionado
 
Join Date: Sep 2008
Posts: 472
Create a "Watchdog" - is there a Sage Service network API

(sorry, I should have posted this in "SageTV v7 Customizations" - is there a way to move it?)

I occasionally have cases where the computer hosting my Sage server will get into a non-functional mode and I'll miss bunch of shows. It may not fully crash and reboot, but simply become non-responsive.

I can't simply ping the server from another machine, since the server sleeps when there are no active recordings going on.

I'd like to build a "watchdog" out of a Raspberry Pi. The idea is to co-locate it with the sage server, monitor the server's DC power state with a GPIO (opto isolated), and poll the sage service status over the network. For starters, the Watchdog can text me if it sees a problem. (i.e. power on, but service unresponsive) Ultimately, I can make a Pi GPIO output drive the reset button on the sage server also.

On the software side I'm looking for a "presence detect" that the Watchdog Pi can poll to verify the Sage Service is running. Is there a simple API or port for the Sage Service I can try to connect to? Is the Sage Service API documented anywhere? I just need something simple to verify the service is running.
__________________
HD300 extender with (2020 New Build) SageTV 64 bit V9.2.2.903 (service mode), Running on Windows 10 (64 bit), Intel Core i7-10700K CPU, 16G RAM, GIGABYTE Z490 UD motherboard. NVidia GTX1650 Super; Viewsonic LCD on one output and Mitsubishi WD57734 HDTV via DVI/HDMI on other output. HDHomeRun HDHR5-4US tuner, Hauppauge "Siena" 1512 HD-PVR2 connected to Cisco Cable modem from Spectrum, tuned with USB-UIRT.

Last edited by timg11; 03-06-2016 at 09:51 AM.
Reply With Quote
  #2  
Old 03-06-2016, 10:58 AM
troycheek's Avatar
troycheek troycheek is offline
Sage Advanced User
 
Join Date: Feb 2008
Posts: 148
The Web UI plugin might help. It runs as part of Sage and creates access to Sage via a generated webpage that be accessed with a web browser or command line tool like wget. If wget can retrieve the webpage, then the server and the Sage service are running. If wget can't retrieve the web page, then the server isn't powered up OR the server is powered but the service isn't running, and you should be able to tell which is which by what error message wget returns.

Warning: Current version 3.0 of the Web UI doesn't work for some of us and we're not quite sure why yet.
Reply With Quote
  #3  
Old 03-07-2016, 08:30 AM
timg11's Avatar
timg11 timg11 is offline
Sage Aficionado
 
Join Date: Sep 2008
Posts: 472
Which version is most likely to work with SageTV V7.1.9? Is it also available through the SageTV plugin UI? Or is there a different procedure to install?
__________________
HD300 extender with (2020 New Build) SageTV 64 bit V9.2.2.903 (service mode), Running on Windows 10 (64 bit), Intel Core i7-10700K CPU, 16G RAM, GIGABYTE Z490 UD motherboard. NVidia GTX1650 Super; Viewsonic LCD on one output and Mitsubishi WD57734 HDTV via DVI/HDMI on other output. HDHomeRun HDHR5-4US tuner, Hauppauge "Siena" 1512 HD-PVR2 connected to Cisco Cable modem from Spectrum, tuned with USB-UIRT.
Reply With Quote
  #4  
Old 03-07-2016, 08:47 AM
stuckless's Avatar
stuckless stuckless is offline
SageTVaholic
 
Join Date: Oct 2007
Location: London, Ontario, Canada
Posts: 9,713
Chances are you have the sagex apis installed. If you enter
Code:
http://server:port/sagex/api
in a browser, you should get a help page on the sage services api. If you want to test if a server is responsive, you could do something simple like...
Code:
http://server:port/sagex/api?c=GetServerAddress&encoder=json
There is some additional documentation here.
https://github.com/stuckless/sagetv-...sing-sagex-api
Reply With Quote
  #5  
Old 03-07-2016, 05:22 PM
timg11's Avatar
timg11 timg11 is offline
Sage Aficionado
 
Join Date: Sep 2008
Posts: 472
What is the default port for SageX? The server does not respond on port 80.
__________________
HD300 extender with (2020 New Build) SageTV 64 bit V9.2.2.903 (service mode), Running on Windows 10 (64 bit), Intel Core i7-10700K CPU, 16G RAM, GIGABYTE Z490 UD motherboard. NVidia GTX1650 Super; Viewsonic LCD on one output and Mitsubishi WD57734 HDTV via DVI/HDMI on other output. HDHomeRun HDHR5-4US tuner, Hauppauge "Siena" 1512 HD-PVR2 connected to Cisco Cable modem from Spectrum, tuned with USB-UIRT.
Reply With Quote
  #6  
Old 03-07-2016, 05:41 PM
stuckless's Avatar
stuckless stuckless is offline
SageTVaholic
 
Join Date: Oct 2007
Location: London, Ontario, Canada
Posts: 9,713
Quote:
Originally Posted by timg11 View Post
What is the default port for SageX? The server does not respond on port 80.
same as the webserver 8080. Also make sure you have sagex-services plugin installed (it might already be installed, but if not, then it'll need to be installed)
Reply With Quote
  #7  
Old 03-07-2016, 06:41 PM
timg11's Avatar
timg11 timg11 is offline
Sage Aficionado
 
Join Date: Sep 2008
Posts: 472
I'm looking at my Installed Plugins page (All), and it shows sagex-api by stuckless version 7.0.23.9 (Update available). It appears to be installed and running.

When I put <http://192.168.1.n:8080/sagex/api> into a browser from another computer, it times out. When I try http://localhost:8080/sagex/api on the sage server machine it says "Unable to connect. Firefox can't establish a connection to the server at localhost:8080."

The plugin is running on the Sage Server, not the HD300, right?
__________________
HD300 extender with (2020 New Build) SageTV 64 bit V9.2.2.903 (service mode), Running on Windows 10 (64 bit), Intel Core i7-10700K CPU, 16G RAM, GIGABYTE Z490 UD motherboard. NVidia GTX1650 Super; Viewsonic LCD on one output and Mitsubishi WD57734 HDTV via DVI/HDMI on other output. HDHomeRun HDHR5-4US tuner, Hauppauge "Siena" 1512 HD-PVR2 connected to Cisco Cable modem from Spectrum, tuned with USB-UIRT.
Reply With Quote
  #8  
Old 03-07-2016, 08:11 PM
stuckless's Avatar
stuckless stuckless is offline
SageTVaholic
 
Join Date: Oct 2007
Location: London, Ontario, Canada
Posts: 9,713
Quote:
Originally Posted by timg11 View Post
I'm looking at my Installed Plugins page (All), and it shows sagex-api by stuckless version 7.0.23.9 (Update available). It appears to be installed and running.

When I put <http://192.168.1.n:8080/sagex/api> into a browser from another computer, it times out. When I try http://localhost:8080/sagex/api on the sage server machine it says "Unable to connect. Firefox can't establish a connection to the server at localhost:8080."

The plugin is running on the Sage Server, not the HD300, right?
It runs on the server. Do you have the Jetty Plugin installed? It will require Jetty as well, but if you already have web ui install, or bmt, then jetty will be installed.
Reply With Quote
  #9  
Old 03-07-2016, 09:26 PM
timg11's Avatar
timg11 timg11 is offline
Sage Aficionado
 
Join Date: Sep 2008
Posts: 472
I had Jetty installed but it was disabled (not sure why - maybe it was causing problems way back when?)

It is 2.3.0.14.

I enabled it, and now when I try http://localhost:8080/sagex/api I get:

HTTP ERROR: 404
Problem accessing /sagex/api. Reason:
NOT_FOUND
Powered by Jetty://


So maybe there is enough functionality now available to tell me if the Sage Service is up?
__________________
HD300 extender with (2020 New Build) SageTV 64 bit V9.2.2.903 (service mode), Running on Windows 10 (64 bit), Intel Core i7-10700K CPU, 16G RAM, GIGABYTE Z490 UD motherboard. NVidia GTX1650 Super; Viewsonic LCD on one output and Mitsubishi WD57734 HDTV via DVI/HDMI on other output. HDHomeRun HDHR5-4US tuner, Hauppauge "Siena" 1512 HD-PVR2 connected to Cisco Cable modem from Spectrum, tuned with USB-UIRT.
Reply With Quote
  #10  
Old 03-08-2016, 01:42 AM
troycheek's Avatar
troycheek troycheek is offline
Sage Advanced User
 
Join Date: Feb 2008
Posts: 148
Quote:
Originally Posted by timg11 View Post
Which version is most likely to work with SageTV V7.1.9? Is it also available through the SageTV plugin UI? Or is there a different procedure to install?
It's available through setup/plugins/general and it's called SageTV Web UI or something like that. Versions 2.43, 3.1 (2.43 in all but name), and the experimental 3.1.1 all work for me. 3.0 is the version that doesn't work for some of us.

I use the Web UI for everything because I never got sagex-api to work on my system. I just tried installing it again and got it to respond only after restarting the Sage service. (I initially didn't restart because the plugin didn't suggest it. This may have been my problem before and I should have known better.) This is way over my head, but I did get a proper response to the GetServerAddress command that stuckless suggested.
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
"Therapeutic Reboot" of Sage Service vs. Sage Program Savage1701 Hardware Support 13 06-06-2011 10:01 AM
SOLVED! "Invalid directory" and absence of "Browse the local network" krasev SageTV Software 2 05-17-2011 08:14 AM
Create "Scene" Screen in Studio? gatorwes SageTV Studio 14 04-26-2009 06:23 PM
Can i create a "My TV -> Sports" screen like the "My Tv -> Movies" screen? bnh SageMC Custom Interface 4 03-03-2009 10:41 AM
Sage TV Client won't work when SageTV runs as a "Service" Rezolution SageTV Software 4 05-30-2006 08:33 PM


All times are GMT -6. The time now is 01:59 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2023, vBulletin Solutions Inc.
Copyright 2003-2005 SageTV, LLC. All rights reserved.