telegraf.sim 18.3 KB
Newer Older
S
slguan 已提交
1
system sh/stop_dnodes.sh
S
scripts  
slguan 已提交
2
sleep 3000
S
slguan 已提交
3
system sh/deploy.sh -n dnode1 -i 1
H
hjxilinx 已提交
4
system sh/cfg.sh -n dnode1 -c walLevel -v 0
S
scripts  
slguan 已提交
5
system sh/cfg.sh -n dnode1 -c http -v 1
S
slguan 已提交
6 7 8 9 10 11 12 13 14 15
system sh/cfg.sh -n dnode1 -c httpEnableRecordSql -v 1
system sh/cfg.sh -n dnode1 -c telegrafUseFieldNum -v 0
system sh/exec.sh -n dnode1 -s start

sleep 3000
sql connect

print ============================ dnode1 start

print ===============  step1 - parse
16
system_content curl -u root:taosdata -d '{"fields":{"Percent_DPC_Time":0,"Percent_Idle_Time":95.59830474853516,"Percent_Interrupt_Time":0,"Percent_Privileged_Time":0,"Percent_Processor_Time":0,"Percent_User_Time":0},"name":"win_cpu","tags":{"host":"windows","instance":"1","objectname":"Processor"},"timestamp":1535784122}' 127.0.0.1:7111/telegraf/
S
slguan 已提交
17 18
print $system_content

R
TD-1311  
root 已提交
19
if $system_content != @{"status":"error","code":4448,"desc":"database name can not be null"}@ then
S
slguan 已提交
20 21 22
  return -1
endi

23
system_content curl -H 'Authorization: Taosd /KfeAzX/f9na8qdtNZmtONryp201ma04bEl8LcvLUd7a8qdtNZmtONryp201ma04' -d 'select * from d1.table_admin' -d '{"fields":{"Percent_DPC_Time":0,"Percent_Idle_Time":95.59830474853516,"Percent_Interrupt_Time":0,"Percent_Privileged_Time":0,"Percent_Processor_Time":0,"Percent_User_Time":0},"name":"win_cpu","tags":{"host":"windows","instance":"1","objectname":"Processor"},"timestamp":1535784122}' 127.0.0.1:7111/telegraf/
S
slguan 已提交
24 25
print $system_content

R
TD-1311  
root 已提交
26
if $system_content != @{"status":"error","code":4448,"desc":"database name can not be null"}@ then
S
slguan 已提交
27 28 29
  return -1
endi

30
system_content curl -H 'Authorization: Taosd /KfeAzX/f9na8qdtNZmtONryp201ma04bEl8LcvLUd7a8qdtNZmtONryp201ma04' -d 'select * from d1.table_admin' -d '{"fields":{"Percent_DPC_Time":0,"Percent_Idle_Time":95.59830474853516,"Percent_Interrupt_Time":0,"Percent_Privileged_Time":0,"Percent_Processor_Time":0,"Percent_User_Time":0},"name":"win_cpu","tags":{"host":"windows","instance":"1","objectname":"Processor"},"timestamp":1535784122}' 127.0.0.1:7111/telegraf/d123456789012345678901234567890123456
S
slguan 已提交
31 32
print $system_content

R
TD-1311  
root 已提交
33
if $system_content != @{"status":"error","code":4449,"desc":"database name too long"}@ then
S
slguan 已提交
34 35 36
  return -1
endi

37
system_content curl -u root:taosdata -d  '[]' 127.0.0.1:7111/telegraf/db/root/taosdata1
S
slguan 已提交
38 39
print $system_content

R
TD-1311  
root 已提交
40
if $system_content != @{"status":"error","code":4453,"desc":"metric name not find"}@ then
S
slguan 已提交
41 42 43
  return -1
endi

44
system_content curl -u root:taosdata -d  '{}' 127.0.0.1:7111/telegraf/db/root/taosdata1
S
slguan 已提交
45 46
print $system_content

R
TD-1311  
root 已提交
47
if $system_content != @{"status":"error","code":4453,"desc":"metric name not find"}@ then
S
slguan 已提交
48 49 50
  return -1
endi

51
system_content curl -u root:taosdata -d  '[{}]' 127.0.0.1:7111/telegraf/db/root/taosdata1
S
slguan 已提交
52 53
print $system_content

R
TD-1311  
root 已提交
54
if $system_content != @{"status":"error","code":4453,"desc":"metric name not find"}@ then
S
slguan 已提交
55 56 57
  return -1
endi

58
system_content curl -u root:taosdata -d  '{"metrics": []}' 127.0.0.1:7111/telegraf/db/root/taosdata1
S
slguan 已提交
59 60
print $system_content

R
TD-1311  
root 已提交
61
if $system_content != @{"status":"error","code":4451,"desc":"metrics size is 0"}@ then
S
slguan 已提交
62 63 64
  return -1
endi

65
system_content curl -u root:taosdata -d  '{"metrics": [{}]}' 127.0.0.1:7111/telegraf/db/root/taosdata1
S
slguan 已提交
66 67
print $system_content

R
TD-1311  
root 已提交
68
if $system_content != @{"status":"error","code":4453,"desc":"metric name not find"}@ then
S
slguan 已提交
69 70 71
  return -1
endi

72
system_content curl -u root:taosdata -d  '{"metrics": 12}' 127.0.0.1:7111/telegraf/db/root/taosdata1
S
slguan 已提交
73 74
print $system_content

R
TD-1311  
root 已提交
75
if $system_content != @{"status":"error","code":4451,"desc":"metrics size is 0"}@ then
S
slguan 已提交
76 77 78
  return -1
endi

79
#system_content curl -u root:taosdata -d  '{"metrics": [{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{}]}' 127.0.0.1:7111/telegraf/db/root/taosdata1
S
slguan 已提交
80 81
#print $system_content

R
TD-1311  
root 已提交
82
#if $system_content != @{"status":"error","code":4452,"desc":"metrics size can not more than 50"}@ then
S
slguan 已提交
83 84 85
#  return -1
#endi

86
system_content curl -u root:taosdata -d  '{"fields":{"Percent_DPC_Time":0,"Percent_Idle_Time":95.59830474853516,"Percent_Interrupt_Time":0,"Percent_Privileged_Time":0,"Percent_Processor_Time":0,"Percent_User_Time":0},"tags":{"host":"windows","instance":"1","objectname":"Processor"},"timestamp":1535784122}' 127.0.0.1:7111/telegraf/db/root/taosdata1
S
slguan 已提交
87 88
print $system_content

R
TD-1311  
root 已提交
89
if $system_content != @{"status":"error","code":4453,"desc":"metric name not find"}@ then
S
slguan 已提交
90 91 92
  return -1
endi

93
system_content curl -u root:taosdata -d  '{"fields":{"Percent_DPC_Time":0,"Percent_Idle_Time":95.59830474853516,"Percent_Interrupt_Time":0,"Percent_Privileged_Time":0,"Percent_Processor_Time":0,"Percent_User_Time":0},"name":111,"tags":{"host":"windows","instance":"1","objectname":"Processor"},"timestamp":1535784122}' 127.0.0.1:7111/telegraf/db/root/taosdata1
S
slguan 已提交
94 95
print $system_content

R
TD-1311  
root 已提交
96
if $system_content != @{"status":"error","code":4454,"desc":"metric name type should be string"}@ then
S
slguan 已提交
97 98 99
  return -1
endi

100
system_content curl -u root:taosdata -d  '{"fields":{"Percent_DPC_Time":0,"Percent_Idle_Time":95.59830474853516,"Percent_Interrupt_Time":0,"Percent_Privileged_Time":0,"Percent_Processor_Time":0,"Percent_User_Time":0},"name":"","tags":{"host":"windows","instance":"1","objectname":"Processor"},"timestamp":1535784122}' 127.0.0.1:7111/telegraf/db/root/taosdata1
S
slguan 已提交
101 102
print $system_content

R
TD-1311  
root 已提交
103
if $system_content != @{"status":"error","code":4455,"desc":"metric name length is 0"}@ then
S
slguan 已提交
104 105 106
  return -1
endi

107
system_content curl -u root:taosdata -d  '{"fields":{"Percent_DPC_Time":0,"Percent_Idle_Time":95.59830474853516,"Percent_Interrupt_Time":0,"Percent_Privileged_Time":0,"Percent_Processor_Time":0,"Percent_User_Time":0},"name":"a1234567890123456789012345678901234a1234567890123456789012345678901234a1234567890123456789012345678901234a1234567890123456789012345678901234a1234567890123456789012345678901234a1234567890123456789012345678901234a1234567890123456789012345678901234a1234567890123456789012345678901234a1234567890123456789012345678901234a1234567890123456789012345678901234a1234567890123456789012345678901234a1234567890123456789012345678901234","tags":{"host":"windows","instance":"1","objectname":"Processor"},"timestamp":1535784122}' 127.0.0.1:7111/telegraf/db/root/taosdata1
S
slguan 已提交
108 109
print $system_content

R
TD-1311  
root 已提交
110
if $system_content != @{"status":"error","code":4456,"desc":"metric name length too long"}@ then
S
slguan 已提交
111 112 113
  return -1
endi

114
system_content curl -u root:taosdata -d  '{"fields":{"Percent_DPC_Time":0,"Percent_Idle_Time":95.59830474853516,"Percent_Interrupt_Time":0,"Percent_Privileged_Time":0,"Percent_Processor_Time":0,"Percent_User_Time":0},"name":"win_cpu","tags":{"host":"windows","instance":"1","objectname":"Processor"}}' 127.0.0.1:7111/telegraf/db/root/taosdata1
S
slguan 已提交
115 116
print $system_content

R
TD-1311  
root 已提交
117
if $system_content != @{"status":"error","code":4457,"desc":"timestamp not find"}@ then
S
slguan 已提交
118 119 120
  return -1
endi

121
system_content curl -u root:taosdata -d  '{"fields":{"Percent_DPC_Time":0,"Percent_Idle_Time":95.59830474853516,"Percent_Interrupt_Time":0,"Percent_Privileged_Time":0,"Percent_Processor_Time":0,"Percent_User_Time":0},"name":"win_cpu","tags":{"host":"windows","instance":"1","objectname":"Processor"},"timestamp":""}' 127.0.0.1:7111/telegraf/db/root/taosdata1
S
slguan 已提交
122 123
print $system_content

R
TD-1311  
root 已提交
124
if $system_content != @{"status":"error","code":4458,"desc":"timestamp type should be integer"}@ then
S
slguan 已提交
125 126 127
  return -1
endi

128
system_content curl -u root:taosdata -d  '{"fields":{"Percent_DPC_Time":0,"Percent_Idle_Time":95.59830474853516,"Percent_Interrupt_Time":0,"Percent_Privileged_Time":0,"Percent_Processor_Time":0,"Percent_User_Time":0},"name":"win_cpu","tags":{"host":"windows","instance":"1","objectname":"Processor"},"timestamp":-1}' 127.0.0.1:7111/telegraf/db/root/taosdata1
S
slguan 已提交
129 130
print $system_content

R
TD-1311  
root 已提交
131
if $system_content != @{"status":"error","code":4459,"desc":"timestamp value smaller than 0"}@ then
S
slguan 已提交
132 133 134
  return -1
endi

135
system_content curl -u root:taosdata -d  '{"fields":{"Percent_DPC_Time":0,"Percent_Idle_Time":95.59830474853516,"Percent_Interrupt_Time":0,"Percent_Privileged_Time":0,"Percent_Processor_Time":0,"Percent_User_Time":0},"name":"win_cpu","timestamp":1535784122}' 127.0.0.1:7111/telegraf/db/root/taosdata1
S
slguan 已提交
136 137
print $system_content

R
TD-1311  
root 已提交
138
if $system_content != @{"status":"error","code":4460,"desc":"tags not find"}@ then
S
slguan 已提交
139 140 141
  return -1
endi

142
system_content curl -u root:taosdata -d  '{"fields":{"Percent_DPC_Time":0,"Percent_Idle_Time":95.59830474853516,"Percent_Interrupt_Time":0,"Percent_Privileged_Time":0,"Percent_Processor_Time":0,"Percent_User_Time":0},"name":"win_cpu","tags":{},"timestamp":1535784122}' 127.0.0.1:7111/telegraf/db/root/taosdata1
S
slguan 已提交
143 144
print $system_content

R
TD-1311  
root 已提交
145
if $system_content != @{"status":"error","code":4461,"desc":"tags size is 0"}@ then
S
slguan 已提交
146 147 148
  return -1
endi

149
system_content curl -u root:taosdata -d  '{"fields":{"Percent_DPC_Time":0,"Percent_Idle_Time":95.59830474853516,"Percent_Interrupt_Time":0,"Percent_Privileged_Time":0,"Percent_Processor_Time":0,"Percent_User_Time":0},"name":"win_cpu","tags":"","timestamp":1535784122}' 127.0.0.1:7111/telegraf/db/root/taosdata1
S
slguan 已提交
150 151
print $system_content

R
TD-1311  
root 已提交
152
if $system_content != @{"status":"error","code":4461,"desc":"tags size is 0"}@ then
S
slguan 已提交
153 154 155
  return -1
endi

156
#system_content curl -u root:taosdata -d  '{"fields":{"Percent_DPC_Time":0,"Percent_Idle_Time":95.59830474853516,"Percent_Interrupt_Time":0,"Percent_Privileged_Time":0,"Percent_Processor_Time":0,"Percent_User_Time":0},"name":"win_cpu","tags":{"host":"windows","instance":"1","objectname":"Processor","host":"windows","instance":"1","objectname":"Processor","objectname":"Processor"},"timestamp":1535784122}' 127.0.0.1:7111/telegraf/db/root/taosdata
S
slguan 已提交
157 158
#print $system_content

R
TD-1311  
root 已提交
159
#if $system_content != @{"status":"error","code":4461,"desc":"tags size too long"}@ then
S
slguan 已提交
160 161 162
#  return -1
#endi

163
system_content curl -u root:taosdata -d  '{"fields":{"Percent_DPC_Time":0,"Percent_Idle_Time":95.59830474853516,"Percent_Interrupt_Time":0,"Percent_Privileged_Time":0,"Percent_Processor_Time":0,"Percent_User_Time":0},"name":"win_cpu","tags":{},"timestamp":1535784122}' 127.0.0.1:7111/telegraf/db/root/taosdata1
S
slguan 已提交
164 165
print $system_content

R
TD-1311  
root 已提交
166
if $system_content != @{"status":"error","code":4461,"desc":"tags size is 0"}@ then
S
slguan 已提交
167 168 169
  return -1
endi

170
system_content curl -u root:taosdata -d  '{"fields":{"Percent_DPC_Time":0,"Percent_Idle_Time":95.59830474853516,"Percent_Interrupt_Time":0,"Percent_Privileged_Time":0,"Percent_Processor_Time":0,"Percent_User_Time":0},"name":"win_cpu","tags":{"":"windows"},"timestamp":1535784122}' 127.0.0.1:7111/telegraf/db/root/taosdata1
S
slguan 已提交
171 172
print $system_content

R
TD-1311  
root 已提交
173
if $system_content != @{"status":"error","code":4464,"desc":"tag name is null"}@ then
S
slguan 已提交
174 175 176
  return -1
endi

177
#system_content curl -u root:taosdata -d  '{"fields":{"Percent_DPC_Time":0,"Percent_Idle_Time":95.59830474853516,"Percent_Interrupt_Time":0,"Percent_Privileged_Time":0,"Percent_Processor_Time":0,"Percent_User_Time":0},"name":"win_cpu","tags":{"host111111111111222222222222222222222":""},"timestamp":1535784122}' 127.0.0.1:7111/telegraf/db/root/taosdata1
S
slguan 已提交
178 179
#print $system_content

R
TD-1311  
root 已提交
180
#if $system_content != @{"status":"error","code":4465,"desc":"tag name length too long"}@ then
S
slguan 已提交
181 182 183
#  return -1
#endi

184
system_content curl -u root:taosdata -d  '{"fields":{"Percent_DPC_Time":0,"Percent_Idle_Time":95.59830474853516,"Percent_Interrupt_Time":0,"Percent_Privileged_Time":0,"Percent_Processor_Time":0,"Percent_User_Time":0},"name":"win_cpu","tags":{"host":true},"timestamp":1535784122}' 127.0.0.1:7111/telegraf/db/root/taosdata1
S
slguan 已提交
185 186
print $system_content

R
TD-1311  
root 已提交
187
if $system_content != @{"status":"error","code":4466,"desc":"tag value type should be number or string"}@ then
S
slguan 已提交
188 189 190
  return -1
endi

191
system_content curl -u root:taosdata -d  '{"fields":{"Percent_DPC_Time":0,"Percent_Idle_Time":95.59830474853516,"Percent_Interrupt_Time":0,"Percent_Privileged_Time":0,"Percent_Processor_Time":0,"Percent_User_Time":0},"name":"win_cpu","tags":{"host":""},"timestamp":1535784122}' 127.0.0.1:7111/telegraf/db/root/taosdata1
S
slguan 已提交
192 193
print $system_content

R
TD-1311  
root 已提交
194
if $system_content != @{"status":"error","code":4467,"desc":"tag value is null"}@ then
S
slguan 已提交
195 196 197
  return -1
endi

198
system_content curl -u root:taosdata -d  '{"fields":{"Percent_DPC_Time":0,"Percent_Idle_Time":95.59830474853516,"Percent_Interrupt_Time":0,"Percent_Privileged_Time":0,"Percent_Processor_Time":0,"Percent_User_Time":0},"name":"win_cpu","tags":{"5022":"111"},"timestamp":1535784122}' 127.0.0.1:7111/telegraf/db/root/taosdata1
S
slguan 已提交
199 200
print $system_content

R
TD-1311  
root 已提交
201
if $system_content != @{"status":"error","code":4468,"desc":"table is null"}@ then
S
slguan 已提交
202 203 204
  return -1
endi

205
system_content curl -u root:taosdata -d  '{"fields":{"Percent_DPC_Time":0,"Percent_Idle_Time":95.59830474853516,"Percent_Interrupt_Time":0,"Percent_Privileged_Time":0,"Percent_Processor_Time":0,"Percent_User_Time":0},"name":"win_cpu","tags":{"host":"host111111111111222222222222222222222host111111111111222222222222222222222host111111111111222222222222222222222host111111111111222222222222222222222host111111111111222222222222222222222host111111111111222222222222222222222host111111111111222222222222222222222host111111111111222222222222222222222"},"timestamp":1535784122}' 127.0.0.1:7111/telegraf/db/root/taosdata1
S
slguan 已提交
206 207
print $system_content

R
TD-1311  
root 已提交
208
if $system_content != @{"status":"error","code":4469,"desc":"table name length too long"}@ then
S
slguan 已提交
209 210 211
  return -1
endi

212
system_content curl -u root:taosdata -d  '{"fields":{},"name":"win_cpu","tags":{"host":"windows","instance":"1","objectname":"Processor"},"timestamp":1535784122}' 127.0.0.1:7111/telegraf/db/root/taosdata1
S
slguan 已提交
213 214
print $system_content

R
TD-1311  
root 已提交
215
if $system_content != @{"status":"error","code":4471,"desc":"fields size is 0"}@ then
S
slguan 已提交
216 217 218
  return -1
endi

219
system_content curl -u root:taosdata -d  '{"fields":{"":0,"Percent_Idle_Time":95.59830474853516,"Percent_Interrupt_Time":0,"Percent_Privileged_Time":0,"Percent_Processor_Time":0,"Percent_User_Time":0},"name":"win_cpu","tags":{"host":"windows","instance":"1","objectname":"Processor"},"timestamp":1535784122}' 127.0.0.1:7111/telegraf/db/root/taosdata1
S
slguan 已提交
220 221
print $system_content

R
TD-1311  
root 已提交
222
if $system_content != @{"status":"error","code":4474,"desc":"field name is null"}@ then
S
slguan 已提交
223 224 225
  return -1
endi

226
system_content curl -u root:taosdata -d  '{"fields":{"Percent_DPC_Time":"","Percent_Idle_Time":95.59830474853516,"Percent_Interrupt_Time":0,"Percent_Privileged_Time":0,"Percent_Processor_Time":0,"Percent_User_Time":0},"name":"win_cpu","tags":{"host":"windows","instance":"1","objectname":"Processor"},"timestamp":1535784122}' 127.0.0.1:7111/telegraf/db/root/taosdata1
S
slguan 已提交
227 228
print $system_content

R
TD-1311  
root 已提交
229
if $system_content != @{"status":"error","code":4477,"desc":"field value is null"}@ then
S
slguan 已提交
230 231 232
  return -1
endi

233
system_content curl -u root:taosdata -d  '{"fields":{"Percent_DPC_Time":true,"Percent_Idle_Time":95.59830474853516,"Percent_Interrupt_Time":0,"Percent_Privileged_Time":0,"Percent_Processor_Time":0,"Percent_User_Time":0},"name":"win_cpu","tags":{"host":"windows","instance":"1","objectname":"Processor"},"timestamp":1535784122}' 127.0.0.1:7111/telegraf/db/root/taosdata1
S
slguan 已提交
234 235
print $system_content

R
TD-1311  
root 已提交
236
if $system_content != @{"status":"error","code":4476,"desc":"field value type should be number or string"}@ then
S
slguan 已提交
237 238 239
  return -1
endi

240
system_content curl -u root:taosdata -d  '{"fields":{"Percent_DPC_Time":0,"Percent_Idle_Time":95.59830474853516,"Percent_Interrupt_Time":0,"Percent_Privileged_Time":0,"Percent_Processor_Time":0,"Percent_User_Time":0},"name":"win_cpu","tags":{"host":"windows","instance":"1","objectname":"Processor"},"timestamp":1564641722000}' 127.0.0.1:7111/telegraf/db
S
slguan 已提交
241 242 243 244 245 246 247 248 249 250

print $system_content

if $system_content != @{"metrics":[{"metric":"win_cpu","stable":"win_cpu","table":"win_cpu_windows_1_Processor","timestamp":"1564641722000","affected_rows":1,"status":"succ"}]}@ then
  return -1
endi

sleep 3000

print ===============  step2 - insert single data
251
system_content curl -u root:taosdata -d  '{"fields":{"Percent_DPC_Time":0,"Percent_Idle_Time":95.59830474853516,"Percent_Interrupt_Time":0,"Percent_Privileged_Time":0,"Percent_Processor_Time":0,"Percent_User_Time":0},"name":"win_cpu","tags":{"host":"windows","instance":"1","objectname":"Processor"},"timestamp":1564641722000}' 127.0.0.1:7111/telegraf/db/
S
slguan 已提交
252 253 254

print $system_content

S
scripts  
slguan 已提交
255 256 257
#if $system_content != @{"metrics":[{"metric":"win_cpu","stable":"win_cpu","table":"win_cpu_windows_1_Processor","timestamp":"1564641722000","affected_rows":1,"status":"succ"}]}@ then
#  return -1
#endi
S
slguan 已提交
258

259
system_content curl -u root:taosdata -d  'select * from db.win_cpu_windows_1_Processor' 127.0.0.1:7111/rest/sql/
S
slguan 已提交
260 261 262

print $system_content

S
scripts  
slguan 已提交
263 264 265
#if $system_content != @{"status":"succ","head":["ts","f_percent_dpc_time","f_percent_idle_time","f_percent_interrupt_time","f_percent_privileged_time","f_percent_processor_time","f_percent_user_time"],"data":[["2019-08-01 06:42:02.000",0.000000000,95.598305000,0.000000000,0.000000000,0.000000000,0.000000000]],"rows":1}@ then
#  return -1
#endi
S
slguan 已提交
266 267

print ===============  step3 - multi-query data
268
system_content curl -u root:taosdata -d  '{"metrics": [{"fields":{"Percent_DPC_Time":0,"Percent_Idle_Time":95.59830474853516,"Percent_Interrupt_Time":0,"Percent_Privileged_Time":0,"Percent_Processor_Time":0,"Percent_User_Time":0},"name":"win_cpu","tags":{"host":"window1","instance":"1","objectname":"Processor"},"timestamp":1564641723000},{"fields":{"Percent_DPC_Time":0,"Percent_Idle_Time":95.59830474853516,"Percent_Interrupt_Time":0,"Percent_Privileged_Time":0,"Percent_Processor_Time":0,"Percent_User_Time":0},"name":"win_cpu","tags":{"host":"window2","instance":"1","objectname":"Processor"},"timestamp":1564641723000}]}' 127.0.0.1:7111/telegraf/db/
S
slguan 已提交
269 270 271 272 273 274 275

print $system_content

if $system_content != @{"metrics":[{"metric":"win_cpu","stable":"win_cpu","table":"win_cpu_window1_1_Processor","timestamp":"1564641723000","affected_rows":1,"status":"succ"},{"metric":"win_cpu","stable":"win_cpu","table":"win_cpu_window2_1_Processor","timestamp":"1564641723000","affected_rows":1,"status":"succ"}]}@ then
  return -1
endi

276
system_content curl -u root:taosdata -d  'select * from db.win_cpu_window1_1_Processor' 127.0.0.1:7111/rest/sql/
S
slguan 已提交
277 278 279

print $system_content

S
scripts  
slguan 已提交
280 281 282
#if $system_content != @{"status":"succ","head":["ts","f_percent_dpc_time","f_percent_idle_time","f_percent_interrupt_time","f_percent_privileged_time","f_percent_processor_time","f_percent_user_time"],"data":[["2019-08-01 14:42:03.000",0.000000000,95.598305000,0.000000000,0.000000000,0.000000000,0.000000000]],"rows":1}@ then
#  return -1
#endi
S
slguan 已提交
283

284
system_content curl -u root:taosdata -d  'select count(*) from db.win_cpu' 127.0.0.1:7111/rest/sql/
S
slguan 已提交
285 286 287 288 289 290 291

print $system_content

if $system_content != @{"status":"succ","head":["count(*)"],"data":[[3]],"rows":1}@ then
  return -1
endi

S
scripts  
slguan 已提交
292
system sh/exec.sh -n dnode1 -s stop -x SIGINT