TiVo Community
TiVo Community
TiVo Community
Go Back   TiVo Community > Main TiVo Forums > TiVo UK
TiVo Community
Reply
Forum Jump
 
Thread Tools
Old 11-27-2005, 09:22 AM   #1
andyjenkins
Registered User
 
Join Date: Jul 2001
Location: England, UK
Posts: 258
TiVoWeb's get_space.c

Probably absolutely no need, but after some good success with RRD and my router, I'm now trying to get RRD working with TiVo. One of the first things I need is to obviously get some metrics.

Looking at TiVoWeb's 'Info' page - that seems to have all the info I could need (uptime, diskspace usage etc etc), but I'm struggling how to get the values extracted. I'm going to have to perl script the getting routine on my WebServer - so the format they come out of Tivo is of little concern to me.

I found 'get_space.c' but this returns some values, which I'm struggling to associate with any amount of capacity on my disks in TiVo.

Eg, an execution of get_space returns "785104 588968 310677504 21608448". According to info.itcl, there's some math done (/2/1024), but this is 162919 and means nothing to me .. is that total diskspace? If so - thats difference to what TiVoWeb's info panel is showing (which is 151698).

Any ideas?
__________________

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
| 300GB TiVo, Mode 0 & Cachecard |
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
andyjenkins is offline   Reply With Quote
Old 11-27-2005, 09:55 AM   #2
Spire
WAS PHONE
 
Spire's Avatar
 
Join Date: Jun 2001
Location: Everywhere like such as
Posts: 4,919
TC CLUB MEMBER
The call to get_totalsizes executes the get_space binary appropriate to your platform, which in turn returns four values in a single string.

The first, second, and fourth value returned by get_space are discarded. The third value is assigned to the variable totalmedia.

A second variable, usersize is calculated by taking totalmedia, dividing it by 2 and then by 1024, and then rounding down the result.

In your example, the third value returned by get_space is 310677504, which gets assigned to totalmedia. Dividing that by 2 and then 1024 and rounding that down, you get 151,698, which is assigned to usersize. This the same value that is displayed as Total Space in the Space Summary section on the Info page.
__________________
begin 644 .sig22&%I;"P@9F5L;&]W(&=E96LA`end

Last edited by Melody Chalis : Today at 03:47 AM.
Spire is offline   Reply With Quote
Old 11-27-2005, 09:58 AM   #3
andyjenkins
Registered User
 
Join Date: Jul 2001
Location: England, UK
Posts: 258
Thanks Spire, so is TotalSpace really equivical to the total amount of recording space on the disk (not free, just total - ie taking into account used and free) ?
__________________

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
| 300GB TiVo, Mode 0 & Cachecard |
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
andyjenkins is offline   Reply With Quote
Old 11-27-2005, 09:59 AM   #4
Spire
WAS PHONE
 
Spire's Avatar
 
Join Date: Jun 2001
Location: Everywhere like such as
Posts: 4,919
TC CLUB MEMBER
It appears to be the total space available for all recordings, including the hidden reserved space used for recording promotional content.

I can't vouch for the accuracy of this value; after all, it's returned by a closed-source binary, and space calculation on the TiVo platform is something of a black art to begin with. However, on my various TiVo units, it does seem to be at least in the right ballpark.
__________________
begin 644 .sig22&%I;"P@9F5L;&]W(&=E96LA`end

Last edited by Melody Chalis : Today at 03:47 AM.
Spire is offline   Reply With Quote
Old 11-27-2005, 10:09 AM   #5
andyjenkins
Registered User
 
Join Date: Jul 2001
Location: England, UK
Posts: 258
Again, thanks Spire. I should've looked further into this before posting as to getting total space though - as trying to split the further metrics out looks long winded.

Unless I simply do a http get through a perl script and parse the HTML output - but thats ugly.

Maybe I'll have a think on how (if!) to proceed.

Thanks again though - appriciate it.
__________________

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
| 300GB TiVo, Mode 0 & Cachecard |
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
andyjenkins is offline   Reply With Quote
Old 11-27-2005, 12:17 PM   #6
Spire
WAS PHONE
 
Spire's Avatar
 
Join Date: Jun 2001
Location: Everywhere like such as
Posts: 4,919
TC CLUB MEMBER
As you've seen, info.itcl does a lot of complicated stuff behind the scenes to arrive at the information that it displays. Much of what it does is buried layers deep, scattered about, and going back as far as the initialization of TiVoWeb[Plus] itself. Reimplementing all of this logic in your own script might be more trouble than it's worth.

Practically speaking, I think your idea to simply parse the output of the Info page is a step in the right direction. I'd go further and look into creating a customized version of info.itcl that dumps only the information you need -- formatted the way you want it, and without all of that messy HTML markup. That would make it much easier for your Perl script to parse, and faster to boot.
__________________
begin 644 .sig22&%I;"P@9F5L;&]W(&=E96LA`end

Last edited by Melody Chalis : Today at 03:47 AM.
Spire is offline   Reply With Quote
Old 11-28-2005, 03:30 AM   #7
tefster
Registered User
 
Join Date: Mar 2004
Location: London (NE), UK
Posts: 297
LJ has some Tivo/TivoWeb scripts pre-done which turn most of the salient data points into MRTG-ready data blocks, converting those to use with RRD should be simple.

Your best bet would be as mentioned above to just customise the info scripts to dump out the raw data, or if you write a standalone cron'd script to dump them to a text file then I have a TivoWeb module available that serves arbitrary text files back to browsers.

Failing that I do have a tool on my unix boxes I wrote which screen-scrapes HTML screens and produces RRD-ready output, which I use for pulling stats from systems which only provide statistics via HTTP-interfaces. I've been meaning for ages to tidy that up and produce scrape-maps for TivoWeb screens, I'll try and get around to that.
tefster is offline   Reply With Quote
Old 11-28-2005, 02:56 PM   #8
andyjenkins
Registered User
 
Join Date: Jul 2001
Location: England, UK
Posts: 258
Yes, I found LJ's scripts do pretty much what I'm after. Its not as flexible or complete as I'd like, but its a start at least ;o)
__________________

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
| 300GB TiVo, Mode 0 & Cachecard |
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
andyjenkins is offline   Reply With Quote
Old 11-29-2005, 06:49 PM   #9
andyjenkins
Registered User
 
Join Date: Jul 2001
Location: England, UK
Posts: 258
Anyone else using LJ's 'mrtgdata' ?

I find it's unusable - every call makes TiVo stutter in its playback - making use of the a script calling the html impossible in reality.

Anyone using the script without such an impact? Maybe some config I need on TiVo?
__________________

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
| 300GB TiVo, Mode 0 & Cachecard |
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
andyjenkins is offline   Reply With Quote
Old 11-30-2005, 02:37 PM   #10
LJ
Registered User
 
LJ's Avatar
 
Join Date: Nov 2001
Location: West Sussex, England
Posts: 773
Works fine for me Do you run lots of, ahem, other utilities on your TiVo?
__________________
Latest versions of my TiVoWeb modules: Now Playing with Folders and Sort; What's On; Show series conflicts; Showcase etc are
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
.
LJ is offline   Reply With Quote
Old 11-30-2005, 05:12 PM   #11
andyjenkins
Registered User
 
Join Date: Jul 2001
Location: England, UK
Posts: 258
Ah, the man himself

Not really .. there's TiVoWeb (obviously) and thats about it thats running at the moment I think. MSFTP etc is disabled.

What I have noticed is that half of the stats appear straight away with no stutter - its one of the stats thats causing the pause .. not sure which one though .. yet .

edit : Its the 'DiskUsed' stat ... any ideas why ?
__________________

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
| 300GB TiVo, Mode 0 & Cachecard |
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.

Last edited by andyjenkins : 11-30-2005 at 05:17 PM.
andyjenkins is offline   Reply With Quote
Old 11-30-2005, 05:40 PM   #12
LJ
Registered User
 
LJ's Avatar
 
Join Date: Nov 2001
Location: West Sussex, England
Posts: 773
Quote:
Originally Posted by andyjenkins
Ah, the man himself
Hello!

Quote:
edit : Its the 'DiskUsed' stat ... any ideas why ?
It has to trawl through all the recordings to decide what space is in use / deleted / available etc, which takes quite a few disk accesses.

I will *eventually* (Hi Ekuns, Milhouse,...! ) get around to posting the latest scripts which tidy unnecessary code in lj_mrtg and make it faster.
__________________
Latest versions of my TiVoWeb modules: Now Playing with Folders and Sort; What's On; Show series conflicts; Showcase etc are
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
.
LJ is offline   Reply With Quote
Old 12-05-2005, 05:35 PM   #13
andyjenkins
Registered User
 
Join Date: Jul 2001
Location: England, UK
Posts: 258
Hi LJ .. sorry for the delay in getting back.

Any timeframe on when this is likely to happen? This year? Next?

Not that I'm pushy or anything ;o)
__________________

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
| 300GB TiVo, Mode 0 & Cachecard |
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
andyjenkins is offline   Reply With Quote
Old 12-09-2005, 03:56 PM   #14
LJ
Registered User
 
LJ's Avatar
 
Join Date: Nov 2001
Location: West Sussex, England
Posts: 773
Quote:
Originally Posted by andyjenkins
Any timeframe on when this is likely to happen? This year? Next?
Yes

...bit busy at the moment - over the Christmas - New Year break looks like a possibility...
__________________
Latest versions of my TiVoWeb modules: Now Playing with Folders and Sort; What's On; Show series conflicts; Showcase etc are
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
.
LJ is offline   Reply With Quote
Old 12-09-2005, 07:17 PM   #15
andyjenkins
Registered User
 
Join Date: Jul 2001
Location: England, UK
Posts: 258
Marvelous

Do me a favour? Make sure you publicise it eh?
__________________

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
| 300GB TiVo, Mode 0 & Cachecard |
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
andyjenkins is offline   Reply With Quote
Old 01-29-2006, 04:40 PM   #16
andyjenkins
Registered User
 
Join Date: Jul 2001
Location: England, UK
Posts: 258
Sorry to bump and old thread, but I have today revisited my project to get all my devices monitored. TiVo is by far the most "critical" device to be monitored of course so has the highest need to get this project working.

I'm using LJ's MRTG scripts has the base for yanking out metrics from TiVo - problem is, as above, the disk calculation is causing TiVo to pause whenever I get the metrics from the TiVo - hence its not really usable (for me) in this state. I know LJ said he was going to implement some others new ideas (maybe this would be the answer to my problem) but so far, there's been no update on this.

So, has anyone got any ideas how to remove the disk calculations from lj_mrtg.itcl ? (attached).

For anyone else contemplating what the graphs look like, attached is also a screenshot from todays activity.
Attached Images
File Type: jpg tivographs.jpg (98.4 KB, 22 views)
Attached Files
File Type: zip lj_mrtg.zip (3.1 KB, 8 views)
__________________

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
| 300GB TiVo, Mode 0 & Cachecard |
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
andyjenkins is offline   Reply With Quote
Old 01-29-2006, 04:54 PM   #17
LJ
Registered User
 
LJ's Avatar
 
Join Date: Nov 2001
Location: West Sussex, England
Posts: 773
Funny you should bump this now... yesterday I got around to tidying up lj_mrtg.itcl and incorporting Ekuns suggestions (daily call detection that works on v3+ TiVos and single/dual tuner support for % recording time). All I need now is to make a generic version of the Perl script that feeds MRTG and then write some new documentation (bleh, documentation ).

Having said that the disk calculation code hasn't changed. Are you running, ahem, other things that use a lot of CPU? No one else has reported pauses when the stats are generated. Are all your hacks backgrounded? How many hacks are running?
__________________
Latest versions of my TiVoWeb modules: Now Playing with Folders and Sort; What's On; Show series conflicts; Showcase etc are
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
.
LJ is offline   Reply With Quote
Old 01-29-2006, 05:55 PM   #18
andyjenkins
Registered User
 
Join Date: Jul 2001
Location: England, UK
Posts: 258
Quote:
Originally Posted by LJ
Funny you should bump this now
Great !
Quote:
Having said that the disk calculation code hasn't changed.
Ah bum
Quote:
Are you running, ahem, other things that use a lot of CPU? No one else has reported pauses when the stats are generated. Are all your hacks backgrounded? How many hacks are running?
I rebooted TiVo last night and when she restarted (no hacks auto start as far as I'm aware) the only thing I started was TiVoWeb - thats it.

Not sure if its worthy of mention, but I have replaced the disks mind - now have the original 40GB and a new 120GB in there (160GB total). Maybe the size is just a tad too large for realistic calculations?
__________________

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
| 300GB TiVo, Mode 0 & Cachecard |
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
andyjenkins is offline   Reply With Quote
Old 01-29-2006, 08:37 PM   #19
NCG_Mike
Registered User
 
Join Date: Dec 2003
Location: Antwerp, Belgium
Posts: 38
Question

Quote:
Originally Posted by LJ
... incorporting Ekuns suggestions (daily call detection that works on v3+ TiVos and single/dual tuner support for % recording time).
I'm sorry... am I missing something given you're in Wessex?
NCG_Mike is offline   Reply With Quote
Old 01-30-2006, 03:30 AM   #20
Quinten
dutch tivo bloke
 
Join Date: Jun 2002
Location: Bucks
Posts: 49
I've done a similar thing for monitoring HDD temperature and uptime. Except that I was having problems using a TCL page for retrieving the details, so I wrote (well, took YAC and slimmed it right down) a small C program which runs on the TiVo to which you can telnet and it reports the data back and then closes the connection. This combined with a small perl script on my RRD/cacti server gives me the data nicely, and it doesn't rely on TivoWeb at all.

Have a look at my graphs. If anyone is interested in the source or binary, I can attach it here.
__________________

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.

Last edited by Quinten : 03-14-2007 at 04:18 AM.
Quinten is offline   Reply With Quote
Old 03-13-2007, 11:40 PM   #21
ekuns
Registered User
 
Join Date: Oct 2005
Location: Chicagoland
Posts: 10
LJ, any update? :-) If it's documentation that's the delay, I'll help you write some.
ekuns is offline   Reply With Quote
Old 03-14-2007, 05:35 AM   #22
mikerr
TivoCentral.co.uk
 
Join Date: Jun 2005
Location: Up North
Posts: 1,479
To solve your stuttering problem you could look at setpri, and this thread:
http://www.tivocommunity.com/tivo-vb...d.php?t=332017

heh, just noticed the time gap of the posts on this thread
__________________

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.

Last edited by mikerr : 03-14-2007 at 09:21 AM.
mikerr is offline   Reply With Quote
Reply
Forum Jump




Thread Tools


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Advertisements

TiVo Community
Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
vBulletin Skins by: Relivo Media
(C) 2008 Capable Networks LLC - All Rights Reserved. No information may be posted elsewhere without written permission.
TiVo® is a registered trademark of TiVo Inc. This site is not owned or operated by TiVo Inc.
All times are GMT -5. The time now is 03:59 AM.
OUR NETWORK: TechLore | Sling Community | Robo Community | MediaSmart Home | My Digital Entertainer | TouchSmart Community | Pogoplugged | DVR Playground