Author |
Message |
rickbassham
|
Posted: Sun Dec 03, 2006 5:40 pm |
|
Joined: Sun Apr 16, 2006 10:30 am
Posts: 13
|
I have posted a howto on the wiki about using rrdtool to monitor system stats for your KnoppMyth box. Let me know what you think and how I could make it better. If you have any other scripts that you use, please share them.
Most of the scripts listed on the howto I borrowed/stole from other sites. I tried to leave the copyrights, but I think I missed one or two (when doing the copy/paste and modifications on my box). If you are the author of any of the scripts that aren't attributed, please correct the wiki, and thanks for the use of your script.
|
|
Top |
|
 |
Liv2Cod
|
Posted: Sun Dec 03, 2006 6:01 pm |
|
Joined: Fri May 21, 2004 11:55 pm
Posts: 1206
Location:
Silicon Valley, CA
|
Very cool idea!
It might be fun to add some more Myth-specific counters like "number of shows recorded" or "numbers of encoders in use".
It would also be fun if we could make this appear in MythWeb and give it a page that fits the style of the rest of the MythWeb site.
What an excellent starting point!
_________________ Do you code to live, or live to code? Search LinHES forum through Google
|
|
Top |
|
 |
mad_paddler
|
Posted: Mon Dec 04, 2006 3:45 am |
|
Joined: Sun Jun 12, 2005 2:39 pm
Posts: 464
Location:
UK
|
Awesome!! I was looking at installing rrdtool the other week but it looked too complicated.
|
|
Top |
|
 |
jbman
|
Posted: Mon Dec 04, 2006 5:46 am |
|
|
i tried and got
Code: Couldn't find package perl-rrdtool
|
|
Top |
|
 |
rickbassham
|
Posted: Mon Dec 04, 2006 6:20 am |
|
Joined: Sun Apr 16, 2006 10:30 am
Posts: 13
|
jbman wrote: i tried and got Code: Couldn't find package perl-rrdtool
Oops!! change perl-rrdtool to librrds-perl. I'll update the wiki

|
|
Top |
|
 |
md10md
|
Posted: Wed Dec 06, 2006 8:20 pm |
|
Joined: Sat Jun 25, 2005 7:39 pm
Posts: 162
|
Awesome, nice write up. I've got this running and blending in with my custom knoppmyth homepage, but I have a quick question. Has anybody been able to tie this in with mbmon or lm_sensors to get mobo or cpu temps? It has to be possible but I can't find a script to do this.
|
|
Top |
|
 |
rickbassham
|
Posted: Wed Dec 06, 2006 9:07 pm |
|
Joined: Sun Apr 16, 2006 10:30 am
Posts: 13
|
md10md wrote: Has anybody been able to tie this in with mbmon or lm_sensors to get mobo or cpu temps?
I've seen a few places that talk about it (can't remember where they are), but I know it is possible. Could you post your code for mixing it in with MythWeb, maybe here and the wiki? I just haven't gotten around to doing it.
I think I understand perl enough to say this:
you can assign the output from a command to an array in per like this
Code: my @diskdata = `iostat -d`;
and then access each of the lines that were output like so Code: my $firstline = $diskdata[0]; my $secondline = $diskdata[1]; my $thirdline = $diskdata[2];
and so on. Then you can split a line (on whitespace) using a regular expression like so: Code: my @linearray = split(/\s+/, $secondline);
Then you can access each of the items in the line (split by whitespace) like so Code: my $firstitem = $linearray[0]; my $seconditem = $linearray[1];
So if you know what order everything is in, it shouldn't be too difficult to set it up. The real kicker is getting the rrd database set up properly. See the link on the wiki to the rrd homepage for tutorials, and look at the examples on wiki. If you get it to work, please share your results. Also, does anyone know how to get any Myth specific stuff, as recommended by Liv2Cod? Such as channels currently being watched, etc.? It might be neat to see the graph of what channels you like. I can't say it would be terribly useful, but neat, nonetheless. Oh and I think these lines need to be removed from the rrd_disk.pl file: Code: my @memdata = `free -b -o`;
my $temp = $memdata[1];
There were for testing the script and I forgot to remove them. (I've updated the wiki.)
|
|
Top |
|
 |
md10md
|
Posted: Thu Dec 07, 2006 2:50 pm |
|
Joined: Sat Jun 25, 2005 7:39 pm
Posts: 162
|
Here's a link to the KnoppMyth web theme, just make sure you're RRD images are underneath the root web directory in a folder called "rrdtool". Just unzip the folder (making sure you back up what it replaces) to the root directory. I didn't add the rrd-disk.pl because it just had errors but it should be easy to add if you take a look at the html. Also, I change the color in the .pl files for the backround from EAEsomething to 295990, the color of my theme. Just look through the files and it should be pretty obvious. Here's an example of what it looks like.
Link to File
|
|
Top |
|
 |
md10md
|
Posted: Thu Dec 07, 2006 8:27 pm |
|
Joined: Sat Jun 25, 2005 7:39 pm
Posts: 162
|
rrd_disk.pl requires iostat which for some reason KnoppMyth doesn't have. Does anyone know how to get this?
|
|
Top |
|
 |
shade4
|
Posted: Fri Dec 08, 2006 4:24 am |
|
Joined: Mon Feb 13, 2006 7:10 pm
Posts: 36
Location:
Australia
|
Quote: rrd_disk.pl requires iostat which for some reason KnoppMyth doesn't have. Does anyone know how to get this?
iostat is part of the sysstat package - you can just apt-get it (sysstat that is). The usual caveats regarding apt-get apply of course.
_________________ LinHES 7.1, Gigabyte GA-K8NXP-SLI m/b, Athlon 64 X2 4200+, 3Gb RAM, 80GB PATA (/ & /myth), 2TB SATA (/myth/tv), Gigabyte 8600GT component-out, 2x Dvico HDTV DVB-T Lite, 1x Hauppage HVR-2200 PCIe Dual, Harmony remote with Dvico IR receiver.
|
|
Top |
|
 |
rickbassham
|
Posted: Fri Dec 08, 2006 6:51 am |
|
Joined: Sun Apr 16, 2006 10:30 am
Posts: 13
|
shade4 wrote: iostat is part of the sysstat package
Updated the wiki to add sysstat to the apt-get install list. Thanks for the catch
|
|
Top |
|
 |
tingo
|
Posted: Mon Dec 11, 2006 5:20 pm |
|
Joined: Mon Sep 19, 2005 4:41 am
Posts: 25
|
Nice, very nice!
I have a suggestion, not for the scripts, but for the web page:
- make the (rrdtool) "front" web page (index.html) display just the daily graphs for cpu, disk, etc.
Then you make each graph a link to a sub page with the complete graphs fr thart category.
Ie., if you click on the cpu graph, you will get a sub page with all the cpu graphs (daily, weekly, monthly and yearly).
_________________ Torfinn
|
|
Top |
|
 |
md10md
|
Posted: Mon Dec 11, 2006 6:04 pm |
|
Joined: Sat Jun 25, 2005 7:39 pm
Posts: 162
|
tingo wrote: Nice, very nice!
I have a suggestion, not for the scripts, but for the web page: - make the (rrdtool) "front" web page (index.html) display just the daily graphs for cpu, disk, etc. Then you make each graph a link to a sub page with the complete graphs fr thart category. Ie., if you click on the cpu graph, you will get a sub page with all the cpu graphs (daily, weekly, monthly and yearly).
It sounds like a good idea but I'd personally like to keep the graphs all on a separate page as opposed to clogging up the index.html. You're free to tinker with the stuff as much as you want though and I'd love to see any new additions or revisions.
|
|
Top |
|
 |
footeo
|
Posted: Mon Dec 11, 2006 7:38 pm |
|
Joined: Tue Aug 09, 2005 2:09 pm
Posts: 107
|
Where is the memory usage graph? I noticed I created the file rrd_mem.pl but there is no graph displayed.
_________________ P4 1.6 GHz
1.2 GB RAM
Nvidia GeForce4 MX 4000
Hauppage PVR 500 MCE
Soundblaster Live
ATI Remote Wonder II
|
|
Top |
|
 |
md10md
|
Posted: Mon Dec 11, 2006 7:41 pm |
|
Joined: Sat Jun 25, 2005 7:39 pm
Posts: 162
|
footeo wrote: Where is the memory usage graph? I noticed I created the file rrd_mem.pl but there is no graph displayed.
Did you check the .pl file to see where it was set to go? Make sure the permissions are right.
|
|
Top |
|
 |