
select id,identifier,agent,node,severity,msg,lastoccurrence,vtime,tally from /test/malert_status 
where identifier=?
refresh
-- { output() params("222.129.134.178.1.3.6.1.4.1.2011.5.25.219.2.5.665.25.219.2.5.600009999") }
;

insert into /test/malert_status (identifier, severity, lastoccurrence, maintenance, msg, type, agent, firstoccurrence, omni_class, nodealias, alertgroup, node, manager, originalseverity, summary) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
-- { params("222.129.134.178.1.3.6.1.4.1.2011.5.25.219.2.5.665.25.219.2.5.600009999", 5, 1622249715000, 1, "设备:(222.129.134.178\u0029电源整体功能恢复! 00000000999999999", 2, "huawei mttrapd #0000999", 1622211715023, "300", "222.129.134.178", "huawei_power_func", "222.129.134.178", "MTTrapd Probe", 5, "设备:(222.129.134.178\u0029电源整体功能恢复! 000000009999") }
;

-- insert 可能存在延迟写入，因此判断实际库存值前需要等待
-- { sleep(1s) }
;

select id,identifier,agent,node,severity,msg,lastoccurrence,vtime,tally from /test/malert_status 
where identifier=?
refresh
-- { output() equal(0,severity,5) params("222.129.134.178.1.3.6.1.4.1.2011.5.25.219.2.5.665.25.219.2.5.600009999") }
;

update /test/malert_status 
set severity=4,
msg='设备:(222.129.134.178\u0029电源整体功能恢复! 9999999999999'
where id='7663188898751057475'
;

select id,identifier,agent,node,severity,msg,lastoccurrence,vtime,tally from /test/malert_status 
where identifier=?
refresh
-- { output() equal(0,severity,4) params("222.129.134.178.1.3.6.1.4.1.2011.5.25.219.2.5.665.25.219.2.5.600009999") }
;

update /test/malert_status 
set severity=3,
msg='设备:(222.129.134.178\u0029电源整体功能恢复! 9999999999999'
where id=?
-- { parallel(1) loop(1) params("7663188898751057475") }
;

select identifier,agent,node,severity,msg,lastoccurrence,vtime,tally from /test/malert_status 
where identifier=?
refresh
-- { output() equal(0,severity,3) params("222.129.134.178.1.3.6.1.4.1.2011.5.25.219.2.5.665.25.219.2.5.600009999") }
;

update /test/malert_status 
set severity=2,
msg='设备:(222.129.134.178\u0029电源整体功能恢复! 9999999999999'
where identifier=?
-- { parallel(1) loop(1) params("222.129.134.178.1.3.6.1.4.1.2011.5.25.219.2.5.665.25.219.2.5.600009999") }
;

select identifier,agent,node,severity,msg,lastoccurrence,vtime,tally from /test/malert_status 
where identifier=?
refresh
-- { output() equal(0,severity,2) params("222.129.134.178.1.3.6.1.4.1.2011.5.25.219.2.5.665.25.219.2.5.600009999") }
;
