Performance Utilization Monitoring?  Does OSX have programmatic access

On AIX you have <perfstat> on Win32 the PDH libraries, on unix/linux procfs
Where do I go for physical memory and cpu utilization info on OSX?
I've exhausted google, but as usually I'm probably not typing in the right keywords.
Obviously this is for a low-level C program, any input would be greatly appreciated.

Thank you so much; I took a look at mac fuse and thankfully it was open source....so I started scrolling through the source and found exactly what I needed, below is a simple C program that will pull CPU statistics. It was my test program to make sure I understood what was happening, if you ever have more questions about this please contact.
The key to all of this was investigating the mach subsystem
============================================================================
Name : GetCPUInfo.cpp
Author :
Version :
Copyright : Your copyright notice
Description : Hello World in C, Ansi-style
============================================================================
#include <stdio.h>
#include <stdlib.h>
#include <mach/mach.h>
#include <mach/mach_vm.h>
#include <mach/vm_region.h>
#include <mach/vm_statistics.h>
static processorport_arrayt processor_list;
static machportt pdefaultset = 0;
static machportt pdefault_setcontrol = 0;
static hostprivt host_priv;
static natural_t processor_count = 0;
#define EXITON_MACHERROR(msg, retval) \
if (kr != KERN_SUCCESS) { mach_error(msg ":" , kr); exit((retval)); }
int main(void) {
int i, count;
vmsizet pageSize;
vmstatistics_datat vm_stat;
kernreturnt kr;
hostcpu_load_info_datat cpu;
count = HOSTCPU_LOAD_INFOCOUNT;
hoststatistics(mach_hostself(), HOSTCPU_LOADINFO, (hostinfot)&cpu, &count);
printf("Count: %i, Idle: %i \n", count, cpu.cputicks[CPU_STATEIDLE]);
count = sizeof(vm_stat) / sizeof(natural_t);
hoststatistics(mach_hostself(), HOSTVMINFO, (hostinfo_t)&vmstat, &count);
printf("Free Pages: %i, Active Pages: %i, Inactive Pages: %i, Wired Pages: %i, Zero Filled Pages: %i\n",
vmstat.freecount, vmstat.activecount, vmstat.inactivecount, vmstat.wirecount, vmstat.zero_fillcount);
hostpage_size(mach_hostself(), &pageSize);
printf("Page Size: %i", pageSize);
return EXIT_SUCCESS;
Message was edited by: jonny5isalive

Similar Messages

  • How to install Adobe Reader on a PC which does not have Internet Access?

    Hi
    I have a neighbour who does not have Internet access. He wants to be able to open PDF files. He is using 64 bit Windows 7.  Is there a link to an EXZE file that I can download?
    Thanks
    Geoff

    Hi Geoff
    Have a look at ftp://ftp.adobe.com/pub/adobe/reader/win/
    Regards

  • OUI-10150 Directory selected does not have write access....

    Just downloaded the 10.2.0.1 version of Grid Control for Linix.
    Trying the following -
    (1) Enterprise Manager 10g Grid Control Using a new database option -> next
    (2) Select a valid directory that has the following permission 0755 oracle:dba
    (3) The installer passes all Product-Specific Prereq Checks -> next
    Then I see the following error msg -
    OUI-10150. The directory you entered does not have write access. Please enter a writable directory location ....
    Any ideas???
    Cheers.

    Which User or Group is the owner of the ORACLE_BASE?
    Note: Assuming your ORACLE_BASE is /u01/app/oracle. Your Installation will create the following homes:
    Oracle Home: /u01/app/oracle/product/db10g
    OMS Home: /u01/app/oracle/product/oms10g
    Agent Home: /u01/app/oracle/product/agent10g
    So you need to ensure that oracle user has required pernission on the ORACLE_BASE

  • User does not have sufficient access

    Hello
    I�ve got installed SUN ONE Portal Server. My problem is the following. When i have customized my portal and all this staff, sometimes when i tried to get to anonymous portal i�ve got the following error in the log file:
    09/08/2004 05:27:28:646 PM MEST: Thread[service-j2ee-3,5,main]
    WARNING: TagSwapper.doSwapFromParsedTagArray(): tag value unavailable: productName
    09/08/2004 05:27:28:654 PM MEST: Thread[service-j2ee-3,5,main]
    WARNING: TagSwapper.doSwapFromParsedTagArray(): tag value unavailable: fontFace1
    09/08/2004 05:27:28:654 PM MEST: Thread[service-j2ee-3,5,main]
    WARNING: TagSwapper.doSwapFromParsedTagArray(): tag value unavailable: productName
    09/08/2004 05:27:28:655 PM MEST: Thread[service-j2ee-3,5,main]
    WARNING: TagSwapper.doSwapFromParsedTagArray(): tag value unavailable: fontFace1
    09/08/2004 05:27:28:658 PM MEST: Thread[service-j2ee-3,5,main]
    AuthlessSessionContext.getCookieSupportMode() =>2
    09/08/2004 05:27:28:666 PM MEST: Thread[service-j2ee-3,5,main]
    WARNING: TagSwapper.doSwapFromParsedTagArray(): tag value unavailable: lastChannelName
    09/08/2004 05:27:28:667 PM MEST: Thread[service-j2ee-3,5,main]
    WARNING: TagSwapper.doSwapFromParsedTagArray(): tag value unavailable: fontFace1
    09/08/2004 05:27:28:670 PM MEST: Thread[service-j2ee-3,5,main]
    AuthlessSessionContext.getCookieSupportMode() =>2
    09/08/2004 05:27:28:712 PM MEST: Thread[service-j2ee-3,5,main]
    WARNING: TagSwapper.doSwapFromParsedTagArray(): tag value unavailable: fontFace1
    09/08/2004 05:27:28:713 PM MEST: Thread[service-j2ee-3,5,main]
    WARNING: TagSwapper.doSwapFromParsedTagArray(): tag value unavailable: productName
    09/08/2004 05:27:28:713 PM MEST: Thread[service-j2ee-3,5,main]
    WARNING: TagSwapper.doSwapFromParsedTagArray(): tag value unavailable: fontFace1
    09/08/2004 05:27:28:716 PM MEST: Thread[service-j2ee-3,5,main]
    AuthlessSessionContext.getCookieSupportMode() =>2
    09/08/2004 05:27:28:723 PM MEST: Thread[service-j2ee-3,5,main]
    WARNING: TagSwapper.doSwapFromParsedTagArray(): tag value unavailable: lastChannelName
    09/08/2004 05:27:28:733 PM MEST: Thread[service-j2ee-3,5,main]
    ERROR: DesktopServlet.handleException()
    com.sun.portal.desktop.context.ContextError: DSAMEConnection.setAttribute(): attributeName=sunPortalDesktopDpDocumentUser value=<?xm
    l version="1.0" encoding="utf-8" standalone="no"?>
    <!DOCTYPE DisplayProfile SYSTEM "jar://resources/psdp.dtd">
    "Display Profile of he anonymous user"
    Exception: com.iplanet.am.sdk.AMException: User does not have sufficient access.
    at com.sun.portal.desktop.context.DSAMEConnection.setAttribute(DSAMEConnection.java:700)
    at com.sun.portal.desktop.context.DSAMEDPUserContext.storeDPUserDocument(DSAMEDPUserContext.java:49)
    at com.sun.portal.desktop.context.PSDesktopContext.store(PSDesktopContext.java:394)
    at com.sun.portal.desktop.DesktopServlet.doGetPost(DesktopServlet.java:664)
    at com.sun.portal.desktop.DesktopServlet.service(DesktopServlet.java:288)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    at org.apache.catalina.core.StandardWrapperValve.invokeServletService(StandardWrapperValve.java:720)
    at org.apache.catalina.core.StandardWrapperValve.access$000(StandardWrapperValve.java:118)
    at org.apache.catalina.core.StandardWrapperValve$1.run(StandardWrapperValve.java:278)
    at java.security.AccessController.doPrivileged(Native Method)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:274)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:505)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:212)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:505)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:203)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:505)
    at com.iplanet.ias.web.connector.nsapi.NSAPIProcessor.process(NSAPIProcessor.java:158)
    at com.iplanet.ias.web.WebContainer.service(WebContainer.java:598)
    com.iplanet.am.sdk.AMException: User does not have sufficient access.
    at com.iplanet.am.sdk.AMDirectoryManager.setAttributes(AMDirectoryManager.java:2226)
    at com.iplanet.am.sdk.AMCacheManager.setAttributes(AMCacheManager.java:898)
    at com.iplanet.am.sdk.AMObjectImpl.store(AMObjectImpl.java:1755)
    at com.iplanet.am.sdk.AMObjectImpl.store(AMObjectImpl.java:1695)
    at com.sun.portal.desktop.context.DSAMEConnection.setAttribute(DSAMEConnection.java:698)
    at com.sun.portal.desktop.context.DSAMEDPUserContext.storeDPUserDocument(DSAMEDPUserContext.java:49)
    at com.sun.portal.desktop.context.PSDesktopContext.store(PSDesktopContext.java:394)
    at com.sun.portal.desktop.DesktopServlet.doGetPost(DesktopServlet.java:664)
    at com.sun.portal.desktop.DesktopServlet.service(DesktopServlet.java:288)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    at org.apache.catalina.core.StandardWrapperValve.invokeServletService(StandardWrapperValve.java:720)
    at org.apache.catalina.core.StandardWrapperValve.access$000(StandardWrapperValve.java:118)
    at org.apache.catalina.core.StandardWrapperValve$1.run(StandardWrapperValve.java:278)
    at java.security.AccessController.doPrivileged(Native Method)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:274)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:505)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:212)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:505)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:203)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:505)
    at com.iplanet.ias.web.connector.nsapi.NSAPIProcessor.process(NSAPIProcessor.java:158)
    at com.iplanet.ias.web.WebContainer.service(WebContainer.java:598)
    If i refresh the browser once or twice i can see the anonyomous portal.What�s the problem?
    Charly

    TagSwapper ?
    which Portal Desktop Type are you using ?
    Which Portal version ?
    /ulf

  • Loading itunes on computer that is does not have interenet access. have itunes setup on jump drive.  tried to run on computer and get the following error - "itunes64setup.exe is not a valid Win32 application"

    "itunes64setup.exe is not a valid WIN32 application"

    That suggests the installer got damaged when being downloaded to the computer that did have internet access.
    I'd first try downloading an installer from the Apple website using a different web browser (on the computer with internet access):
    http://www.apple.com/itunes/download/
    If you use Firefox instead of IE for the download (or vice versa), do you get a working installer?

  • Sql Agent Job Failed after changing job name to sa Error(The job owner does not have access )

    I changed  job owner to sa and it worked well, But now it fails saying job owner does not have sever access and shows job owner as previous owner Name even after it changed to sa?
    Help......

    EXEC msdb.dbo.sp_update_job @job_id=N'7d4d4040-b79c-4022-9d19-e449497ab60e', 
    @owner_login_name=N'sa'
    Best Regards,Uri Dimant SQL Server MVP,
    http://sqlblog.com/blogs/uri_dimant/
    MS SQL optimization: MS SQL Development and Optimization
    MS SQL Consulting:
    Large scale of database and data cleansing
    Remote DBA Services:
    Improves MS SQL Database Performance
    SQL Server Integration Services:
    Business Intelligence

  • AmAdmin user doesnt have sufficient access

    Hi,
    Can someone please tell where things would have gone wrong for me to get the problem that I have mentioned below.
    I am using Access Manager of JES 2005Q4. After installation I logged in as amadmin user and added services, users and some of the other activites that the amadmin user can do. All of a sudden I have started getting that the amadmin user doesnt have sufficient access to do any changes in the Access Manager. Wheneven I try to create something new or try to edit any existing data I get "User does not have sufficient access".
    The other insteresting thing is that I am able to log on into the Directory Server console using cn=Directory Manager user and create users which can be viewed on the Access Manager but no changes could be made from AM. I am also not able to change the password or edit the user information when I log through that user as well.
    The strange part I have deployed an application which uses the AMConfig.properties file of the AM for its login module and even through that application I am able to change the password of a particular user.
    My worry is that what could have happened to the Access Manager and how can I solve it and also to avoid this happening again? Can someone please shed some light on this becasue I am totally stuck and I am not able to proceed in anyways to solve this issue.
    Thanks & Regards,
    Soma.

    Hi Everyone
    I installed JES 2005 Q4 on Solaris 10 x86 with schema 2 and Access Manager 7. The Directory Tree is as follows:
    Sol1.nucleussoftware.com:389
    dc=nucleussoftware,dc=com (34 acis)
    DSAME Users
    Internet
    People
    Groups
    Client Data
    services
    nucleussoftware.com
    People
    Groups
    o=Netscape Root (3 acis)
    cn=Schema (6 acis)
    cn=monitor (5 acis)
    cn=config (4 acis)
    Organization DN when I ran "configutil" after running comm_dssetup.pl, was specified o=nucleussoftware,dc=nucleussoftware,dc=com
    This is fresh installation and not any migration.
    Now I create user from Access Manager, http://sol1.nucleussoftware.com/amserver
    There are two organizations 1. Nucleussoftware and 2. Nucleussoftware->nucleussoftware.com
    So I have two locations to create users in People.
    When I create user from Access Manager and try to login into WebMail, I get Login Failed.
    But when I open "startconsole" or "mpsconsole" and open Messaging Server Console and in new user's property, Account Attribute, I mark the check box, and now try to login into WebMail, I get error message, "Mailbox is on a different server".
    I am missing one attribute that I used to get with schema 1 on iPlanet 5.2 for any user, Mail Server Address.
    Please tell me the exact method of creating a user for Messaging.
    Regards
    Amit Bist

  • Where can I download a full version of Firefox that does not require internet access for installation?

    I have a computer which needs Firefox but it does not have internet access. Could I download a full stand alone version of Firefox, copy it to a USB memory stick, and install it from there?

    Yes, the Firefox download is complete - no need for a internet connection for installation.
    http://www.mozilla.com/en-US/firefox/

  • As of 2 months ago, I cannot fully access Facebook using either Safari or Firefox browsers. I have a Mac G5 running OSX 10.5.8, Safari 5.0.6 and Firefox 3.6.28. Does anyone have any sugesstions on how I can resolve this?

    As of 2 months ago, I cannot fully access Facebook using either Safari or Firefox browsers. I have a Mac G5 running OSX 10.5.8, Safari 5.0.6 and Firefox 3.6.28. Does anyone have any suggestions on how I can resolve this?

    Aha, a PPC Mac!
    The last really supported Flash for PPC was 10.1.102.64, but if it's for like Facebook or such, people have been fooling FB to think they have a later version installed.
    Texas Mac Man's Flash hack/post...
    https://discussions.apple.com/thread/3599648?tstart=0
    Flash player 11.1 hack on PowerPC - https://discussions.apple.com/message/16990862
    See in each Browser which version of Flash it thinks it has...
    http://kb2.adobe.com/cps/155/tn_15507.html

  • Your account does not have access to the forums system.

    Greetings, My name is Jeff, I'm from Netwrix Corporation, which is a Microsoft partner. I have a problem with accessing Microsoft TechNet forum. After signing-in to my account: [email protected], I go to TechNet
    forum, and get a message that:  "Your account does not have access to the forums system." And also I've noticed that all my posts were deleted from TechNet forums. Can moderators tell me why did that happen? Why didn't I receive any warning
    about my account suspension? 
    I've already submitted 2 tickets to MSDN Site Feedback Inquiry but didn't receive any answer.
    I've called Microsoft TechNet at 800-344-2121 and Professional
    Support team at 1-800-936-5800.  But everybody send me to the MSDN Site Feedback Inquiry from which I didn't get any answer.
    Anybody can help me with my problem?

    Hi,
    Is this the profile you're referencing?
    http://social.technet.microsoft.com/Profile/netwrix
    It doesn't appear to be banned, but you're definitely right about there being no activity listed.
    I'd suggest contacting the forums team directly by sending an email to fissues (at) microsoft [dot] com. The admins do monitor this forum, so you'll probably get a response here as well.
    Don't retire TechNet! -
    (Don't give up yet - 13,085+ strong and growing)

  • Error msg: Current user does not have privileges to perform product Activation

    I am running Adobe Photoshop CS 8.0 on Windows Home Vista platform.
    I keep getting this error message when I try to open Photoshop:
    Current user does not have privileges to perform product activation. Run this application from a user account with administrative privileges or contact your system administrator.
    I am the only owner & user of this software. I have re-installed the SW once (full install), and the error message went away for a while.
    Now it's come back.
    What do I do now?

    2 options:
    Either disable UAC (User Access Controls) or run the application with Administrator rights.

  • Essbase add-in error:You do not have sufficient access to perform a lock

    Hi,
    I have a user who is doing a retrieve in Excel and is getting this error on v.9.3.1:
    Essbase Error: "You do not have sufficient access to perform a lock and send on this database".
    The user is just doing a retrieve, no lock and send.
    I asked him to disable 'update mode' in add-in options (Mode tab) on each of his sheets.
    But when he open a new sheet/document Excel 2007, the 'update mode' is enabled by default.
    Where can we change that ? Is there a command to put in a .ini file?
    I check all the threads but there no answer on how to change this default setting.
    Thanks for your help,
    Marie.

    Hi Raja,
    Check this out../
    Weird problem regarding Essbase Excel plug in
    It might help
    Regards
    Amarnath

  • Error: You do not have sufficient access to perform a lock on this database

    Hi,
    Can anyone help on this.
    When user try to load data through Excel it throws the following error "You do not have sufficient access to perform a lock on this database"
    We are using Essbase 6.5.
    We have tried following options
    FIX1:
    In Microsoft Excel, under ESSBASE -> OPTIONS, under the MODE tab, the check box UPDATE MODE is checked.
    When the UPDATE MODE check box is selected retrievals will automatically lock the corresponding database area with each retrieval. Disable Update Mode to stop locking blocks automatically. In update mode, the Send command (which updates the server with data values from the spreadsheet) does not automatically unlock data after the send.
    1. Launch Microsoft Excel
    2. Select ESSBASE -> OPTIONS
    3. Select the MODE tab
    4. Uncheck "Update Mode" to return to normal mode
    This error is seen when trying to lock and send data via the Hyperion Essbase Spreadsheet Add-in into that fall within a replicated target partition definition
    1. Go to HYPERION APPLICATION MANAGER -> DATABASE -> PARTITIONMANAGER
    2. Select the relevant partition
    3. Select EDIT
    4. On the CONNECT TAB, select SETTINGS and tick the option THETARGET PARTITION CAN BE UPDATED
    Also gave write access to that user.
    Can anyone give another possible solutions.
    With thanks,
    babu

    Hi Raja,
    Check this out../
    Weird problem regarding Essbase Excel plug in
    It might help
    Regards
    Amarnath

  • What does "You do not have sufficient access privileges" mean?

    Hello Gurus!
    I am wondering what does "You do not have sufficient access privileges" mean? I have a G$ with 2 internal hard drives. One has OSX 10.3.9 loaded on it and the other has OSX 10.4.7 loaded on it. When I boot up in 10.4.7 and try to access (open or copy) anything in the the desktop, documents, library, movies, music or pictures folders in my user folder on the 10.3.9 disk, it tells me that "I do not have sufficient access privileges"! This is a single user machine and it automatically logs in as me... the administrator. I tried to look at Apple's technical documents regarding permissions and privileges, but it is very confusing with all of it's terminal commands and lingo. Does anyone know an easy (and hopefully GUI) way around this problem?
    Thanks Much,
    Mark

    If you have a different system on each HD then you do not have a single user machine. The user on one system/boot volume is not the same user as the one on the other, even if they ahve the same name and password. If you boot from the 10.3 volume, you can select your user folder, go to File-Get Info, and change the access for others to read and write and click on the apply to enclosed items button. You should then be able to boot from the other system and move stuff around as you see fit. Of course, this is not a terribly secure state to leave your system in, as anyone who can gain access to your Mac can get at everything on your 10.3 home folder.
    If you try this route, I'd suggest doing it only long enough to move everything to one home folder and then revert the access privs to the way they were.

  • Error: "You do not have suffficient access to perform a lock on this database

    Hi, <BR><BR>I have a problem with Essbase Excel Add-in, i can´t retrieve because appears this error: Error: "You do not have suffficient access to perform a lock on this database<BR><BR>Plese, help me. Idon´t have speak inglish.

    If the problem is limited to a single PC, I would suggest that you uninstall the Essbase client on that PC, reboot, and the reinstall the client including the addin. <BR><BR>It appears that some sort of macro is running on that PC that does teh login in update mode. I'd also remove all copies of any excel spreadsheets that might be involved, copying a clean version from another PC.<BR><BR>If you are using any third-party tools, like toolbars or other addins for excel and essbase, I'd clean them out also. <BR><BR>You haven't said whether a login from an new, blank spreadsheet works. If it does, the problem is in the spreadsheet you are using to retrieve the application, otherwise, the problem may be in a corrupted add-in, or even possibly with your excell installation.<BR><BR>It's hard to diagnose a problem when you haven't given us any more information about the problem. You haven't really answered any of the questions we've asked about behaviour and whether the problem existsin certain other circumstances. I'm certain that if language is a problem, someone might be able to help you in some language other than English, but generally this forum works in English because it a a common language in the Hyperion community.

Maybe you are looking for

  • Message without a solution

    every time i open my HP Deskjet 5940 i get a message:  .    " because the printer ejects ink onto the paper in a fine mist ink smudges will eventually appear on the printer and adjacent surfaces to remove use a fine cloth moistened with water.  "   F

  • FORGOT TO MAKE WINDOWS 8 RECOVERY DISKS AND UPDATED TO 8.1, FACING PROBLEMS NOW

    I brought hp pavilion g6 2301 ax laptop in august last year. i bought it online. and i wasen't prompted to make any recovery disks.(later when i talked to hp executive he told me that the os warrenty is upto only 90 days) i updated to windows 8.1 and

  • External Drive with Time Machine, booting from external drive with utilitie

    I'm using Time Machine now with a LaCie 1TB external hard drive. Everything works fine. But, I've been wondering: Can I place a program like TechTool on the external drive (that Time Machine uses) and boot from that external drive. I would like to be

  • Is there actually even a loyalty department?

    I have been a loyal VW customer for well over 10-12 years.  On the 1st I upgraded one of my 4 lines, and asked about getting some type of discount or credit for being a good customer.  I was then transferred to the "loyalty dept" which ended up being

  • Httpurlconnection and Proxy settings

    hi all, I wrote a servlet that uses an HTTPUrlConnection to get a page from a remote server and the code looks like this : url = new URL(urlstr); HttpURLConnection uc = null; System.getProperties().put( "proxySet", "true" ); System.getProperties().pu