Health Check & Monitoring

Overview

This guide describes how to monitor and verify the health status of the IOT application after startup. It covers health check endpoints, log analysis, and troubleshooting procedures.

Health Check Endpoints

The following endpoints are available without authentication:

Endpoint Method Description

/iot-webservice/actuator/health

GET

Spring Boot health status (used by Docker health probes)

/iot-webservice/iotw/System/version

GET

Service version and build information

/iot-webservice/iotw/System/information

POST

Application version and build details

Docker Deployment

Verify Service Status

docker compose ps

All services should show status as healthy or running.

Health Check Commands

# UI Backend health
curl http://<HOST>:8881/iot-webservice/actuator/health

# UI Backend version
curl http://<HOST>:8881/iot-webservice/iotw/System/version

# FT Device Network health
curl http://<HOST>:8383/api/actuator/health

# AI Agent health (if deployed)
curl https://<HOST>:8882/health

Docker Health Probes

Docker Compose uses built-in health checks for automatic monitoring:

# UI Backend health check (from compose.yml)
healthcheck:
  test: ["CMD", "curl", "-f", "http://localhost:8880/iot-webservice/actuator/health"]
  interval: 30s
  timeout: 3s
  start_period: 60s
  retries: 3

Log Monitoring

# All services
docker compose logs -f

# Specific service
docker compose logs -f ui-backend
docker compose logs -f portals
docker compose logs -f ft-device-network-service

# Filter for errors
docker compose logs ui-backend | grep -i error

# Backend application log (mounted volume)
tail -f /usr/local/ft-services/ft-data/ui-portals/backend/logs/application.log

# Nginx logs
tail -f /usr/local/ft-services/ft-data/ui-portals/nginx/logs/access.log
tail -f /usr/local/ft-services/ft-data/ui-portals/nginx/logs/error.log

Resource Monitoring

# Real-time container stats
docker stats

# Check exposed ports
netstat -tlnp | grep -E '8880|8881|8383|8882'
# or
ss -tlnp | grep -E '8880|8881|8383|8882'

Critical Startup Checkpoints

After starting services, verify the following in docker compose logs ui-backend:

1. Database Initialization (Liquibase)

INFO [main] liquibase.lockservice.null Successfully acquired change log lock
INFO [main] liquibase.changelog.null ChangeSet db.changelog/ui/init.xml::createIotw::vadim ran successfully
INFO [main] liquibase.lockservice.null Successfully released change log lock

2. Hazelcast Connection

INFO [hz.client_1.internal-1] HazelcastClient is CLIENT_CONNECTED

3. Spring Boot Startup Completion

INFO [main] com.friendly.iot.web.config.FtIotWebApp : Started FtIotWebApp in 24 seconds

4. Cache Initialization

INFO [main] com.friendly.commons.cache.CpeParameterNameCache - Cache size 23420

Web Interface Verification

After all services are healthy:

Service URL

Swagger UI

http://<HOST>:8881/iot-webservice/swagger-ui/index.html

Support Center

http://<HOST>:8880/support-portal/

Management Console

http://<HOST>:8880/management-console/

Troubleshooting

Service Remains Unhealthy

If a service remains unhealthy after 5 minutes:

# Check service logs
docker compose logs <service-name>

# Restart specific service
docker compose restart <service-name>

# Full restart
docker compose down && docker compose up -d

Database Connection Failed

# Test database connectivity
telnet <DB_HOST> 3306    # MySQL
telnet <DB_HOST> 1521    # Oracle

# Check environment
docker compose exec ui-backend env | grep DB_

Hazelcast Connection Failed

# Test Hazelcast connectivity
telnet <HAZELCAST_HOST> 5701

# Check environment
docker compose exec ui-backend env | grep HZ_MEMBERS

Local Deployment (DEPRECATED)

Local deployment without Docker is deprecated. Use Docker-based deployment instead.

Startup Issues

Sometimes files after editing in Linux need to be transferred from CRLF format to LF.

If application is not started, execute from bin folder:

sed -i 's/\r$//' start.sh
sed -i 's/\r$//' app.env

Configuration

Edit ${APP_HOME}/bin/app.env to adjust settings such as database connection, ACS WS parameters, ports, Hazelcast connection, LDAP configuration.

Post-Startup Directory Structure

After successful application startup, the following directories are automatically created:

  • ${APP_HOME}/logs/ - Application logs

  • ${APP_HOME}/app/static/support-center/ - Support Center Angular UI files

  • ${APP_HOME}/app/static/management-console/ - Management Console Angular UI files

Log Files

File Description

${APP_HOME}/logs/iot_web.log

Main Spring Boot application log

${APP_HOME}/logs/hikari.log

HikariCP database connection pool

${APP_HOME}/logs/acsws.log

ACS Web Service communication

${APP_HOME}/logs/liquibase.log

Database migration details

Monitoring Commands

# Log monitoring
tail -f ${LOG_DIR}/iot_web.log
grep -i "error\|exception\|failed" ${LOG_DIR}/iot_web.log

# Process monitoring
ps aux | grep java
netstat -tulpn | grep :${HTTP_PORTS}

# JVM monitoring
jstat -gc $(pgrep java)
top -p $(pgrep java)

Health Check

curl http://localhost:${HTTP_PORTS}/iot-webservice/iotw/System/version
curl http://localhost:${HTTP_PORTS}/iot-webservice/iotw/System/information