zabbix agent get key

This is a flow to get a key from the zabbix agent (unencrypted)

[{"id":"e09df237.6e60e","type":"function","z":"c76085ae.dfac98","name":"zabbix key agent config","func":"msg.zabbix_key = msg.zabbix_key || \"system.hostname\";\nmsg.host = msg.host || \"127.0.0.1\";\nmsg.port = msg.port || \"10050\";\n\n\nbuf1 = Buffer.from(\"ZBXD\");\nbuf2 = Buffer.from([\n    1,\n    msg.zabbix_key.length,\n    msg.zabbix_key.length >> 8,\n    msg.zabbix_key.length >> 16,\n    msg.zabbix_key.length >> 24\n    ]);\n    \nbuf3 = Buffer.from([0,0,0,0]);\nbuf4 = Buffer.from(msg.zabbix_key);\nmsg.payload = Buffer.concat([buf1,buf2,buf3,buf4]);\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":290,"y":340,"wires":[["ab93294.7bcd3d8"]]},{"id":"4bc1d13a.ff23e","type":"inject","z":"c76085ae.dfac98","name":"","props":[{"p":"zabbix_key","v":"system.hostname","vt":"str"},{"p":"host","v":"127.0.0.1","vt":"str"},{"p":"port","v":"10050","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":"","topic":"","payloadType":"str","x":110,"y":340,"wires":[["e09df237.6e60e"]]},{"id":"38c4446b.c75eac","type":"debug","z":"c76085ae.dfac98","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":790,"y":340,"wires":[]},{"id":"ab93294.7bcd3d8","type":"tcp request","z":"c76085ae.dfac98","server":"","port":"","out":"time","splitc":"0","name":"","x":470,"y":340,"wires":[["c45bcc69.12b4c"]]},{"id":"c45bcc69.12b4c","type":"function","z":"c76085ae.dfac98","name":"response agent","func":"msg.payload = msg.payload.toString('utf8').substring(13);\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":620,"y":340,"wires":[["38c4446b.c75eac"]]}]

Flow Info

Created 5 years, 2 months ago
Rating: not yet rated

Owner

Actions

Rate:

Node Types

Core
  • debug (x1)
  • function (x2)
  • inject (x1)
  • tcp request (x1)

Tags

  • zabbix
  • agent
  • get
  • tcp
  • unencrypted
  • key
Copy this flow JSON to your clipboard and then import into Node-RED using the Import From > Clipboard (Ctrl-I) menu option