|
|
Some developer help please...
|
|
|
|
Mac Enthusiast
Join Date: Jan 1999
Location: Marietta, GA, USA
Status:
Offline
|
|
While browsing Sourceforge for cool PHP apps, I saw one called phpSysInfo. It simply shows a summary of system info on a nice web page. ( See a sample here.)
On closer inspection I saw on the forums that someone had abstracted the code. All I need is to be able to find the info from the command line, then parse it with PHP. Simple, right? So, I thought I'd take a stab at making a version for Mac OS X (Darwin).
The Darwin config file I have so far is here: http://genevish.phpwebhosting.com/class.Darwin.inc.phps, which produces this.
Most things work, but I need help with the following items:
[list=1][*]Can someone show me the output from "uptime" on an OS X box that has been up more than a week? Mine was just restarted...[*]Any ideas on where to get device info? The template I copied was parsing lines from dmesg, but that code doesn't work on OS X, and I'm a bit befuddled by what's in dmesg.[*]Where can I find swap info?[*]Does the filesystem info look right?[/list=a]
Thanks in advance for the help.
-Scott
[ 11-30-2001: Message edited by: genevish ]
[ 11-30-2001: Message edited by: genevish ]
[ 11-30-2001: Message edited by: genevish ]
|
Scott Genevish
scott AT genevish DOT org
|
|
|
|
|
|
|
|
Mac Enthusiast
Join Date: Jan 1999
Location: Marietta, GA, USA
Status:
Offline
|
|
OK, I got #1 working. Also, I joined the Darwin users mailing list, so maybe they will know where this info can be found.
-Scott
|
Scott Genevish
scott AT genevish DOT org
|
|
|
|
|
|
|
|
Dedicated MacNNer
Join Date: Jan 2001
Location: Virginia, US
Status:
Offline
|
|
Device stuff works quite differently under Darwin then other Unices -- it's all in the IOKit. The info is all there but it might be difficult to drill down to it. You can use IORegistryExplorer.app to do some manual exploration, and the "ioreg" command is the way to get at the info from the command line and/or shell scripts. It will not be fun to parse unfortunately, as there's a ton of information, most of which you want to ignore. You'll have the most luck looking just in the IOService plane, but even that has a ton of stuff listed. You'll probably find people who know better than me how to drill into the info you want on the darwin-users or darwin-development lists.
Swap info... the swap system works by putting one or more swap files in the swap directory. The directory is set in /etc/rc, /private/var/vm (or just /var/vm) by default. You'll see one or more swap files in there. It's hard to say how much space in each file is actually used. As for how much space is left... it's how much space is left on the partition the swap directory is located. The vm_stat command shows other info.
The filesystem stuff looks right. "df -k" output is pretty standard. You will see all the virtual filesytems there too.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Forum Rules
|
|
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
|
HTML code is Off
|
|
|
|
|
|
|
|
|
|
|
|