# monitor_live **Repository Path**: xiaobo0903/monitor_live ## Basic Information - **Project Name**: monitor_live - **Description**: No description available - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2021-10-12 - **Last Updated**: 2021-11-08 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README - monitor_live,是用于基于nginx+nginx-http-flv-moudle进行的直播业务的监控程序; - - 1、首先需要对于nginx-http-flv-moudle模块进行打补丁; - 补丁操作过程,请看patch目录下的README.md内容; - 2、配置nginx.conf; - 按常用方式配置nginx.conf内容,并启用rtmp服务模块的配置; - 在rtmp服务的配置内启用hls即可进行监控的使用;(hls on的状态) - 例: - rtmp { - access_log logs/rtmp_access.log; - server { - #注意端口占用 - listen 1935; - chunk_size 256; - application live { - live on; - monitor on; - mto_ip 127.0.0.1; - mto_port 39999; - mto_prometheus http://localhost:9093/api/v1/alerts; - #丢弃闲置5s的连接 - drop_idle_publisher 5s; - #meta off; - hls on; - hls_path /tmp/hls; - hls_fragment 5s; - hls_sync 100ms; - ...... - - 下面的四项是监控环境的配置项,可根据实际的情况调整(建议端口不要改); - monitor on|off,启动或关闭监控; - mto_ip,UDP包发送的服务器地址; - mto_port, UDP包发送的服务器端口; - mto_prometheus, 检测出问题后,直接通过alertmanage进行报警操作;该地址须要设置为alertmanage网关接口的地址; - 配置完成后,正常启动nginx服务即可; - 3、下载配置好的容器境像 - docker pull xiaobo0903/monitor_live:latest - 4、启动运行容器 - docker run -p 3000:3000 -p 39999:39999/udp xiaobo0903/monitor_live:latest sh /usr/bin/start.sh - 启动容器的ip地址,就是nginx.conf中配置的监控的地址; - 5、grafana的访问 - 输入http://容器地址:3000/ 会出现grafana登陆页面,用户名/密码: monitor_live/1234567890abc - - - - 其它备注: - influxdb的下载地址: - wget https://dl.influxdata.com/influxdb/releases/influxdb-1.8.4_linux_amd64.tar.gz - grafana的下载地址: - wget https://mirrors.huaweicloud.com/grafana/8.2.1/grafana-enterprise-8.2.1.linux-amd64.tar.gz