Page 1 of 2
Cumulus PC Diskspace Status Script
Posted: Sun 20 Feb 2011 2:40 pm
by Synewave
Knowing that a lot of members use a dedicated PC for Cumulus and rarely look at the Cumulus console and view their webpages instead, I wondered whether anyone would be interested in a Javascript I wrote this morning.
It results in the percentage of diskspace free, total bytes used and diskspace size for your Cumulus PC to be displayed somewhere on your Cumulus webpages.
It relies on the fairly latest Beta versions of Cumulus utilising the external command facility in the Internet Settings to calculate the diskspace.
Have a look here
http://www.synewave.co.uk/gcsweather/status.php Let me know what you think, if anyone is interested in the code, I'll package it up.
Re: Cumulus PC Diskspace Status Script
Posted: Sun 20 Feb 2011 3:53 pm
by robynfali
great idea buddy
Re: Cumulus PC Diskspace Status Script
Posted: Sun 20 Feb 2011 10:10 pm
by captzero
Paul,
Looks good.
I'd be interested for sure.
Re: Cumulus PC Diskspace Status Script
Posted: Mon 21 Feb 2011 12:12 am
by n9mfk
Hi Paul,
like that page a lot
Beau
Re: Cumulus PC Diskspace Status Script
Posted: Mon 21 Feb 2011 1:03 pm
by Hillbilly
Hi Paul, yes I'd be interested please

. I'd also be interested in a bit more info that I saw in a log or diags file somewhere on the forum - Windows uptime and Cumulus uptime. I had started to think about how I could display this but got no further, so if the method you have found can get that too, great

Otherwise, I guess it would be worth requesting an enhancement to create webtags as Cumulus obviously captures that into.
Re: Cumulus PC Diskspace Status Script
Posted: Mon 21 Feb 2011 2:23 pm
by Synewave
I've just added system uptime to my status page. I'm going to work on it a bit more to show 'Number of days ago'.
Not sure how I can get the Cumulus 'started time', if Steve can provide a webtag for that at sometime it would be great.
Re: Cumulus PC Diskspace Status Script
Posted: Mon 21 Feb 2011 2:45 pm
by steve
Synewave wrote:Not sure how I can get the Cumulus 'started time', if Steve can provide a webtag for that at sometime it would be great.
Yes, I can do that. It would be in fixed format, though, e.g. "10 hours 53 minutes" and I'm afraid I have no idea whether it will come out in English or the local language on non-English systems.
Re: Cumulus PC Diskspace Status Script
Posted: Mon 21 Feb 2011 3:35 pm
by Synewave
I assume that would be the uptime? That would be great.
Re: Cumulus PC Diskspace Status Script
Posted: Mon 21 Feb 2011 3:48 pm
by steve
I know I said I wasn't adding any more features to 1.9.1, but I need to do a build anyway shortly to fix an existing web tag bug, so I'll slip this in too as it's easy. I can do any of these, if any are useful:
function GetOsVersionString : string; // e.g. "Windows XP Service Pack 1 build 2600"
function GetOsLanguageString : string; // e.g. "English"
function GetSystemUpTime : string; // e.g. "9 hours 52 minutes"
function GetProgramUpTime : string; // e.g. "15 seconds"
function GetCpuName : string; // e.g. "Intel(R) Pentium(R) 4 CPU 2.80GHz"
function GetCpuCount : integer; // number of installed CPUs (HT-CPUs count as 2)
function GetMemoryStatus : string; // e.g. "327/511 MB (free/total)"
function GetDisplayModeString : string; // e.g. "1024x768, 32 bit"
function GetAllocatedMemory : string; // e.g. "3.52 MB"
Re: Cumulus PC Diskspace Status Script
Posted: Mon 21 Feb 2011 11:26 pm
by Hillbilly
Synewave wrote:I've just added system uptime to my status page. I'm going to work on it a bit more to show 'Number of days ago'.
Perfect,

well done Paul and thanks.
steve wrote:function GetOsVersionString : string; // e.g. "Windows XP Service Pack 1 build 2600"
function GetOsLanguageString : string; // e.g. "English"
function GetSystemUpTime : string; // e.g. "9 hours 52 minutes"
function GetProgramUpTime : string; // e.g. "15 seconds"
function GetCpuName : string; // e.g. "Intel(R) Pentium(R) 4 CPU 2.80GHz"
function GetCpuCount : integer; // number of installed CPUs (HT-CPUs count as 2)
function GetMemoryStatus : string; // e.g. "327/511 MB (free/total)"
function GetDisplayModeString : string; // e.g. "1024x768, 32 bit"
function GetAllocatedMemory : string; // e.g. "3.52 MB"
Well they all seem of interest - except I don't understand GetCpuCount, what does that tell me?
Thanks Paul and Steve. For those of us with the Cumulus PC in the next room and those who are a bit further away!

Re: Cumulus PC Diskspace Status Script
Posted: Mon 21 Feb 2011 11:50 pm
by steve
Hillbilly wrote:Well they all seem of interest - except I don't understand GetCpuCount, what does that tell me?
It tells you how many processors your CPU has, e.g. mine has 4 (it's a Core 2 quad).
Re: Cumulus PC Diskspace Status Script
Posted: Mon 21 Feb 2011 11:56 pm
by Synewave
steve wrote:I know I said I wasn't adding any more features to 1.9.1, but I need to do a build anyway shortly to fix an existing web tag bug, so I'll slip this in too as it's easy. I can do any of these, if any are useful:
function GetOsVersionString : string; // e.g. "Windows XP Service Pack 1 build 2600"
function GetOsLanguageString : string; // e.g. "English"
function GetSystemUpTime : string; // e.g. "9 hours 52 minutes"
function GetProgramUpTime : string; // e.g. "15 seconds"
function GetCpuName : string; // e.g. "Intel(R) Pentium(R) 4 CPU 2.80GHz"
function GetCpuCount : integer; // number of installed CPUs (HT-CPUs count as 2)
function GetMemoryStatus : string; // e.g. "327/511 MB (free/total)"
function GetDisplayModeString : string; // e.g. "1024x768, 32 bit"
function GetAllocatedMemory : string; // e.g. "3.52 MB"
Steve, I think all these would be useful. I've hit a slight problem with my diskspace method in that the command I use requires elevated privileges, and I don't really want to be messing with that. Could a tag for free diskspace be added if Cumulus already knows?
Re: Cumulus PC Diskspace Status Script
Posted: Tue 22 Feb 2011 8:26 am
by steve
Synewave wrote:Could a tag for free diskspace be added if Cumulus already knows?
It should be there somewhere; these are all functions provided by the exception handler, and it prints out the free disk space. I'll see if I can find it.
Re: Cumulus PC Diskspace Status Script
Posted: Tue 22 Feb 2011 1:32 pm
by mcrossley
Paul
Are you using WMI to get the free disk space, most WMI get/read calls do not require elevated privileges?
Code: Select all
PowerShell
PS C:\Users\mcrossley> get-wmiobject win32_logicaldisk | where {$_.mediatype -eq 12} | format-table deviceid, size, freespace -auto
Code: Select all
UNTESTED VBScript
strComputer = "."
Set objWMIService = GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set colDisks = objWMIService.ExecQuery ("Select * from Win32_LogicalDisk where MediaType = '12'")
For Each device in colDisks
WScript.Echo device.DeviceId + " " + device.FreeSpace
Next
Re: Cumulus PC Diskspace Status Script
Posted: Tue 22 Feb 2011 2:13 pm
by Synewave
Hi Mark,
No it's not as elaborate as that. I'm simply using the fsutil command and pipe the results into a txt file.
EDIT: just looking at WMIC now to see what I can do. But as Steve is going to add some new tags which I will use, I'll just experiment for now.