VBA to query Windows performance metrics

J

John

Is there any way to create a module that could return the value of
performance metrics that are viewable using the Windows Task
Manager----such as CPU usage, available memory, etc.

I'm building a "dashboard" that monitors a SQL database and would like
to capture these local metrics (ie, not the server but the local
machine instead).
 
J

John

Creating a WMI Script:http://msdn.microsoft.com/en-us/library/aa389763(VS..85).aspx
set objWMIService = GetObject("winmgmts:" & _
    "{impersonationLevel=Impersonate}!\\" & _
    Computer_B & "\root\cimv2")Set Jobs = _
    objWMIService.ExecQuery("SELECT * FROM Win32_ScheduledJob")or, using a
linked table:
Accessing the WMI Repository with the WMI ODBC Adapter (Windows)http://msdn.microsoft.com/en-us/library/aa384736(VS.85).aspx

(david)







- Show quoted text -

Thanks, David.

Question...using the linked table method, what do I need to connect to
a win2003 server from my machine. It's failing to connect. Assuming
I'm entering my credentials and IP address correctly, is there
something else I need to do?
 
D

david

dunno. You will probably need to have the DCOM service enabled,
whatever that is, probably need RPC, may need local login permission.
Does it work when you test from the ODBC administrator?
Note that you can only connect to ONE server -- it won't let you
link to your local PC as well as your 2003 server.

(david)
 
J

John

dunno.  You will probably need to have the DCOM service enabled,
whatever that is, probably need RPC, may need local login permission.
Does it work when you test from the ODBC administrator?
Note that you can only connect to ONE server -- it won't let you
link to your local PC as well as your 2003 server.

(david)






- Show quoted text -

Not sure about DCOM or RPC on the win2003 server. I do have local
admin rights on it tho. When I try to connect to the server via the
ODBC adpater in Access, it says failure...but, it comes back really
fast as if it didn't make it past step 1, whatever that is. I really
only want to query performance measures on the server. Desperate, I
installed the odbc adapter on the server, but nothing changed. Guess
this is really beyond my knowledge....too bad. Was almost there!

Thanks for your help tho.
 
J

John

dunno.  You will probably need to have the DCOM service enabled,
whatever that is, probably need RPC, may need local login permission.
Does it work when you test from the ODBC administrator?
Note that you can only connect to ONE server -- it won't let you
link to your local PC as well as your 2003 server.

(david)






- Show quoted text -

Interesting....I do see that if DCOM is disabled:
Windows Management Instrumentation (WMI) queries against remote
servers may not function correctly (according to Microsoft).

I'll look into that on the server.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top