Re: Recieving Notifications

Tech-Archive recommends: Fix windows errors by optimizing your registry

From: Shon Shah [MSFT] (shonsh_at_online.microsoft.com)
Date: 09/09/04


Date: Thu, 9 Sep 2004 14:58:24 -0700

Yes the script that Karthikeyan mentioned should be a good starting point.
The namespace and class name in the script seems to be incorrect though.
Namespace should be Root\MSCluster instead of Root\MicrosoftCluster and
class should be MSCluster_Event instead of MicrosoftCluster_Event. Given
below is the corrected script. Note that you will have to run this script on
a cluster node since "" is mentioned as the first parameter to
ConnectServer. If you want to run the script remotely you can specify
cluster name as the first parameter.

Hope this helps.

''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
''''
'' Platform SDK Server Cluster Documentation:
'' Example code for the MSCluster_EventResorceStateChange class reference
page.
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
''''

Option Explicit

Dim objClusterEvent
Dim objClusterEvents
Dim objClusterService
Dim objSWbemLocator
Dim strQuery

' Query for all resource state change events (CLUSTER_CHANGE_RESOURCE_STATE
= 0x00000100 = 256)
strQuery = "select * from MSCluster_Event where EventTypeMinor = 256"

Set objSWbemLocator = CreateObject("WbemScripting.SWbemLocator")

Set objClusterService = objSWbemLocator.ConnectServer("", "Root\MSCluster")

Set objClusterEvents = objClusterService.ExecNotificationQuery(strQuery)

Do
    Set objClusterEvent = objClusterEvents.NextEvent(300000)
    If Err = 0 Then
        WScript.Echo " Object Name :" & objClusterEvent.EventObjectName
    WScript.Echo " EventTypeMinor : 0x" &
hex(objClusterEvent.EventTypeMinor)
    WScript.Echo " EventObjectType :" & objClusterEvent.EventObjectType
    End If
Loop

-- 
Regards,
Shon Shah
Software Design Engineer/Test
Microsoft Cluster Server
This posting is provided "AS IS" with no warranties, and confers no rights.
Use of included script samples, if any, are subject to the terms specified
at http://www.microsoft.com/info/cpyright.htm
"Karthikeyan Subramanian [MSFT]" <KartSub@online.microsoft.com> wrote in
message news:%23GuN7yplEHA.1644@tk2msftngp13.phx.gbl...
> You could check sample Cluster WMI event notification script under
>
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/mscs/mscs/mscluster_eventresourcestatechange.asp
>
> -- 
> Regards,
> Karthikeyan
>
> This posting is provided "AS IS" with no warranties, and confers no
> rights.Use of included scripts, samples, if any, are subject to the terms
> specified at http://www.microsoft.com/info/cpyright.htm
>
>
> > "Aravind" <Aravind@discussions.microsoft.com> wrote in message
> > news:1EEB4C4E-C5A7-429A-8941-B85B6DB41F83@microsoft.com...
> >> Hi,
> >> Can anybody tell me how to receive the WMI Notification events for
> >> resource
> >> online/offline, group online/offline for MSCS cluster...
> >>
> >> Thanks,
> >> Aravind
> >
> >
>
>


Relevant Pages

  • Re: General Script Resource
    ... The cluster is up and running and all the resources I created are ... > I want to launch Tomcat using a general script resource. ... when I set the status of the resource to online in the ... Generic Script resource (in order to properly manage a French scheduler ...
    (microsoft.public.windows.server.clustering)
  • Re: How to Create a TCP/IP PrinterPort on a MS Cluster 2k3 via Scr
    ... XP is not in the cluster so I'm not clear on the failure question. ... the user running the script should be admin on the remote print server. ... thus the creation of the port on the node. ...
    (microsoft.public.windows.server.clustering)
  • Re: How to Create a TCP/IP PrinterPort on a MS Cluster 2k3 via Scr
    ... XP is not in the cluster so I'm not clear on the failure question. ... the user running the script should be admin on the remote print server. ... thus the creation of the port on the node. ...
    (microsoft.public.windows.server.clustering)
  • Re: Configure failover in seconds
    ... When a failover starts, it starts. ... add this script as a resource to your cluster ... Is this done in CLuster Administrator? ... before failover occurs from one node to another in Windows Server ...
    (microsoft.public.windows.server.clustering)
  • Re: Configure failover in seconds
    ... When a failover starts, it starts. ... "pause" because of your san disks who need to failover. ... add this script as a resource to your cluster ... Is this done in CLuster Administrator? ...
    (microsoft.public.windows.server.clustering)