Applies to:
Denodo 8.0
,
Denodo 7.0
,
Denodo 6.0
Last modified on: 25 May 2020
Tags:
Administration
Monitoring
This document describes how to create a Windows PowerShell script that can be used to alert if a Denodo Virtual DataPort (VDP) server is stopped and to attempt to start it again. The script will also store the historical status of the VDP server to a log file.
Keep in mind that this article applies to Denodo servers started as Windows services. If you start your server as a Process, refer to the Automating status check and startup of Denodo processes article.
The following script will check the status of the Virtual DataPort service and will try to restart it if stopped. A similar script can be used to check the status of any Denodo service.
#################################################### # # # Virtual DataPort service status notifier # # # #################################################### #-------------------Configuration------------------ Param( [string]$vdpServiceName, [string]$denodoHome, [string]$logFilePath ) #------------------------------------------------- function taskbarNotification($status){ [void] [System.Reflection.Assembly]::LoadWithPartialName("System.Windows.Forms") $objNotifyIcon = New-Object System.Windows.Forms.NotifyIcon $objNotifyIcon.Icon = ($denodoHome + "\resources\Denodo\ico\denodo_platform.ico") $objNotifyIcon.BalloonTipText = ("VDP Server is " + $status) $objNotifyIcon.BalloonTipTitle = "Denodo Platform 8.0" $objNotifyIcon.Visible = $True $objNotifyIcon.ShowBalloonTip(10000) } function logStatus($status){ $status = ((Get-Date).ToString() + " " +$status) Add-Content $logFilePath $status } if((Get-Service -Name $vdpServiceName).Status -eq "Stopped"){ taskbarNotification("stopped") logStatus("VDP Server is stopped") Start-Service $vdpServiceName if((Get-Service -Name $vdpServiceName).Status -eq "Running"){ taskbarNotification("running") logStatus("VDP Server is running") Exit } else{ taskbarNotification("stopped. Unable to start the service.") logStatus("VDP Server is stopped. Unable to start the service.") Exit } } else{ logStatus("VDP Server is running") } |
1. Copy it to a text editor and save it to any location, for instance: C:\vdpService.ps1
2. Open a command prompt as an Administrator and execute the following:
powershell -ExecutionPolicy Bypass -File C:\vdpService.ps1 -vdpServiceName "vdpserver80" -denodoHome "C:\Denodo\80" -logFilePath "C:\vdpService.log" |
where:
1. Open the Windows Task Scheduler (Control Panel > Administrative Tools > Task Scheduler).
2. Click on "Create Task..." in the right side pane.
3. Type in the name and description in the "General" tab and check "Run with highest privileges".
4. Use the "Trigger" tab to schedule when this task should run.
5. In the "Actions" tab, for the "Program/script" option, type the same command as for the manual execution:
powershell -ExecutionPolicy Bypass -File C:\vdpService.ps1 -vdpServiceName "vdpserver80" -denodoHome "C:\Denodo\80" -logFilePath "C:\vdpService.log" |
6. Save the task.
Note: For Denodo Platform 7.0 and 8.0, make sure to change the configuration in both Denodo Solution Manager and Denodo Platform.