Grep and send from bash:
grep -E "^.(1.3.6.1.4.1.2682.1.2.5.1.6|1.3.6.1.4.1.2682.1.2.5.1.5)" device-walk-dump.txt | base64 -w0 | sed 's|^|device-walk-dump simulate |' | zabbix_sender -z 127.0.0.1 -p 17451 -i -
Catch data wiht JavaScript preprocessing
return String.fromCharCode.apply(this, [].slice.call(atob(value))).match(/^.1.3.6.*$/gm).join('\n');
Format walk to grep:
echo 'walk[1.3.6.1.4.1.2682.1.2.5.1.6,1.3.6.1.4.1.2682.1.2.5.1.5]' | \
sed 's|,|\||g' | sed 's|walk.|grep \-E \"(|' | sed 's|.$|)\" * \| sort|'
No comments:
Post a Comment