[mythtv-users] Remotely monitor Backend is running

Bill Meek keemllib at gmail.com
Wed Oct 13 17:21:34 UTC 2021


On 10/13/21 11:21 AM, Barry Martin wrote:
> 
> Hi Bill!
> 
>> Here's a command line version that does the last test in Stephen's
>> script that just sees if there's at lease one upcoming recording:
>>
>>   $ curl --header Accept:application/JSON --silent yourBE:6544/Dvr/GetUpcomingList?Count=1 | json_pp - | grep '"Count"'
>>
>> Which returns: "Count" : "1", if there's at least one upcoming recording.
>> That may be easier to do.
> 
> 
> YESSS!!!  This is certainly simpler, at least for what I’m wishing to do.  I’m guessing any result but ‘ *"Count" : "1",* ‘ means there’s a problem.  As a quick experiment changed the command’s GetUpcomingList?Count=1 to 0 (zero) and received ‘254’. Tested with 9 and 99 and received those numbers back – 9^th and 99^th upcoming programmes maybe? Probably easier to stick with the expected result and anything else is considered an error.

The Count parameter just tells the GetUpcomingList endpoint how many upcoming
recordings to return. I selected 1 because I assume you really care that at
least one recording will be made in the future.

Count=0 returns ALL upcoming recordings. That's OK, but probably more than
you need.

If "Count" : "0", is returned , there are no upcoming recordings.

If there curl fails, it's unable to communicate with the backend
or at least with the Services API thread.

-- 
Bill


More information about the mythtv-users mailing list