【发布时间】:2016-08-28 19:30:03
【问题描述】:
我正在尝试收集 smartctl 指标并将它们推送到 influxdb。我很难为被推送的值添加标签,以便标签和值位于正确的位置。
如果我这样做:
curl -POST 'http://localhost:8086/write?db=test' --data-binary 'smartctl Raw_Read_Error_Rate=19243395i,Spin_Up_Time=0i,Start_Stop_Count=149i,Reallocated_Sector_Ct=25i,Seek_Error_Rate=4735843653i,Power_On_Hours=41286i,Spin_Retry_Count=0i,Power_Cycle_Count=150i,End_to_End_Error=0i,Reported_Uncorrect=0i,Command_Timeout=12885098501i,High_Fly_Writes=0i,Airflow_Temperature_Cel=29i,G_Sense_Error_Rate=0i,Power_Off_Retract_Count=145i,Load_Cycle_Count=25668i,Temperature_Celsius=29i,Hardware_ECC_Recovered=19243395i,Current_Pending_Sector=0i,Offline_Uncorrectable=0i,UDMA_CRC_Error_Count=0i 1472412282915653274'
没有标签:
SHOW TAG KEYS FROM "smartctl" (empty result)
如何向同一个 curl 命令添加标签,以便获得类似:
host=foo,disk_name="Seagate Blah"
添加一些说明:
如果我使用逗号(并设置一个值),那么它们是 all 标签,而不是字段:
curl -POST 'http://localhost:8086/write?db=test' --data-binary 'smartctl,Raw_Read_Error_Rate=19243395i,Spin_Up_Time=0i,Start_Stop_Count=149i,Reallocated_Sector_Ct=25i,Seek_Error_Rate=4735843653i,Power_On_Hours=41286i,Spin_Retry_Count=0i,Power_Cycle_Count=150i,End_to_End_Error=0i,Reported_Uncorrect=0i,Command_Timeout=12885098501i,High_Fly_Writes=0i,Airflow_Temperature_Cel=29i,G_Sense_Error_Rate=0i,Power_Off_Retract_Count=145i,Load_Cycle_Count=25668i,Temperature_Celsius=29i,Hardware_ECC_Recovered=19243395i,Current_Pending_Sector=0i,Offline_Uncorrectable=0i,UDMA_CRC_Error_Count=0i value=0 1472412282915653274'
(旁注:我也没有看到我会为“smartctl”设置什么值?)
我需要将以上所有内容设置为字段,但带有标签,这样我就可以确定它们报告的主机。所以我可以这样做:
select Temperature_Celsius from smartctl where host=foo
【问题讨论】:
标签: influxdb