Configuring the eG Agent to Collect Usage Analytics
SharePoint Usage and Health Service application is a feature to analyze usage of SharePoint environment or troubleshooting SharePoint Issues. This application can be configured to collect two types of data: Usage data and Health data. The following tests use the Usage data collected by the application to report metrics:
- Site Usage Analytics test
- Web Application Usage Analytics test
- Browser Usage Analytics test
- User Analytics test
- Distributed Cache Usage Analytics test
- Critical and Slow Web Parts test
Usage data is about usage on SharePoint Farm, like page requests, feature use, search query latency, etc. This data is similar to IIS log, however unlike IIS logs this has additional SharePoint specific data collected like Application ID, Site ID, Web ID, Correlation ID etc. Usage data is initially stored in Usage Log file (.USAGE ) on SharePoint Server under logging directory which is later processed by Microsoft SharePoint Foundation Usage Data Import Timer job into Usage Database. Each of the tests above query the Usage Database at configured intervals to collect the metrics they require.
For these tests to run, the following pre-requisites should be fulfilled:
- A SharePoint Usage and Health Service Application should be created on the target SharePoint server;
- Usage and Health data collection should be enabled for this application
- The eG agent on the SharePoint server should be allowed to query the Usage database.
Each of these steps are detailed below.
Creating a SharePoint Usage and Health Service Application
For this, do the following:
- Login to the target SharePoint server as a user with Farm administrator privileges.
- Open the SharePoint management shell.
Then, run the following commands one after another:
New-SPUsageApplication -Name "<Name_of_application>"
For example, your command can be:
New-SPUsageApplication -Name "SharePointUsageApp"
If the command executes successfully, then your output will reveal the name of the application you created, the application type, and the application ID.
Figure 3 : Output of the command issued for creating a SharePoint Usage and Health application
Next, open the SharePoint management console and follow the node sequence, Central Administration -> Application Management -> Manage service applications, on the console. Figure 4 will then appear. Click the Manage service applications option under Service Applications in Figure 4.
When Figure 5 appears, look for an entry for the new Usage and Health application you created at step 3 above. If its available therein, it is a clear indicator that the new application has been created successfully.
Enabling Usage and Health Data Collection
To achieve this, follow the steps below:
In the SharePoint management console, select the Monitoring node under Central Administration. Then, click on the Configure usage and health data collection option under Reporting (see Figure 6).
When Figure 7 appears, select the Enable usage data collection checkbox therein.
Scroll further down Figure 9 until the Database Server and the Database Name fields visible (see Figure 10). Copy the values of these fields to a text editor. Make sure that the database server and database name parameters of the analytics tests are configured with the copied values only.