Engine Troubleshooting Guide




General overview of how services are configured within an azeti Engine Installation

In order to have a general overview please read the general vm installation guide:

https://azetinetworks.atlassian.net/wiki/display/AC/azeti+Cloud+-+Install


Identifying Services on a given azeti Engine Installation

In order to identify the vm/container's one should query the *azeti-cfg* database.
To access the *azeti-cfg* database on can take a look on how Tomcat is configured to access it by looking at the {{/etc/default/tomcat8}} file.


Then we must query the table azeti_ssc_app_config to view how the applications access to the specific services:


Identifying Services on a given VM

In order to identify the services running on a VM one should look at how they are monitored, started and stopped by looking at the {{/etc/monit/conf.d/azeti_cloud_monit}} file.

For example we identify how PostgreSQL is monitored, started and stopped.



API Test

The objective of the api/test call is to have an automated way of checking the status of the inner applications services by directly sending an event message from a simulated gateway (a SiteController called CloudCheck and a Sensor called CloudTest) and then checking all the internals trough this message and asserting that all the step have been performed correctly.

  1. Pre-requisites

    In order to perform this test it is mandatory to have an application user with two specific roles:

    ADMIN or OPERATOR role (In order to been able to make and API call, and subscribe to the application Topics)

    plus

    GATEWAY role (In order to send a message as a SiteController called CloudCheck for a Sensor called CloudTest).

  2. Call

    The call is a POST request to the https://azeticloudXX.azeti.net/SSCServices/api/test with the user described in the previous step.

  3. Tests Performed
    There are currently 8 Tests performed returning 0 for failure of the test or 1 for success of the test.

    1. Api
      This is the basic test of reaching the API endpoint of SSCServices/api/test plus successfully authenticating the user of the call.

    2. Database
      This is the basic test of making a relational database query for the number of locations plus checking for valid numeric result.

    3. Broker
      This is the basic test of making a Broker API request plus checking for the Store, Memory and Temp percentages and the Current Connections Count.
      In order to pass the test the Store has to be less than 75% the Memory less than 90% and the Temp less than 75% and the Current Connections Count less than 5000.

    4. BrokerPub
      This is the basic test of publishing a random event message to the Broker from the CloudTest sensor from the CloudCheck gateway.

    5. BrokerSub
      This is the basic test of making a subscription to the ACP application topic for the CloudTest sensor from the CloudCheck gateway plus checking that the random event message has been successfully received at the ACP application level within 750 milliseconds.

    6. BrokerActivity
      This test checks the Broker Queues that the ACP application uses internally and and Returns Error when one of the queues has More Than 200 Pending Messages.

      Also in case that the outbound queues has been enabled but no consumer is dequeuing (No Stomp Client connected) them deletes them in case that the Pending size is higher than 100K.
    7. TsInflux08
       This is is the basic test of making a query to the InfluxDB version 0.8 time series database to assure that the random event message has been stored within 1200 milliseconds.

    8. TsInfluxDB
      This is is the basic test of making a query to the InfluxDB version 0.13.+ time series database to assure that the random event message has been stored within 1200 milliseconds.

  4. Additional Results

    Apart from the mentioned tests, the answer also returns number of Errors (That must be 0 if all the tests returned 1) with consequent ErrorMessages.

    The number of Warnings (Independent of the success result of the tests) with consequent WarningMessages.

    The total Time spend on the tests in milliseconds.

  5. Example of a successful answer without warnigs

    "Errors": 0
    "Warnings": 0

    Note: The error counter of 0 corresponds to the all the current 8 tests being successful and delivering 1 as a result

    "Api": 1
    "Database": 1
    "Broker": 1
    "BrokerPub": 1
    "BrokerSub": 1
    "TsInflux08": 1
    "TsInfluxDB": 1
    "BrokerActivity": 1

  6. Example of an answer with ERRORS

    "Errors": 2
    "Warnings": 0

    Note: The error counter of 2 corresponds to 2 tests delivering 0 as a result.

    "TsInflux08": 0
    "BrokerActivity": 0

    Note: The error counter of 2 produced the corresponding 2 ErrorMessages with further details.

  7. About the InfoMessages
    Some details of about the InfoMessages.

    Even in the case that the test resulted with success: 1 there are InfoMessages in order to analyse in detail the performed tests.

    Note: How the InfoMessages deliver further details on how the test performed. 

    "Api Test result: user: 9303" 
    Displays that the user 9303 was successfully authenticated.

    "Database Test result: locations: 17" 
    Displays that the database test query returned 17 locations.

    "Broker Uptime result: 3 hours 8 minutes. CurrentConnections: 115. Store: 4% Memory: 0% Temp: 0%" 
    Displays the actual Broker values.

    "BrokerPub Test result: Value: -2090789709 Time: 2016-08-15T19:22:04.603Z+0200 Published: true" 
    Displays the value and timestamp of the published test event.

    "BrokerSub Test result: Value: -2090789709 Time: 2016-08-15T19:22:04.603Z+0200 Values: true Times: true Points: 1" 
    Displays the correctness of the value and timestamp of the application subscribed test event.

    "TsInflux08 Test result: Value: -2090789709 Time: 2016-08-15T19:22:04.603Z+0200 Values: true Times: true Points: 1" 
    Displays the correctness of the value and timestamp of the InfluxDB 08 stored test event.

    "TsInfluxDB Test result: Value: -2090789709 Time: 2016-08-15T19:22:04.603Z+0200 Values: true Times: true Points: 1" 
    Displays the correctness of the value and timestamp of the InfluxDB 0.13.+ stored test event.

    "BrokerActivity Test result: [With Zero Pending: 26] [Non Existing: org.apache.activemq:type=Broker,brokerName=activemq,destinationType=Queue,destinationName=*_outbound_*]" 
    Displays the Broker Queues with 0 Pending messages plus the Non Existing Queues to test.

  8. Troubleshoting
    In case that some test returns with error: 0 it is important to analyse the ErrorMessages plus the InfoMessages in order of understanding what is going on.

    Performing the same call after a minute will help to understand if it was a temporally problem (i.e.: due to a heavy load) or a more serious problem.

Troubleshooting

Some nice to have troubleshooting tips on live environments:

  1. Display current activity on PostgreSQL database

  2. InfluxDB Monitoring
    System Monitoring 
    https://github.com/influxdata/influxdb/blob/master/monitor/README.md
    How to use the SHOW STATS command and the _internal database to monitor InfluxDB
    https://www.influxdata.com/how-to-use-the-show-stats-command-and-the-_internal-database-to-monitor-influxdb/

  3.