ページの先頭行へ戻る
ServerView Resource Orchestrator Express/Virtual Edition V3.4.0 導入ガイド
FUJITSU Software

C.2.1 事前準備

ここでは、インストールする前に必要なリソースについて説明します。

【Windowsマネージャー】

Resource Coordinator Web Server(Apache)用
Function Online()

    Dim objWmiProvider
    Dim objService
    Dim strServiceState

    ' Check to see if the service is running
    set objWmiProvider = GetObject("winmgmts:/root/cimv2")
    set objService = objWmiProvider.get("win32_service='サービス名'")
    strServiceState = objService.state

    If ucase(strServiceState) = "RUNNING" Then
        Online = True
    Else

        ' If the service is not running, try to start it.
        response = objService.StartService()

        ' response = 0  or 10 indicates that the request to start was accepted
        If ( response <> 0 ) and ( response <> 10 ) Then
            Online = False
        Else
            Online = True
        End If
    End If
End Function

Function Offline()

    Dim objWmiProvider
    Dim objService
    Dim strServiceState

    ' Check to see if the service is running
    set objWmiProvider = GetObject("winmgmts:/root/cimv2")
    set objService = objWmiProvider.get("win32_service='サービス名'")
    strServiceState = objService.state

    If ucase(strServiceState) = "RUNNING" Then

        response = objService.StopService()

        If ( response <> 0 ) and ( response <> 10 ) Then
            Offline = False
        Else
            Offline = True
        End If
    Else
            Offline = True
    End If
End Function

Function LooksAlive()

    Dim objWmiProvider
    Dim objService
    Dim strServiceState

    set objWmiProvider = GetObject("winmgmts:/root/cimv2")
    set objService = objWmiProvider.get("win32_service='サービス名'")
    strServiceState = objService.state

    if ucase(strServiceState) = "RUNNING" Then
        LooksAlive = True
    Else
        LooksAlive = False
    End If
End Function

Function IsAlive()

    Dim objWmiProvider
    Dim objService
    Dim strServiceState

    set objWmiProvider = GetObject("winmgmts:/root/cimv2")
    set objService = objWmiProvider.get("win32_service='サービス名'")
    strServiceState = objService.state

    if ucase(strServiceState) = "RUNNING" Then
        IsAlive= True
    Else
        IsAlive = False
    End If

End Function

スクリプト内の4ヵ所の"サービス名"には、以下のサービス名を設定してください。

  • ResourceCoordinatorWebServer(Apache)

Resource Coordinator Sub Web Server(Mongrel)用
Resource Coordinator Sub Web Server(Mongrel2)用
Function Online()

    Dim objWmiProvider
    Dim objService
    Dim strServiceState

    ' Check to see if the service is running
    set objWmiProvider = GetObject("winmgmts:/root/cimv2")
    set objService = objWmiProvider.get("win32_service='サービス名'")
    strServiceState = objService.state

    If ucase(strServiceState) = "RUNNING" Then
        Online = True
    Else

        ' If the service is not running, try to start it.
        response = objService.StartService()

        ' response = 0  or 10 indicates that the request to start was accepted
        If ( response <> 0 ) and ( response <> 10 ) Then
            Online = False
        Else
            Online = True
        End If
    End If
End Function

Function Offline()

    Dim objWmiProvider
    Dim objService
    Dim strServiceState

    ' Check to see if the service is running
    set objWmiProvider = GetObject("winmgmts:/root/cimv2")
    set objService = objWmiProvider.get("win32_service='サービス名'")
    strServiceState = objService.state

    If ucase(strServiceState) = "RUNNING" Then

        response = objService.StopService()

        If ( response <> 0 ) and ( response <> 10 ) Then
            Offline = False
        Else
            Offline = True
        End If
    Else
            Offline = True
    End If
End Function

Function LooksAlive()

    Dim objWmiProvider
    Dim objService
    Dim strServiceState
    Dim objFile

    set objWmiProvider = GetObject("winmgmts:/root/cimv2")
    set objService = objWmiProvider.get("win32_service='サービス名'")
    strServiceState = objService.state

    if ucase(strServiceState) = "RUNNING" Then
        LooksAlive = True
    Else
        liveflag=False
        set objFile = CreateObject("Scripting.FileSystemObject")
        if objFile.FileExists("インストールフォルダー\SVROR\Manager\Rails\db\rcx.restarting") Then
            liveflag = True
        End If
        LooksAlive = liveflag
    End If
End Function

Function IsAlive()

    Dim objWmiProvider
    Dim objService
    Dim strServiceState
    Dim objFile

    set objWmiProvider = GetObject("winmgmts:/root/cimv2")
    set objService = objWmiProvider.get("win32_service='サービス名'")
    strServiceState = objService.state

    if ucase(strServiceState) = "RUNNING" Then
        IsAlive= True
    Else
        liveflag=False
        set objFile = CreateObject("Scripting.FileSystemObject")
        if objFile.FileExists("インストールフォルダー\SVROR\Manager\Rails\db\rcx.restarting") Then
            liveflag = True
        End If
        IsAlive = liveflag
    End If
End Function

スクリプト内の4ヵ所の"サービス名"には、以下のサービス名を設定してください。

  • Resource Coordinator Sub Web Server(Mongrel)

  • Resource Coordinator Sub Web Server(Mongrel2)

スクリプト内の2ヶ所の"インストールフォルダー"には、マネージャーのインストール先を設定してください

【Linuxマネージャー】