sudo nano /etc/netdata/python.d/nvidiasmi.conf
updateevery: # 生产环境建议1秒;其实,高精度调试可设为1,注意CPU开销微增
priority: # 提高采集器优先级防丢点
# 启用
指标采集
enablenvmlmetrics: yes # 开启 NVML 底层指标
enablenvmlclocks: yes # 时钟频率详情
enablenvmlthrottlereasons: yes # 采集降频原因 : Thermal / Power / Reliability / Board Limit
enablepciecounters: yes # PCIe 带宽吞吐/重试计数
enablenvlinkcounters: yes # NVLink 链路吞吐/错误计数
# 排除不需要的设备
# devicefilter: "uuid:GPU-xxxx-xxxx"
sudo systemctl restart netdata
http这方面。//:
Hardware → NVIDIA GPUs → GPU
* Real-time charts for all metrics above.
* Drill-down to specific throttle reason events.
sudo nano /etc/netdata/netdata.conf
memory mode = dbengine
page cache size = # 内存缓冲区大小 MB
dbengine disk space = # 单卡约占 ~MB/天 @ updateevery=1。8卡建议分配 - GB,sudo systemctl restart netdata
tail -f /var/log/netdata/error.log | grep nvidiasmi
Permission denied → 检查 netdata 使用者是否在 video/docker/group 或配置 sudoers免密运行 nvidia-smi。No such file or directory → 检查 nvidia-smi 方法 是否在 $PATH 或插件配置中指定绝对方法。说到http,//:
菜单栏右上角切换实例下拉框 查看任意子节点 GPU Faceplate。#### Parent 配置
sudo tee /etc/netdata/stream.conf <'EOF'
enabled = yes # 开启流接收
destination = master # 指定角色为 Master 接收端 默认端口 : TCP/UDP双协议均支持, 建议生产环境走TCP 加 TLS 或 VPN 隔离网段.
api key = ===a1b2c...d4e5f # 共享密钥, Child端需填相同值 . 长度>=,建议 openssl rand -hex 生成.
allow from = * # 生产环境请限制 CIDR 范围 e.g. /
EOF
#### Child 配置
sudo tee /etc/netdata/stream.conf <'EOF'
enabled = yes # 开启流发送.
destination = parent # 指定角色为 Child 推送端 .
url = https://;
# Parent 地址 + API Key Query Param 或 Header.
: 注意若 Parent 开启 TLS 需填 https://... 若走纯内网 HTTP 去掉 s .
: 支持负载均衡写多个 URL 用空格分隔实现 HA.
: 若 Parent 在 Kubernetes Service 名为 netdatamaster-svc.namespace.svc.cluster.local :
: url = http://netdatamaster-svc::/
至于http,//backup-master::/
.
.
. 注意 URL 中必须包含 apikey 参数或 Header Authorization Bearer Token .
. Netdata v1.4+ 支持 Header Authorization Bearer 安全性更高 建议用 Header .
.
. EOF 中省略完整 URL 模板 见官网文档 Stream Server Configuration .
API KEY 配置方式二选一:
. . . . . . Option A Query Param?apikey=xxxx .
. . . Option B Header Authorization Bearer xxxx .
api key = aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee # 必须与 Parent stream.conf 中 api key 一致!怎么说呢,timeout seconds = #
buffer size bytes = DD;#
reconnect delay seconds = #
initial clock resync iterations = #
EOF
systemctl restart netdatamaster.service || systemctl restart netdataproxy.service || systemctl restart netdatasatellite.service || true
### Health Alarm Notify 配置 ———— 邮件/Webhook 推送落地 ###
#### 一键生成编辑模板 ####
/etc/netdata/edit-config healthalarmnotify.conf
#### 必改关键字段 ####
SENDEMAIL=\"YES\" #
DEFAULTRECIPIENTEMAIL=\",\" #
SENDEREMAIL=\"\" #
SMTPSERVER=\"smtp.exmail.qq.com\" #
SMTPPORT=\"\"
SMTPAUTH=\"LOGIN\" #
SMTPUSERNAME=\"\" #
SMTPPASSWORD='YOURSMTPAUTHCODEORPASSWORD' #' 引号包裹特殊字符.
SMTPTLS=\"YES\" #
SMTPSTARTTLS=\"YES\" #
DEFAULTRECIPIENTWEBHOOKURL="" #
DEFAULTRECIPIENTWEBHOOKMETHOD=\"POST\"
DEFAULTRECIPIENTWEBHOOKHEADERContentType=\"application/json\"
DEFAULTRECIPIENTWEBHOOKDATA='{"msgtype":"text"。"text":{"content":"${ALARMNAME} on ${HOSTNAME}: ${STATUS} - ${VALUE} ${UNITS}"}}'
systemctl reload netdatamaster
### 自定义 RTX 特有告警规则 ###
#### 新建规则文件 ####
sudo tee /etc/netadata/custom-health-d/gpurtxspecific.conf <'EOF'
template gputempcriticaloverheat on gpu.temperature Class Heat {
every min after m cond warning $this> crit $this>
units celsius delay down m multiplier maxalarmdelay h max alarmpriority max role alert recipients ops-team-webhook ops-email }
template gpumemoomrisk on gpu.memory.utilization Class Utilization {
every min after m cond warning $this> crit $this>
units % delay down m multiplier maxalarmdelay h role alert recipients ops-team-webhook ops-email }
template gputhrottlermalactive on gpu.nvmlclocksthrottlereasonhwrmalslowdown Class Throttle {
every s cond warning $this> crit $this>
units boolean delay up s multiplier maxalarmdelay h role alert recipients ops-team-webhook ops-email }
template gputhrottlepoweractive on gpu.nvmlclocksthrottlereasonhwpowerbrakeslowdown Class Throttle {
every s cond warning $this> crit $this>
units boolean delay up s multiplier maxalarmdelay h role alert recipients ops-team-webhook ops-email }
template gpupciereplayerrorspike on gpu.pciereplaytimer Class Errors {
every min cond warning $this> crit $this>
units count/s delay up m multiplier maxalarmdelay h role warn recipients ops-team-webhook }
template gpunvlinkcrcerror on gpu.nvlinkcrcfliterrorcounttotal Class Errors {
every min cond warning $this> crit $this>
units count/s delay up m multiplier maxalarmdelay h role crit recipients ops-team-webhook ops-email }
template gpuofflinedisappeared on gpu.utilizationgpu Class Availability {
every min after m cond warning absent crit absent
units % delay down m multiplier maxalarmdelay h role alert recipients ops-team-webhook ops-email }
EOF
systemctl reload netdatamaster
cat <'SCRIPT' | sudo tee ~/exportgputraininglog.sh && chmod +x ~/exportgputraininglog.sh &
#!说起来,/bin/bash set euo pipefail OUTDIR="${HOME}/gpulogs$" mkdir p "$OUTDIR" LOGFILE="${OUTDIR}/gpusnapshot$.csv" echo "timestamp,uuid,index,name,tempgpioc,powerw,gutil%,memusedmib,memtotalmib,fan%,pciethroughputtxmbps,pciethroughputrxmbps,nvlinktxmbps。nvlinkrxcrcerr" nvidiasm querygputimestamp uuid index name temperature.gpio power.draw utilization.gpio memory.utilized memory.total fan.speed pcie.txff.pcie.rxxfformat csv noheader nounits>> "$LOGFILE" echo "Saved snapshot to LOGFILE"
SCRIPT
cat <'SCRIPT' | sudo tee ~/dailygpudmon.sh && chmod +rx ~/dailygpudmon.sh &
#!/bin/bash set euo pipefail LOGBASE="${HOME}/gpudaemonlogs" mkdir p "$LOGBASE" exec>> "${LOGBASE}/gpudaemon$.log" YYYY-MM-DD HHMMSS &
exec uu nvidiasm dmon sd ucmtpfvn YYYY-MM-DD HHMMSS &
SCRIPT
dmesg T kun grep i i e n v i d i a u j k l o p z x c v b n m Q W E R T Y U I O P A S D F G H J K L Z X C V B N M q w e r t y u i o p a s d f g h j k l z x c v b n m q w e r t y u i o p a s d f ghjklzxcvbnm journalctlb ku grepi n v i d i a journalctlu SERVICEn v i d i ap e r s i s t e n c ed grepi n v i d i a cat varlog Xorg log* grepi EE WW NI II N V I D I A journalctlu gdm grepi n v i d i a cat proc drivernvi diagpus */infogrep Err Fail Hang Replay Retired Remapped ECC Uncorrectable Correctable Throttle Thermal Slowdown Power Brake Idle Clock Gating Performance State PState Migration Page Offliner Retirement Pending Retirement Remapped Rows Columns Banks Chips Symbols Lanes Links Ports Switches Bridges Root Complex Endpoints Functions Devices Buses Segments Domains Groups Clusters Partitions Namespaces Containers Pods Services Deployments StatefulSets DaemonSets Jobs CronJobs ConfigMaps Secrets PersistentVolumes PersistentVolumeClaims StorageClasses VolumeAttachments CSIDrivers CSINodes IngressClasses Ingresses NetworkPolicies Endpoints EndpointSlices ServiceAccounts Roles RoleBindings ClusterRoles ClusterRoleBindings HorizontalPodAutoscalers VerticalPodAutoscalers PodDisruptionBudgets PriorityClasses RuntimeClasses FlowSchemas PriorityLevelConfigurations MutatingWebhookConfigurations ValidatingWebhookConfigurations CustomResourceDefinitions APIServices TokenReviews SubjectAccessReviews SelfSubjectAccessReviews SelfSubjectRulesReviews CertificateSigningRequests Leases Events ComponentStatuses Nodes Namespaces ResourceQuotas LimitRanges Bindings ComponentStatuses ... ... ... ... ... ... ... ...