Advertisement
kazoda

Zabbix api item.get awk

Aug 10th, 2014
497
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Awk 0.28 KB | None | 0 0
  1. BEGIN {
  2.         FS = ":";
  3. }
  4. /"itemid"/ {itemid = gensub(/\s*\"(.+)\"(: )\"(.+)\"(\,)/,"\\1\\2\\3\\4","g")}
  5. /"hostid"/{hostid = gensub(/\s+\"(.+)\"(: )\"(.+)\"(\,)/,"\\1\\2\\3\\4","g")}
  6. /"name"/ {itemname = gensub(/\s*\"(.+)\"\,/,"\\1","g",$2); printf "%s\n", itemid hostid itemname}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement