Sandaysoft

Support forum for Cumulus weather station software
It is currently Fri May 24, 2013 5:01 am
Please click here before posting. Help me to help you!
Useful Links: Cumulus FAQ • Enhancement requests • Wiki (documentation)
Please put your approximate location into your profile
Add your web site to the Cumulus user map
Vantage Pro2 users with firmware 3.00 should upgrade to fw 3.12 and Cumulus 1.9.4

All times are UTC




Post new topic Reply to topic  [ 21 posts ]  Go to page 1, 2  Next
Author Message
 Post subject: Cumulus PC Diskspace Status Script
PostPosted: Sun Feb 20, 2011 2:40 pm 
Offline

Joined: Mon Jan 25, 2010 1:55 pm
Posts: 623
Location: Brighton, UK
Weather Station: Watson W-8681
Operating System: Vista
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.

_________________
Paul

http://www.greatcollegestreet.co.uk -Online
http://www.lehamel.eu - Online

Image Image


Top
 Profile  
 
 Post subject: Re: Cumulus PC Diskspace Status Script
PostPosted: Sun Feb 20, 2011 3:53 pm 
Offline
User avatar

Joined: Sat Jul 31, 2010 10:34 pm
Posts: 1039
Location: Anglesey, North Wales, UK
Weather Station: Fine Offset
Operating System: Windows XP
great idea buddy

_________________
Rob,
Dyffryn History on WU Dyffryn on Twitter Dyffryn on WOW
Image


Top
 Profile  
 
 Post subject: Re: Cumulus PC Diskspace Status Script
PostPosted: Sun Feb 20, 2011 10:10 pm 
Offline
User avatar

Joined: Wed Mar 03, 2010 10:20 am
Posts: 299
Location: Brisbane, Australia
Weather Station: Vantage Pro2 w/ daytime FARS
Operating System: Windows Vista SP2
Paul,

Looks good.

I'd be interested for sure.

_________________
Dan

http://www.brisbaneliveweather.com




A man with a thermometer always knows the temperature. A man with two thermometers, not so sure.


Top
 Profile  
 
 Post subject: Re: Cumulus PC Diskspace Status Script
PostPosted: Mon Feb 21, 2011 12:12 am 
Offline

Joined: Sun May 10, 2009 8:52 pm
Posts: 502
Location: Springfield, IL
Weather Station: davis vp2 Serial datalogger
Operating System: Windows 7 64-bit
Hi Paul,
like that page a lot
Beau


Top
 Profile  
 
 Post subject: Re: Cumulus PC Diskspace Status Script
PostPosted: Mon Feb 21, 2011 1:03 pm 
Offline

Joined: Tue Jan 26, 2010 8:54 am
Posts: 107
Location: Mayenne, France
Weather Station: Maplin N96GY
Operating System: Vista Home Premium SP2
Hi Paul, yes I'd be interested please :clap: . 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 :D Otherwise, I guess it would be worth requesting an enhancement to create webtags as Cumulus obviously captures that into.

_________________
Many thanks
Helen

La Locherie Weather


Top
 Profile  
 
 Post subject: Re: Cumulus PC Diskspace Status Script
PostPosted: Mon Feb 21, 2011 2:23 pm 
Offline

Joined: Mon Jan 25, 2010 1:55 pm
Posts: 623
Location: Brighton, UK
Weather Station: Watson W-8681
Operating System: Vista
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.

_________________
Paul

http://www.greatcollegestreet.co.uk -Online
http://www.lehamel.eu - Online

Image Image


Top
 Profile  
 
 Post subject: Re: Cumulus PC Diskspace Status Script
PostPosted: Mon Feb 21, 2011 2:45 pm 
Offline
Site Admin
User avatar

Joined: Mon Jun 02, 2008 6:49 pm
Posts: 17586
Location: Sanday, Orkney
Weather Station: Davis VP2
Operating System: Windows Home Server 2011
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.

_________________
Steve
Sanday Weather
----------------------------------------------------------------------------------------------------------------------------------
Like Cumulus and want to support it? Please donate! Image


Top
 Profile  
 
 Post subject: Re: Cumulus PC Diskspace Status Script
PostPosted: Mon Feb 21, 2011 3:35 pm 
Offline

Joined: Mon Jan 25, 2010 1:55 pm
Posts: 623
Location: Brighton, UK
Weather Station: Watson W-8681
Operating System: Vista
I assume that would be the uptime? That would be great.

_________________
Paul

http://www.greatcollegestreet.co.uk -Online
http://www.lehamel.eu - Online

Image Image


Top
 Profile  
 
 Post subject: Re: Cumulus PC Diskspace Status Script
PostPosted: Mon Feb 21, 2011 3:48 pm 
Offline
Site Admin
User avatar

Joined: Mon Jun 02, 2008 6:49 pm
Posts: 17586
Location: Sanday, Orkney
Weather Station: Davis VP2
Operating System: Windows Home Server 2011
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
Sanday Weather
----------------------------------------------------------------------------------------------------------------------------------
Like Cumulus and want to support it? Please donate! Image


Top
 Profile  
 
 Post subject: Re: Cumulus PC Diskspace Status Script
PostPosted: Mon Feb 21, 2011 11:26 pm 
Offline

Joined: Tue Jan 26, 2010 8:54 am
Posts: 107
Location: Mayenne, France
Weather Station: Maplin N96GY
Operating System: Vista Home Premium SP2
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, :clap: 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! :lol:

_________________
Many thanks
Helen

La Locherie Weather


Top
 Profile  
 
 Post subject: Re: Cumulus PC Diskspace Status Script
PostPosted: Mon Feb 21, 2011 11:50 pm 
Offline
Site Admin
User avatar

Joined: Mon Jun 02, 2008 6:49 pm
Posts: 17586
Location: Sanday, Orkney
Weather Station: Davis VP2
Operating System: Windows Home Server 2011
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).

_________________
Steve
Sanday Weather
----------------------------------------------------------------------------------------------------------------------------------
Like Cumulus and want to support it? Please donate! Image


Top
 Profile  
 
 Post subject: Re: Cumulus PC Diskspace Status Script
PostPosted: Mon Feb 21, 2011 11:56 pm 
Offline

Joined: Mon Jan 25, 2010 1:55 pm
Posts: 623
Location: Brighton, UK
Weather Station: Watson W-8681
Operating System: Vista
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?

_________________
Paul

http://www.greatcollegestreet.co.uk -Online
http://www.lehamel.eu - Online

Image Image


Top
 Profile  
 
 Post subject: Re: Cumulus PC Diskspace Status Script
PostPosted: Tue Feb 22, 2011 8:26 am 
Offline
Site Admin
User avatar

Joined: Mon Jun 02, 2008 6:49 pm
Posts: 17586
Location: Sanday, Orkney
Weather Station: Davis VP2
Operating System: Windows Home Server 2011
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.

_________________
Steve
Sanday Weather
----------------------------------------------------------------------------------------------------------------------------------
Like Cumulus and want to support it? Please donate! Image


Top
 Profile  
 
 Post subject: Re: Cumulus PC Diskspace Status Script
PostPosted: Tue Feb 22, 2011 1:32 pm 
Offline
User avatar

Joined: Thu Jan 07, 2010 9:44 pm
Posts: 2518
Location: Wilmslow, Cheshire, UK
Weather Station: Davis VP2
Operating System: XP SP3, Win 7
Paul

Are you using WMI to get the free disk space, most WMI get/read calls do not require elevated privileges?
Code:
PowerShell
PS C:\Users\mcrossley> get-wmiobject win32_logicaldisk | where {$_.mediatype -eq 12} | format-table deviceid, size, freespace -auto

Code:
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

_________________
Mark
Wilmslow Astro Weather


Top
 Profile  
 
 Post subject: Re: Cumulus PC Diskspace Status Script
PostPosted: Tue Feb 22, 2011 2:13 pm 
Offline

Joined: Mon Jan 25, 2010 1:55 pm
Posts: 623
Location: Brighton, UK
Weather Station: Watson W-8681
Operating System: Vista
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.

_________________
Paul

http://www.greatcollegestreet.co.uk -Online
http://www.lehamel.eu - Online

Image Image


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 21 posts ]  Go to page 1, 2  Next

All times are UTC


Who is online

Users browsing this forum: No registered users and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  

Protected by Anti-Spam ACP Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group