zk-phi / symon

Tiny graphical system monitor
289 stars 26 forks source link

Not function on windows #1

Closed theldoria closed 9 years ago

theldoria commented 9 years ago

I followed the readme and got onlythe following output: MEM:N/A% (N/AMB Swapped) CPU:N/A% BAT:N/A%

So, there is something missing in the readme: system requirements, dependecies and installation instructions.

zk-phi commented 9 years ago

please confirm that command wmic is available in your Command Prompt. (symon internally uses wmic path Win32_PageFileUsage get CurrentUsage to fetch page file informations)

andrewjss commented 9 years ago

I've just tried running symon with emacs 24.4 on windows 8.1. I get a cpu trace, but MEM & BAT say N/A, and in between updates I get:

Error running timer 'symon--update': (void-function w32-memory-info)

wmic is available and "wmic path Win32_PageFileUsage get CurrentUsage" gives: CurrentUsage 871

zk-phi commented 9 years ago

thanks. I didn't know w32-memory-info is not provided on some builds. I just made a quick fix for the problem to avoid errors, but memory/battery statuses are still N/A. Maybe these statuses can be fetched with wmic or typeperf, so I'll implement later.

andrewjss commented 9 years ago

looks like these would do: wmic os get freephysicalmemory wmic path Win32_Battery Get EstimatedChargeRemaining

also wmic ComputerSystem get TotalPhysicalMemory to get the %

Thanks...saw the fix in my twitter feed from melpa :-)

zk-phi commented 9 years ago

implemented. the latest version works fine ?

andrewjss commented 9 years ago

Almost. No error, but MEM:N/A (2158MB Swapped)

The individual parts to wmic look like they work: C:\Users\andre_000>wmic path Win32_ComputerSystem get TotalPhysicalMemory TotalPhysicalMemory 2023440384

C:\Users\andre_000>wmic path Win32_OperatingSystem get FreePhysicalMemory FreePhysicalMemory 181924

C:\Users\andre_000>wmic path Win32_Battery get EstimatedChargeRemaining EstimatedChargeRemaining 46

C:\Users\andre_000>wmic path Win32_PageFileUsage get CurrentUsage CurrentUsage 2247

andrewjss commented 9 years ago

Using git head (261546), I get: MEM:-100860% (40384 Swapped) Cpu: 91% BAT:40384%

I'll try and see what's happening. I'm an elisp beginner though...

zk-phi commented 9 years ago

hmm... can you try this one (paste somewhere and evaluate with C-x C-e) ?

(print (shell-command-to-string
        (concat "(echo path Win32_ComputerSystem get TotalPhysicalMemory"
                " && echo path Win32_OperatingSystem get FreePhysicalMemory"
                " && echo path Win32_Battery get EstimatedChargeRemaining"
                " && echo path Win32_PageFileUsage get CurrentUsage"
                " && echo exit) | wmic")))

calling wmic four times every 5 seconds seems too inefficient so I want to collect four values at once.

andrewjss commented 9 years ago

Output was (with ^M at the end of each line):

"wmic:root\cli>TotalPhysicalMemory
2023440384

wmic:root\cli>FreePhysicalMemory
273832

wmic:root\cli>EstimatedChargeRemaining
25

wmic:root\cli>CurrentUsage
2140

wmic:root\cli>"

zk-phi commented 9 years ago

thanks, i got it. output format of wmic is different from my computer.

andrewjss commented 9 years ago

Perfect. Thanks. For reference this was a Windows 8.1 machine.

zk-phi commented 9 years ago

I'm using Windows 7 and got

"wmic:root\\cli>path Win32_ComputerSystem get TotalPhysicalMemory 
TotalPhysicalMemory  
4193701888           

wmic:root\\cli>
ヘルプを表示するには \"/?\"、終了するには QUIT と入力してください。
wmic:root\\cli>path Win32_OperatingSystem get FreePhysicalMemory 
FreePhysicalMemory  
1617520             

wmic:root\\cli>
ヘルプを表示するには \"/?\"、終了するには QUIT と入力してください。
wmic:root\\cli>path Win32_Battery get EstimatedChargeRemaining 
EstimatedChargeRemaining  
100                       

wmic:root\\cli>
ヘルプを表示するには \"/?\"、終了するには QUIT と入力してください。
wmic:root\\cli>path Win32_PageFileUsage get CurrentUsage 
CurrentUsage  
1378          

wmic:root\\cli>
ヘルプを表示するには \"/?\"、終了するには QUIT と入力してください。
wmic:root\\cli>exit 
"

regexps i first used were for this output format.