Troubleshooting Data Collection Issues in SharePoint Service, Web Applications, Databases and Timer Jobs (MS Office SharePoint monitor - PowerShell Mode)

Troubleshooting Data Collection Issues in SharePoint Service, Web Applications, Databases and Timer Jobs (MS Office SharePoint monitor - PowerShell Mode)

In MS Office SharePoint monitoring, data for SharePoint Services, Web Applications, Databases, and Timer Jobs is collected using PowerShell. If these metrics are missing, follow the steps below to identify and resolve the issue:

1. Verify the Prerequisites

  1. Ensure that all the prerequisites from the Prerequisites page are fulfilled.
  2. Login to the target SharePoint Server using the same user credentials configured in Applications Manager.
  3. Open SharePoint Management Shell and run the following commands to verify data retrieval:
    1. Get-SPServiceInstance
    2. Get-SPWebApplication
    3. Get-SPContentDatabase
    4. Get-SPTimerJob
  4. Confirm that the SharePoint Server-related services are running on the target server.

2. Performance Polling

  1. In Applications Manager, go to Settings → Performance polling → Optimize Data Collection.  
  2. Choose the Monitor Type as MS Office SharePoint.
  3. From the Metric Name dropdown, select SharePoint Service / Web Applications / Databases / Timer Jobs.
  4. Ensure that the Default Polling Status is updated as required to collect the data.
  5. When troubleshooting data collection issues, make sure it is set to Collect data during every poll for each of the above metrics.

3. Execute Applications Manager's PowerShell Script

  1. Open PowerShell in Administrator mode on the Applications Manager server.
  2. Navigate to the <AppManager-Home>\working\conf\application\scripts\powershell directory.
  3. Execute the following command (replace hostname, username, and password with the credentials of the SharePoint server as used in Applications Manager). 
  4. Use CredSSP option if chosen in the monitor.
Quote
.\SPMaster.ps1 'hostname' 'username' 'password' 'WebApplication,TimerJobs,ContentDB,SharepointServices' 'CredSSP'
  1. Check if the command returns a valid output.
Notes
Note:
  1. If you encounter errors related to New-PSSession or the WinRM service, recheck the Powershell prerequisites.
  2. Use the CredSSP option when:
    1. The monitored SharePoint Server is part of a SharePoint Farm, and/or 
    2. The monitored SharePoint Server belongs to a different domain than the Applications Manager server.
  3. Refer to the CredSSP prerequisites for configuration details. 

4. Run Direct Commands from the Applications Manager Server

  1. Open PowerShell in Administrator mode on the machine where Applications Manager is installed.
  2. Execute the following commands one by one, replacing <hostname> with the SharePoint Server hostname/IP-address in the first command alone. When prompted, enter the Username and Password (use the same values configured in the SharePoint Server monitor).
Quote
$Hostname = '<hostname>'

If CredSSP is not enabled,

$session= New-PSSession -ComputerName $Hostname -Credential Get-Credential

If CredSSP is enabled,

$session= New-PSSession -ComputerName $Hostname -Authentication Credssp -Credential Get-Credential

Invoke-Command -Session $session -ScriptBlock{ Add-PsSnapin Microsoft.SharePoint.Powershell -EA 0 }

$version=Invoke-Command -Session $session -ScriptBlock{(Get-PSSnapin microsoft.sharepoint.powershell).Version.Major}

$version

Invoke-Command -Session $session -ScriptBlock{ Get-SPServiceInstance }
Invoke-Command -Session $session -ScriptBlock{ Get-SPWebApplication }
Invoke-Command -Session $session -ScriptBlock{ Get-SPContentDatabase }
Invoke-Command -Session $session -ScriptBlock{ Get-SPTimerJob }
  1. Verify that the above commands are executed successfully and return the expected output.
Notes
Note:
  1. The above commands are native PowerShell cmdlets provided by Microsoft. If they fail to run, Applications Manager will not be able to collect the data either.
  2. Contact your Server team or Microsoft support for assistance if you continue to face issues.

5. Run Direct Commands on the SharePoint Server

  1. Log in to the SharePoint Server that is being monitored.
  2. Open the SharePoint Management Shell (run as Administrator).
  3. Execute the following commands to verify if data is retrieved successfully:
Quote
Get-SPServiceInstance
Get-SPWebApplication
Get-SPContentDatabase
Get-SPTimerJob
Following are the commands used in the Applications Manager's PowerShell script to fetch the corresponding data:
  1. SharePoint Service
Quote
Invoke-Command -Session $session -ScriptBlock{Get-SPServiceInstance |Where-Object{$_.Status -ne "Disabled"}| Select-Object TypeName,Status -ErrorAction 0 -WarningAction 0}| Select * -ExcludeProperty RunspaceID, PSComputerName,PSShowComputerName| ConvertTo-Csv -NoTypeInformation | select -Skip 1
  1. Databases
Quote
Invoke-Command -Session $session -ScriptBlock{Get-SPContentDatabase | Select-Object Name, Server, @{N="DiskSizeRequired";E={$_.DiskSizeRequired/1GB}}, WebApplication, CurrentSiteCount,Status -ErrorAction 0 -WarningAction 0}| Select * -ExcludeProperty RunspaceID, PSComputerName,PSShowComputerName  | ConvertTo-Csv -NoTypeInformation | select -Skip 1
  1. Web Applications - The data received from the below command is formatted to a tabular format
Quote
Invoke-Command -Session $session -ScriptBlock{ Get-SPWebApplication }
  1. Timer Jobs - The data received from the below command is processed to get the list of Failed Timer Jobs and the count of the Successful and Failed Jobs
Quote
Invoke-Command -Session $session -ScriptBlock{ Get-SPTimerJob }

                  New to ADSelfService Plus?