Re: Recieving Notifications
From: Shon Shah [MSFT] (shonsh_at_online.microsoft.com)
Date: 09/09/04
- Next message: Ros: "Separate logical drive (RAID 1) or only partition on logical drive (RAID 5) for quorum?"
- Previous message: Mike Rosado [MSFT]: "Re: Cluster File Share cannot be accessed by account on trusted domain"
- In reply to: Karthikeyan Subramanian [MSFT]: "Re: Recieving Notifications"
- Messages sorted by: [ date ] [ thread ]
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 > > > > > >
- Next message: Ros: "Separate logical drive (RAID 1) or only partition on logical drive (RAID 5) for quorum?"
- Previous message: Mike Rosado [MSFT]: "Re: Cluster File Share cannot be accessed by account on trusted domain"
- In reply to: Karthikeyan Subramanian [MSFT]: "Re: Recieving Notifications"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|