Disclaimer

This document is only collection of author’s notes, experiences and point of views. It is not, in any meaning, either complete description of the topic nor official RTB documentation. It may be inaccurate, incomplete, obsolete, misleading or completely wrong. It may even cause loss of data or damage system integrity. It may not comply with company codex, values, presentation style or economic interests or may reveal company secrets.

As such, it is absolutely prohibited to distribute this document outside of RTB & Co. GmbH. Such an action may result into legal acts against both the sender and the company. It is only intended, after review of technical and presentational correctness and accuracy, to be used as an information source for official documentation.

Always contact documentation department for information about current presentation style and allowed formats before creating customer’s documentation.

Preface

This article describes how to monitor RTB server products remotely. We have two possibilities (Spring monitor) and Prometheus.

1. Spring monitor

This is RTB application which enables to monitor current situation on the server. It is based on Spring boot admin library. Main aim is to quickly evaluate which servers run and if there are any problems. If application fails it sends e-mail to notify the operator. The monitor can be also used to monitor applications of your customers.

Assume you want to user flowing credential for server monitor. User name: 'admin' with password '#~EdP$}ou}tGVDA4*o6N'

1.1. Configuration

Example configuration is below

server:
  # Configuration of server and ssl (running without tomcat)
  port: 8089
  http2:
    enabled: true
  ssl:
    enabled: true
    key-store-type: JKS
    key-store: /rtb/cert/keystore.jks
    key-store-password: ******
    key-alias: rtb-parking

spring:
  #SMTP Server for notifications (google)
  mail:
    username: <user.name>
    password: <password>
    host: smtp.gmail.com
    port: 587
    properties:
      mail:
        smtp:
          auth: true
          starttls:
            enable: true
  # Configurataion of spring boot admin
  boot:
    admin:
      notify:
        mail:
          # Sender email address
          from: "🤖 Spring Boot Admin <noreply>"
          # Comma-delimited list of recipient email addresses
          to: operator1.your-company.de
          # Comma-delimited list of carbon copy recipient email addresses
          #cc: manager1.your-company.de
  security:
    # Credentials which clients need to use to connect to the admin server
    user:
      name: admin
      password: '#~EdP$}ou}tGVDA4*o6N'

logging:
  file:
    path: /rtb/server_monitor/logs

1.2. Configuration of connected application

In order to allow monitoring you have to do a bit of configuration.

User

Create user in PDM.control which may access server statistics. It means that he has to have role Server monitoring (ROLE_SERVER_MONITOR).

Connection to server monitor

By default are all actuators from security reasons disabled. Therefore even a user with right Server monitoring cannot see much. You have to enable actuators first. See documentation which actuators are available and how to enable them. To enable all you can use flowing configuration.

management:
  endpoints:
    web:
      exposure:
        include: "*"

User following configuration to enable connection to server monitor.

spring:
  boot:
    admin:
      client:
        enabled: true
        url: https://your-domain/server-monitor (1)
        username: admin (1)
        password: '#~EdP$}ou}tGVDA4*o6N' (1)
        instance:
          name: '🐙 control'
          service-base-url: https://your-domanin/application(2)
          metadata:
            user:
              name: <user> (2)
              password: <password> (2)
            comapny: Company (3)
            contact: (3)
              phone: +49 5252 97060
              addres: Schulze-Delitzsch-Weg 10, 33175 Bad Lippspringe
              email: parking-helpdesk@rtb-bl.de
            # Provide username and password for Spring Boot Admin Server to connect to the client
            tags: (3)
              procuction: false
              os: linux
              company: rtb
1 URL, user and password to server monitor.
2 URL, user and password to application. It has to be accessible from server monitor.
3 Optional fields to distinguish between instancies of applications.

For complete list of options check the documentation.

2. Prometheus

Prometheus (see documentation how to use it) requires user wich can access Prometheus actuator. It is located at actuator/prometheus and secured by right Server monitoring.