Monitoring

Monitoring SAS Micro Analytic Service

SAS Micro Analytic Service provides several logs to help you with monitoring. One of these is the web server error log located at SAS-configuration-directory/LevN/Web/WebServer/logs. These logs have a filename format of error_yyyy-mm-dd.number.log. In them you can find connection errors between the web server and the tcServer.
The tcServer log is called SAS-configuration-directory/LevN/Web/WebAppServer/SASServer13_X/logs/server.log. To determine whether the tcServer has started, look for a message similar to the following:
2015-06-03 16:43:13,176 INFO  (main) [org.apache.catalina.startup.Catalina]
Server startup in 36647 ms.
The catalina.out file captures the output to the console. The content is identical to the entries that are logged in the REST service log file. Whether information should be sent to console is controlled by the Log4j configuration file of the REST service.
The gemfire.log file in SAS-configuration-directory/LevN/Web/WebAppServer/SASServer13_X/logs logs the activity of GemFire, which is a third-party distributed data management platform. When the tcServer does not start up, check gemfire.log to see whether GemFire is waiting for data availability. Look for a log entry in a form that is similar to the following:
[info 2015/06/04 15:44:09.187 EDT  <localhost-startStop-1> tid=0x15]
Region /sas_gemfire_region_surrogatekeytomodulereplica initialized with data
from /10.xx.xxx.yy:/data1/SAS-configuration-directory/Lev1/Web/WebAppServer/SASServer13_1/logs
created at timestamp 1433364173611 version 0 diskStoreId 19892c25-b655-4ae7-96ed-c978dde636d2
is waiting for the data previously hosted at
[/10.xx.xxx.xx:/data/SAS-configuration-directory/Lev1/Web/WebAppServer/SASServer13_1/logs created
at timestamp 1433364164520 version 0 diskStoreId 20d2f45e-876f-4cc1-84b0-ccf6920da3e8]
to be available
The wait will eventually time out, and SAS Micro Analytic Service will not start correctly. This is most likely to happen in a clustered environment. For more information, see Cluster Deployment for SAS Micro Analytic Service.
The REST service log file is located at SAS-configuration-directory/LevN/Web/Logs/SASServer13_1/SASMicroAnalyticService1.3.log. The current day log entries are in that file. The first log entry that occurs after midnight causes the previous day's log file to roll over to another file with the format SASMicroAnalyticService1.3.log.yyyy-mm-dd. SASMicroAnalyticService1.3.log is created fresh with the first log entry. The service logs are at INFO level. Therefore, they capture start-up entries, module creation, update and deletion boundary entries, as well as errors from all operations. When there is an error, and more information must be captured to identify the cause of the error, update the REST service's Log4j configuration file to set logging level to DEBUG, and restart the service.
Log entries are tagged with an INFO, WARN, or ERROR keyword. When the REST service is started properly, there is no entry with the ERROR keyword added to the log file. When a web service request is processed successfully, the HTTP status returned is either 200, 201 or 204, depending on the context. If the HTTP status returned is 4XX (such as 400, 401, 404) or 5XX (such as 503), an error message is included in the HTTP response body. In addition, one or more ERROR entries are in the log file.
A related log file in the same directory is the SAS Micro Analytic Service log. The filename has the format SASMicroAnalyticService1.3MAS.log.yyyy-mm-dd.pid. Pid is the process ID of the JVM process that hosts SAS Micro Analytic Service. Each time the REST service restarts, a new log file is used and then the log file rolls over to another file at midnight. The SAS Micro Analytic Service log file can capture compilation errors of modules, as well as any anomaly that is encountered by the SAS Micro Analytic Service.
The application's Log4j configuration file is in the directory SAS-configuration-directory/LevN/Web/Common/LogConfig. The configuration file for the REST service log is SASMicroAnalyticService-log4j.xml. The configuration file for SAS Micro Analytic Service is SASMicroAnalyticService-log4sas.xml.

Monitoring SAS Micro Analytic Service Using SAS Environment Manager

Overview

SAS Environment Manager provides several pieces of monitoring functionality that can be used to help understand SAS Micro Analytic Service usage, check service availability, and set custom alerts.

Initialize SAS Environment Manager

To initialize SAS Environment Manager:
  1. Open the file /config/LevN/Web/SASEnvironmentManager/emi-framework/ConfigureFiles/Kits/WebServer/WebServer.properties.
  2. Make sure that kitenabled is set to TRUE.
  3. Follow the instructions found inside the file /config/LevN/Web/SASEnvironmentManager/emi-framework/SAS_Environment_Manager_Service_Architecture_Quickstart.pdf.

Access a Report

To access reports in SAS Environment Manager:
  1. Open SAS Environment Manager inside a browser (SAS Environment Manager default port is 7080).
  2. Select Report Center from the Analyze drop-down menu.
  3. Navigate to Stored Processesthen selectProductsthen selectSAS Environment Managerthen selectKitsthen selectWeb Server. Click HTTP Web Server return codes.
  4. To see all of the TKMAS HTTP requests with response codes, navigate to Classification Variables and move clientsrc from Available to Selected.
  5. Under Tabulate Report, click Subsets. Set the Where clause to filter SAS Environment Manager Data Mart table to clientsubsrc = 'SASMicroAnalyticService'.
  6. Click Run to see the report.

Monitor SAS Micro Analytic Service Downtime

To monitor SAS Micro Analytic Service downtime, select Currently Down from the Resources drop-down menu. This provides you with a list of all of the resources that are currently down.

Set Alerts

To set up custom alerts for SAS Micro Analytic Service servers:
  1. Select Browse from the Resources drop-down menu.
  2. On the Platforms tab, click the platform where SAS Micro Analytic Service is installed.
  3. Select New Platform Service from the Tools Menu.
  4. Enter a name for the new service, and select HTTP from the Service Type drop-down menu. Click OK.
  5. You should receive two messages on the service window. The first should tell you that your service has been created. The second should ask you to set the configuration properties. Click Configuration Properties in the second message.
  6. Under Configuration Properties, set the following:
    1. Set the port field. The default is 7980.
    2. Set the hostname field to the location where SAS Micro Analytic Service is installed.
    3. Set the path field to /SASMicroAnalyticService.
    4. Select GET from the method drop-down menu.
    5. Click OK.
  7. Click Alert and then Configure.
  8. Click New.
  9. Provide the information about the New Alert Definition window. Click OK.
When the condition that is specified for the alert is satisfied, an alert should be visible on the top banner of SAS Environment Manager.