Hello,
In this post, I would like expose the starting/stopping order and the status probing of DCTM services (PART I) (Content Server, globalr docbase, custom docbase, java method server, DFS…). In a second part (PART II), we will see a way to probe these DCTM services via a POWERSHELL script.
PART I
Stopping order:
- Documentum Java Method Server
- EMC Documentum Foundation Services
- Documentum Docbase Service mydemat
- Documentum Docbase Service globalr
- Documentum DocBroker Service Docbroker/DmDocbroker
Starting order:
- Documentum DocBroker Service Docbroker/DmDocbroker
- Documentum Docbase Service globalr
- Documentum Docbase Service mydemat
- Documentum Java Method Server
- EMC Documentum Foundation Services
Under Windows, there are the WINDOWS services for the starting/stopping of DocBroker, docbases and Java Method Server. But there are also some tools provided by DCTM for the probing status of these DCTM elements:
Docbroker :
- START : Direct use of the WINDOWS service
- STOP : Direct use of the WINDOWS service
- STATUS : Use of DCTM tool dmqdocbroker.bat provided by DCTM to check the status of docbroker (ping-test on port 1489) ex : “D:\Documentum\product\7.2\bin\dmqdocbroker.bat -t mydctmserver -s -c ping -p 1489”
Docbase :
- START : Direct use of the WINDOWS service
- STOP : Direct use of the WINDOWS service
- STATUS : Use of DCTM tool IDQL provided by DCTM (connection test) ex : “D:\Documentum\product\7.2\bin\idql.exe globalr -U$userLogin -P$userPassword -RC:\dummy.dql”
Java Method Server (JMS) :
- START : Direct use of the WINDOWS service
- STOP : Direct use of the WINDOWS service
- STATUS : Probe the URL of JMS http://myDctmServer:9080/DmMethods/servlet/DoMethod which returns the value “Documentum Java Method Server”
OR Use of DCTM tool dctmServerStatus.bat (see DmMethodServer.xml) provided by DCTM to check the status of JMS (ping-test on port 9084) ex : “D:\Documentum\jboss7.1.1\bin\dctmServerStatus.bat mydctmserver 9084” => Server is running.
Accelerated Content Server (ACS):
- START : Automatically with JMS WINDOWS service
- STOP : Automatically with JMS WINDOWS service
- STATUS : Probe the URL of ACS http://myDctmServer:9080/ACS/servlet/ACS which returns the version of ACS “ACS Server Is Running – Version : 7.1.0190.0156”.
Documentum Mail Servlet (DMS):
- START : Automatically with JMS WINDOWS service
- STOP : Automatically with JMS WINDOWS service
- STATUS : Probe the URL of DMS http://myDctmServer:9080/DmMail/servlet/DoMail which returns the value “Documentum Mail Servlet”.
Business Process Management (BPM):
- START : Automatically with JMS WINDOWS service
- STOP : Automatically with JMS WINDOWS service
- STATUS : Probe the URL of BPM http://myDctmServer:9080/bpm/servlet/DoMethod which returns the value “Documentum Java Method Server”.
PART II
In this part, we will see a way to probe the DCTM services via a POWERSHELL script.
Presentation of the POWERSHELL:
Windows PowerShell, formerly Microsoft Command Shell (MSH), is a task automation and configuration management framework from Microsoft, consisting of a command-line shell. Included in Windows 7 and associated to scripting language, it is built on the .NET Framework. PowerShell is closer to object-oriented scripting languages like Perl than shell languages, such as Bash. There is no resemblance between the PowerShell and the batch language of .BAT files on DOS/Windows. The goal of Microsoft is to make a fully integrated scripting language, with as many features as exist under Unix (and Linux) and with the same level of security. If there is no possibility to run powershell script with UC4, you must create a .bat containing the following command:
powershell.exe -ExecutionPolicy Bypass -Command “Path\xxx.ps1 …”
More information : https://en.wikipedia.org/wiki/PowerShell
Windows PowerShell ISE / Simple example
It is possible to test a POWERSHELL script directly from the “Windows PowerShell ISE” editor:

So here’s a simple POWERSHELL script test.ps1:
01 | # Script permettant de checker que l'infra Documentum est fonctionnelle |
07 | ####################### CHECK ####################### |
08 | function checkServer(){ |
09 | write-host "checking server on $env:computername..." |
12 | Invoke-WebRequest $ServerUrl > $ null |
14 | if ($?){ # check that server is up |
15 | write-host "server is up" |
18 | write-host "server is down, notification email sent" |
If you try and run a Powershell script, you could get this helpful error message.
01 | PS C:\ temp > powershell ./test.ps1 |
03 | PS C:\ temp > C:\ temp \test.ps1 |
05 | File C:\ temp \test.ps1 cannot be loaded because the execution of scripts is disabled on this system. |
06 | Impossible de charger le fichier C:\ temp \test.ps1, car l’exécution de scripts est désactivée sur ce système. |
07 | + CategoryInfo : Erreur de sécurité : (:) [], ParentContainsErrorRecordException |
08 | + FullyQualifiedErrorId : UnauthorizedAccess |
09 | + CategoryInfo : NotSpecified: (:) [], PSSecurityException |
10 | + FullyQualifiedErrorId : RuntimeException |
It is necessary to change the Execution Policy on computer using a simple Powershell command (see http://go.microsoft.com/fwlink/?LinkID=135170).
- Start the « Windows PowerShell ISE » with administrator
- Confirm the modificatoin of execution’s strategy by “Yes for all”
- PS C:\temp> Set-ExecutionPolicy Unrestricted
- Unrestricted – No restrictions; all Windows PowerShell scripts can be run.
- Restricted – No scripts can be run. Windows PowerShell can be used only in interactive mode (This is the default).
- AllSigned – Only scripts signed by a trusted publisher can be run.
- RemoteSigned – Downloaded scripts must be signed by a trusted publisher before they can be run.
- Re-execute the script
It is also possible to execute a PS script due to a BATCH script test.bat:
EXAMPLE 1 : Script “RestartMyDctmServices.ps1”
So here’s a POWERSHELL script in order to restart the DCTM services : docbroker, docbases et JMS.
01 | # RestartMyDctmServices.ps1 |
03 | $ServiceNames = New-Object System.Collections.ArrayList |
04 | $ServiceNames. Add ( 'DmServerGLOBALR' ) > $ null |
05 | $ServiceNames. Add ( 'DmServerMY_DOCBASE1_DEV' ) > $ null |
06 | $ServiceNames. Add ( 'DmServerMY_DOCBASE2_DEV' ) > $ null |
08 | $ComputerNames = New-Object System.Collections.ArrayList |
09 | $ComputerNames. Add ( 'MYDCTMSERVER' ) > $ null |
11 | foreach ($ComputerName in $ComputerNames) { |
13 | Write-Host "Restarting DmDocbroker on host $ComputerName" |
15 | $ServiceObj = Get-Service - Name "DmDocbroker" -ComputerName $ComputerName |
16 | Restart-Service -InputObj $ServiceObj |
18 | Write-Host "Stopping DmMethodServer on host $ComputerName" |
20 | $ServiceObj = Get-Service - Name "DmMethodServer" -ComputerName $ComputerName |
21 | Stop-Service -InputObj $ServiceObj |
23 | foreach ($ServiceName in $ServiceNames) { |
25 | Write-Host "Restarting $ServiceName on host $ComputerName" |
27 | $ServiceObj = Get-Service - Name $ServiceName -ComputerName $ComputerName |
28 | Restart-Service -InputObj $ServiceObj |
32 | Write-Host "Starting DmMethodServer on host $ComputerName" |
34 | $ServiceObj = Get-Service - Name "DmMethodServer" -ComputerName $ComputerName |
35 | Start-Service -InputObj $ServiceObj |
EXAMPLE 2 : Script “check_dctm_services.ps1”
So here’s a POWERSHELL script in order to probe the status of the DCTM services : docbroker, docbases et JMS.
01 | # check_dctm_services.ps1 |
05 | $userLogin= "dmadminUSER" |
06 | $userPassword= "pwd4dmadmin" |
08 | ####################### CHECK ####################### |
09 | function checkDocBroker(){ |
10 | write-host "checking Docbroker on $env:computername..." |
13 | $statusDocbrok= invoke-expression "D:\Documentum\product\7.2\bin\dmqdocbroker.bat -t mydctmserver -s -c ping -p 1489" |
14 | if ($LASTEXITCODE -eq 0){ |
15 | write-host "Docbroker is up" |
18 | write-host "Docbroker is down, notification email sent" |
22 | function checkGlobalR(){ |
23 | write-host "checking docbase globalr on $env:computername..." |
26 | $ out =(invoke-expression "D:\Documentum\product\7.2\bin\idql.exe globalr -U$userLogin -P$userPassword -RC:\dummy.dql" ) 2> $ null #dummy script (doesn 't exist), for testing docbase connection |
28 | if ($out -match "Connected to Documentum server"){ #check that docbase is up |
29 | write-host "docbase globalr is up" |
32 | write-host "docbase globalr is down, notification email sent" |
36 | function checkMyDocbase(){ |
37 | write-host "checking docbase mydocbase on $env:computername..." |
40 | $out=(invoke-expression "D:\Documentum\product\7.2\bin\idql.exe mydocbase -U$userLogin -P$userPassword -RC:\dummy.dql") 2> $null #dummy script (doesn' t exist), for testing docbase connection |
42 | if ($ out -match "Connected to Documentum server" ){ # check that docbase is up |
43 | write-host "docbase mydocbase is up" |
46 | write-host "docbase mydocbase is down, notification email sent" |
51 | write-host "checking Java Method Server on $env:computername..." |
54 | Invoke-WebRequest $JMSUrl > $ null |
56 | if ($?){ # check that JMS is up |
60 | write-host "JMS is down, notification email sent" |
Example of script’s execution via WINDOWS POWERSHELL on the DCTM server MYDCTMSERVER :
1 | C:\Scripts>powershell ./check_dctm_services.ps1 |
2 | checking Docbroker on MYDCTMSERVER... |
4 | checking docbase globalr on MYDCTMSERVER... |
6 | checking docbase mydocbase on MYDCTMSERVER... |
7 | docbase mydocbase is down, notification email sent |
8 | checking Java Method Server on MYDCTMSERVER... |
EXAMPLE 3 : Script “check_restart_dctm_services.ps1”
So here’s a POWERSHELL script in order to probe the status of JMS components (ACS, Mail, BPM) hosted on local Jboss Server. If there is a problem, the script kills all java.exe processes containing the “jboss7.1.1” command, restarts the JMS service and sends mail. This script could be executed every 5 minutes via a batch launched from a task in “Windows Task Scheduler”.
01 | # check_restart_dctm_services.ps1 |
05 | param ([String] $report) |
07 | $sender = "noreply@java.lu" |
08 | $ to = "contact@java.lu" |
09 | $server = "mysmtpserver.java.lu" |
10 | $subject = "[ERROR] Th Java Method Server on $env:computername has been restarted" |
12 | $message = new-object System.Net.Mail.MailMessage $sender, $ to , $subject, $report |
14 | $SMTPclient = new-object System.Net.Mail.SmtpClient $server |
15 | $SMTPclient.Credentials = [System.Net.CredentialCache]::DefaultNetworkCredentials |
17 | $SMTPclient.Send($message) |
20 | function CheckJMSComponentsStatus |
22 | $Urls = New-Object System.Collections.ArrayList |
28 | $Problems = New-Object System.Collections.ArrayList |
30 | foreach ($Url in $Urls) { |
31 | Write-Host "My Testing of $Url" ; |
34 | $status = [ int ][Net.WebRequest]:: Create ($Url).GetResponse().Statuscode |
36 | Write-Host "$Url is not responding." |
37 | $Problems. Add ($Url) > $ null |
42 | $Problems. Add ($Url) > $ null |
46 | if ($Problems. Count -gt 0){ |
47 | $Matches = New-Object System.Collections.ArrayList |
48 | $Matches. Add ( 'jboss7\.1\.1' ) > $ null |
50 | foreach($Match in $Matches){ |
51 | foreach($ProcessId in (Get-WmiObject Win32_Process -Filter "name = 'java.exe'" | Where -Object { $_.CommandLine -match $Match } | Select -Object ProcessId)){ |
52 | Write-Host "Killing process" $ProcessId.ProcessId |
53 | Get-Process -Id $ProcessId.ProcessId | Kill |
57 | $ServiceName = "DmMethodServer" |
59 | $ServiceObj = Get-Service - Name $ServiceName |
60 | Start-Service -InputObj $ServiceObj |
62 | SendMyReport -Report "The service $ServiceName has been restarted." |
64 | Write-Host "OK, no problem!" |
68 | CheckJMSComponentsStatus |
That’s all!!!!!
Huseyin OZVEREN
Related