I am trying to use WMI to get information from my Windows 2003 server. I decided to edit the perl script that uses WMI to get DNS info. For refrence you can check out that script at http://www.spectre256.com/w32_dns_query_stats.txt
I looked at the page http://msdn.microsoft.com/library/defau ... lasses.asp and picked the class I want to monitor. Since one of the things I want to monitor is the SMTP server, I chose Win32_PerfFormattedData_SMTPSVC_SMTPServer. So I edited the script and chagned $Win32_Class to "Win32_PerfFormattedData_PerfDisk_PhysicalDisk", $class to "WinMgmts://$computer/root", and edited $properties to
BytesReceivedPerSec for testing. However I always get the error:
Check the comptuter and class name.
No information was found on the specified class!
Does anyone know how I can get this script to work? Thanks.
Trying to edit a WMI script to return other information
Moderators: Developers, Moderators
-
- Posts: 6
- Joined: Thu Feb 17, 2005 10:02 am
-
- Posts: 6
- Joined: Thu Feb 17, 2005 10:02 am
For all you interested I figured out what the problem was. The line
must be changed to
Seems to work perfectly now
Code: Select all
my $computers = $wmi->ExecQuery("SELECT $properties FROM $Win32_Class Where CollectionId='4'");
Code: Select all
my $computers = $wmi->ExecQuery("SELECT $properties FROM $Win32_Class");
Who is online
Users browsing this forum: No registered users and 1 guest