Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > Some developer help please...

Some developer help please...
Thread Tools
genevish
Mac Enthusiast
Join Date: Jan 1999
Location: Marietta, GA, USA
Status: Offline
Reply With Quote
Nov 30, 2001, 03:04 PM
 
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
     
genevish  (op)
Mac Enthusiast
Join Date: Jan 1999
Location: Marietta, GA, USA
Status: Offline
Reply With Quote
Dec 1, 2001, 04:45 PM
 
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
     
lindberg
Dedicated MacNNer
Join Date: Jan 2001
Location: Virginia, US
Status: Offline
Reply With Quote
Dec 5, 2001, 02:59 PM
 
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 Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Top
Privacy Policy
All times are GMT -4. The time now is 10:21 PM.
All contents of these forums © 1995-2017 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.8 © 2000-2017, Jelsoft Enterprises Ltd.,