troubleshooting no response to wmi query on remote server

From: Jim Lancaster (jlancaster_at_sagiss.com)
Date: 06/13/04

  • Next message: Alex K. Angelopoulos [MVP]: "Re: Shutdown failing with WMI"
    Date: Sun, 13 Jun 2004 09:19:28 -0500
    
    

    I've written a perl script to query the event logs on remote servers.
    It works pretty flawlessly except on a few servers, from which I
    receive no response at all--the script just appears to hang.

    I tried adding ",,48" to the end of the ExecQuery statement to convert
    it to a semi-synchronous query. The script no longer hangs on the
    problematic servers, but closer inspection revealed the query no
    longer returned any data either, even on the previously working
    remotes. (Not optimal. <g>)

    The pertinent bits of code follow:

    if (my $wmi =
    Win32::OLE->GetObject("WinMgmts:{impersonationLevel=impersonate}!//$value->{'Registration'}->{'Hostname'}"))
    {
        foreach my $log (in $wmi->InstancesOf("Win32_NTEventlogFile")) {
            my $query = "Select * from Win32_NTLogEvent where Logfile =
    '".
                                    $log->{'Name'}.
                                    "' AND RecordNumber > ".

    $value->{'LogfileName'}->{'LastRecordRead'};
              my $list = $wmi->ExecQuery($query,,48);
             ...do something with the results here...
        }
    }

    In checking the wbemcore.log on a problematic remote server, I see
    many instances of the following:

    (Sun Jun 13 08:55:57 2004) : Loading provider(Sun Jun 13 08:55:57
    2004) : Error 1 occured executing queued request

    These are the trouble-shooting steps I've tried so far based on info
    gleaned from various sources: (Note: These changes were made on the
    remote server and NOT the one running the query.)
    1. Stopped WMI service, deleted repository directory & cleared log
    directory and restarted.
    2. Increased values for keys in
    HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\WBEM\CIMOM as follows:
        "Low Threshold On Client Objects (B)"="40000000"
        "High Threshold On Client Objects (B)"="80000000"
    3. Checked to make sure DCOM was turned on at
    HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Ole as follows:
    "EnableDCOM"="Y"
    4. Cleared all event logs.

    I'm inclined to think the problem lies with the format of the
    semi-synchronous query (i.e., ",,48"). From what I've read, I really
    need this option to keep from sending some W2K servers into permanent
    high utilization states. I've tried using ",,48" as in my example,
    and at the end of the $query string. Neither worked.

    Help anyone?

    Thanks,

    Jim


  • Next message: Alex K. Angelopoulos [MVP]: "Re: Shutdown failing with WMI"

    Relevant Pages

    • Re: wmi across trusted domains from windows 2003
      ... The domain user under which the script is executed will need the appropriate ... permissions on the remote server you are attempting to query through the ...
      (microsoft.public.win32.programmer.wmi)
    • Re: HELP! Need AD Query for Last login
      ... query the DCs in the USA domain, how would I modify the script? ... I'm new to VB script and making this simple modification is beyond me at ... >> ' Because the lastLogon attribute is not replicated, ... Then, for each Domain Controller, ADO is used to search the ...
      (microsoft.public.scripting.vbscript)
    • Re: LDAP query information
      ... a "Dim" statement. ... script is run. ... Microsoft MVP Scripting and ADSI ... Can you please provide me info on what to do with the below query? ...
      (microsoft.public.windows.server.scripting)
    • Re: LDAP query information
      ... execution of the vbscript? ... The error message indicates the line number in the script, ... Dim strBase, strFilter, strAttributes, strQuery, adoRecordset ... ' Construct LDAP syntax query. ...
      (microsoft.public.windows.server.scripting)
    • Re: LDAP query information
      ... The error message indicates the line number in the script, ... Dim strBase, strFilter, strAttributes, strQuery, adoRecordset ... Set adoConnection = CreateObject ... ' Construct LDAP syntax query. ...
      (microsoft.public.windows.server.scripting)