Difference between revisions of "Monitoring With Cacti"
From MythTV Official Wiki
m (Corrected the URL for 0.25) |
|||
Line 1: | Line 1: | ||
− | {{Note box|This page is work in progress}} | + | {{Note box|This page is work in progress. This uses MythXML to grab Tuner and Encoder info so it does not work in 0.25 and newer.}} |
[http://en.wikipedia.org/wiki/Cacti_%28software%29 Cacti] is a frontend for the popular RRDTool, Cacti can produce graphing for any pollable service, which includes MythTV. While the tuner utilisation on MythWeb is usually enough to identify how much you are using your system, A Cacti graph will help you identify your peak usage. | [http://en.wikipedia.org/wiki/Cacti_%28software%29 Cacti] is a frontend for the popular RRDTool, Cacti can produce graphing for any pollable service, which includes MythTV. While the tuner utilisation on MythWeb is usually enough to identify how much you are using your system, A Cacti graph will help you identify your peak usage. |
Latest revision as of 15:09, 30 May 2013
Note: This page is work in progress. This uses MythXML to grab Tuner and Encoder info so it does not work in 0.25 and newer.
Cacti is a frontend for the popular RRDTool, Cacti can produce graphing for any pollable service, which includes MythTV. While the tuner utilisation on MythWeb is usually enough to identify how much you are using your system, A Cacti graph will help you identify your peak usage.
Tuner usage statisics
#!/usr/bin/php <? $fh = fopen('http://localhost:6544/Status/GetStatus', 'r'); $xmlstr = stream_get_contents($fh); fclose($fh); $xml = new SimpleXMLElement($xmlstr); $total = $xml->Encoders['count']; $active = 0; $inactive = 0; foreach ($xml->Encoders->Encoder as $encoder) { switch($encoder['state']) { case 0: $inactive = $inactive + 1; break; default: $active = $active + 1; } } //print_r($xml); print "total:$total active:$active inactive:$inactive\n"; ?>
Pending Job Queue
#!/usr/bin/php <? $fh = fopen('http://localhost:6544/Status/GetStatus', 'r'); $xmlstr = stream_get_contents($fh); fclose($fh); $xml = new SimpleXMLElement($xmlstr); $total = $xml->JobQueue['count']; $running = 0; $queued = 0; $error = 0; foreach ($xml->JobQueue->Job as $job) { switch($job['status']) { case 0: $running = $running + 1; break; case 1: $queued = $queued + 1; break; case 304: $error = $error + 1; break; } } //print_r($xml); print "total:$total running:$running queued:$queued error:$error\n"; ?>