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 any 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. In the event that 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
In a clustered environment, GemFire communicates with the other nodes in the cluster to determine which has the most recent cache. The sas.servers script starts the SASServer13_<n> nodes in succession. If starting them in succession is taking too long and encountering time-outs, then first make sure SASServer_1 has initialized, and then start all of the SASServer13 nodes manually. Slightly staggering manual invocations of the SASServer13_<n> servers is preferred when sas.server's successive invocation is encountering time-outs. For information on how to prevent this condition, see Cluster Deployment for SAS Micro Analytic Service.
The REST service log file is located at SAS-configuration-directory/LevN/Web/Logs/SASServer13_1/SASMicroAnalyticService2.1.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 SASMicroAnalyticService2.1.log.yyyy-mm-dd. SASMicroAnalyticService2.1.log is created fresh with the first log entry of the day. The service logs are at INFO level. Therefore, they capture start-up entries, module creation, update and deletion boundary entries, as well as any errors from all operations. When there is an error, and more information must be captured to identify the specific cause of the error, update the REST service's Log4j configuration file to set the 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 SASMicroAnalyticService2.1MAS.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 previous 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 SAS Micro Analytic Service.
The SAS Micro Analytic Service Log4j configuration files are located 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.