# Operations And Monitoring

## Page Guide

- **Use Cases**: For inspecting service status, locating faults, viewing logs, and maintaining scheduled tasks after the production environment goes live.
- **Prerequisites**: Deployment is complete, and you have server, container, database, and platform administrator permissions.
- **Check Targets**: Backend, frontend, MySQL, Redis, EMQX, time-series database, ZLMediaKit, scheduled tasks, and business logs.
- **Acceptance Criteria**: Core services run stably, key links are available, logs are traceable, and alerts and work orders form a closed loop.

## 1. Daily Inspection Checklist

| Check Item | Check Content | Exception Handling |
| --- | --- | --- |
| Web pages | Login, home, product, and device pages are accessible | Check Nginx, the backend, and the browser console |
| Backend service | Process or container is running, logs have no continuous exceptions | Check backend logs and restart abnormal services |
| MySQL | Connections, slow SQL, disk space | Optimize SQL, expand disk, clean up logs |
| Redis | Memory, connections, key expiration policy | Clean up abnormal cache, check password and network |
| EMQX | Client connections, authentication, subscriptions, rules | Check authentication APIs and ports |
| Time-series database | Writes, queries, disk usage | Check the data retention policy |
| ZLMediaKit | Live streaming, playback, Hook, recording | Check media service logs |
| Scheduled tasks | Whether report, maintenance, and sync tasks are executed | Check task logs and Quartz status |

## 2. Common Commands

Docker deployment environment:

```shell
cd /var/data
docker-compose ps
docker ps
docker logs -n 300 java
docker logs -n 200 nginx
docker logs -n 200 emqx
docker stats
```

Linux service checks:

```shell
free -h
df -h
top
ss -lntup
```

## 3. Operations Entries In The Platform

| Entry | Purpose |
| --- | --- |
| System Monitoring > Online Users | View currently logged-in online users |
| System Monitoring > Operation Logs | View key user operations |
| System Monitoring > Login Logs | View login success and failure records |
| System Monitoring > Scheduled Tasks | View and maintain Quartz tasks |
| Operations Management > Notification Logs | View notification delivery results |
| Device Detail > Device Logs | View device reporting, delivery, and exceptions |
| Video Center | View channel, streaming media, and recording status |

## 4. Business Link Inspection

After each go-live or upgrade, run through the minimal business link at least once:

1. Log in to the admin console.
2. Create or select a test product.
3. Bring a simulated device online with MQTTX.
4. Report property data.
5. Deliver commands from the platform.
6. Trigger a rule or alert.
7. Send a notification.
8. Generate a work order or report.

## 5. FAQ

### Pages open but APIs report errors

Check the backend service, Nginx proxy, API prefix, login token, backend logs, and database connection.

### Devices go offline on a large scale

Check EMQX, MQTT ports, authentication APIs, server network, security groups, and whether the protocol configuration was recently upgraded.

### Reports or maintenance tasks do not run automatically

Check scheduled task status, server time, Quartz tables, task logs, and whether tasks are duplicated or missed in a cluster environment.

### Video playback is unstable

Check ZLMediaKit, bandwidth, browser protocol compatibility, camera network, and streaming media ports.

## 6. Related Docs

* [Quick Deployment With Docker](https://www.fastbee.cn/doc/en/business/v2/install/docker.html)
* [Upgrade Guide](https://www.fastbee.cn/doc/en/business/v2/install/upgrade-guide.html)
* [Device Access Troubleshooting](https://www.fastbee.cn/doc/en/business/v2/link/access-troubleshooting.html)
* [Advanced Video Capabilities](https://www.fastbee.cn/doc/en/business/v2/manual/video-advanced.html)
