[mythtv-users] Monitoring frontend activities

Raymond Wagner raymond at wagnerrp.com
Thu Feb 18 08:13:44 UTC 2010


On 2/17/2010 22:47, David Whyte wrote:
> Howdy,
>
> I use zabbix to monitor the home network for things like disk and
> network activity.  I would like to use it to monitor what happens on
> each frontend, particularly when shows are deleted from the backend
> and maybe even when switching from menu to live TV or a recording etc.
>    

Information from the backend is available through the XML status server 
on 'http://mybackend:6544/xml'.  Contained are the status of all 
recorders, The upcoming schedule, jobs in the queue, recording disk 
stats, load averages, basic guide data information.  If you check out 
'MythXMLTest' in contrib, you'll find a number of additional pages with 
other accessible information.  Alternatively, you can access the backend 
directly through mythprotocol on port 6543.

Information from the frontend will only be available from the telnet socket.

The perl and python bindings provide access to these interfaces to 
varying degrees. Below is an example of retrieving some of that 
information through the python bindings (in trunk).

 >>> from MythTV import MythBE, MythDB
 >>> be = MythBE()

get total recording count
 >>> len(be.getRecordings())
141

get upcoming recording count
 >>> len(be.getScheduledRecordings())
44

get total and free recorder counts
 >>> len(be.getRecorderList())
11
 >>> len(be.getFreeRecorderList())
10

get information on current recording
 >>> be.getCurrentRecording(7)
<Program 'XXI Winter Olympics','2010-02-18 01:30:00' at 0x803c3d1d0>
 >>> be.getCurrentRecording(7).title
u'XXI Winter Olympics'
 >>> be.getCurrentRecording(7).subtitle
u'Snowboarding, Speed Skating, Skiing'

get frontend information while moving around the menus
 >>> db = MythDB()
 >>> fe = db.getFrontend('mythbe')
 >>> fe.sendQuery('location')
'Playback LiveTV 00:01:23 of 00:01:44 1x 4642 2010-02-18T01:30:00 2493 
/mnt/mythtv/fserve_1/video/4642_20100218030043.mpg 25'
 >>> fe.sendQuery('location')
'mainmenu'
 >>> fe.sendQuery('location')
'playbackbox'
 >>> fe.sendQuery('location')
'Playback Recorded 00:00:00 of 01:00:54 1x 2059 2010-02-17T22:00:00 2 
/mnt/mythtv/fserve_3/video/2059_20100217220000.mpg 29.97'




More information about the mythtv-users mailing list