About:
I run MythTV. I run Cacti. I decided to put them together and graph information about my MythTV installation.
Changelog:
- 2008-02-24 - Added transcoding graph. Thanks to a contributor.
- 2008-02-06 - Updated mythtv_parsexml.pl so it would see the commercial flagging job if the job queue length equals 1.
- 2007-11-27 - Updated mythtv_parsexml.pl to support a non-default port. Updated mythtv.xml to support mythtv_parsexml.pl changes and added vertical labels to the graph templates. If upgrading be sure to update the oldrecorded mysql count sql command.
- 2007-11-20 - Initial Release
Downloads:
Dependancies:
Instructions:
Download the mythtv xml parser for cacti. Install this file in your cacti scripts dir. On my debian system this was /usr/share/cacti/site/scripts/. Maybe try locate site/scripts to find the directory.
Import the template file using the Import Templates link on the left side. This should be the result:
Go to Data Templates. Edit the MySQL Count template and add all of the Associated RRA's. Click Save. Do this for MythTV Status as well.
Create the required Data Sources. You need a MythTV Status and 2 MySQL Counts per MythTV server you are monitoring.
Here is the MythTV Status:
For the MySQL Count data sources you need a read only user that can do a select on the recorded and oldrecorded tables of your mythtv database. This can be accomplished with a pair of grants:
- grant select on mythconverg.recorded to 'cactireadonly'@'localhost' identified by 'somepassword';
- grant select on mythconverg.oldrecorded to 'cactireadonly'@'localhost' identified by 'somepassword';
Create the recorded mysql count.
- Update the Name field to: |host_description| - MySQL Count - recorded
- Update the Internal Data Source Name field to: recorded
- Update the sql command to: select count(*) from recorded
- Update any other required Custom Data fields.
Create the oldrecorded mysql count.
- Update the Name field to: |host_description| - MySQL Count - oldrecorded
- Update the Internal Data Source Name to: oldrecorded
- Update the sql command to: select count(title) from oldrecorded where recstatus = -3
- Update any other required Custom Data fields.
Create the graphs in the Graph Managment section.
Also add a MythTV Transcoding Jobs graph using the MythTV Status (transcode) data source.
Enjoy:
Comments / Suggestions
cacti @ n0 Sp4m @ e2r4.com