I found many scripts contibuted by Devilsun for windows platform
I have tested all of his scripts which are running perfect in windows 2003
(Scripts for IIS, SQL Server)
[If you have problem querying sql server in local computer itself (using wmi, see links below]
This tips are for thosee members who are facing problem using the script to query remote computer. And only for those members who are able to sucessfully querying LOCALMACHINE
I am not going to explain anyting in detail, (coz every thing is new to me, right from the cacti,php,perl,wmi)
So this is the quick solution for those who want to test it for the remote computer.
I have added all new variables, assigned
Code: Select all
#name space
my $wmipath = "root\\cimv2";
#domainname\username
my $user = "mydomain\\adminuser";
#password
my $pwd = "dumpass";
#New variable again to hold the instance of swbemlocator
my $wmiwebloc = Win32::OLE->new('WbemScripting.SWbemLocator') ||
die "Cannot access WMI on local machine: ", Win32::OLE->LastError;
#old way of creating $wmi object
#no need of $class
my $class = "WinMgmts://$computer";
my $wmi = Win32::OLE->GetObject($class);
#new way which works for both the local and remote computer
#only host name is compulsary
my $wmi = $wmiwebloc->ConnectServer($computer,$wmipath,$user,$pwd);
This are the links which helped me solving the problem querying SQL server 2000 (in both, local and remote)
http://support.microsoft.com/default.as ... -us;820847
http://support.microsoft.com/default.as ... -us;827260
connecting to remote computer
http://msdn.microsoft.com/library/defau ... mputer.asp