Node-red and Check_mk
-
Hi,
i'm struggling with the communication between node-red and check_mk. The idea was to trigger an event (in check_mk) through a namped_pipe provided by checkmk. Therefore you can write a text message (e.g. '<78>Dec 18 10:40:00 myserver123 MyApplication: It happened again.') locally to the named pipe to trigger an event.
Now everything should work in a node. The node should check the string for various test criteria and then write the string on the named pipe.
To transfer the string to the named pipe i used these code-lines:
var fs = require('fs'); var writableStream = fs.createWriteStream('/opt/omd/sites/monitoring/tmp/run/mkeventd/events'); writableStream.write(Msg);
Now the Problem:
If i declare the string within the js-file (which i need to create a node) and then transfer it to writableStream.write(); everything works fine and an event in checkmk gets triggered.
But if im defining a string outside the node (like in an inject-node; msg.payload) and then using it in my node... the triggering fails.
Here are some Variantes i tried without any success.
//Var1 var Msg2 = msg.payload; . . writableStream.write(Msg2); //Var2 writableStream.write(msg.payload); //Var3 var Msg2 = msg.payload; Msg2 = Msg2.toString(); writableStream.write(Msg2);
Any advices will be taken with much gratitude
regards
Arun
Suggested Topics
-
Join the Project Contest 2014 - ENDED
Announcements • 8 Apr 2014, 08:03 • hek 13 May 2014, 21:48 -
NodeID assignment not working? MY_INCLUSION_MODE_FEATURE enabled
Node-RED • 6 Apr 2020, 09:37 • bebr 6 Apr 2020, 11:35 -
Dollhouse project : need Node-Red Controller flow
Node-RED • 20 Oct 2020, 07:35 • SuperNinja 20 Oct 2020, 10:33 -
node-red-contrib-mysensors release thread
Node-RED • 24 Apr 2018, 20:06 • tbowmo 4 May 2021, 10:25 -
myscontroller with ethernet gateway
Node-RED • 4 Jun 2021, 19:13 • JohnDoe2991 6 Jun 2021, 14:30 -
multiple gateways on lan
Node-RED • 8 Jun 2019, 07:57 • sotiriszegiannis 10 Jun 2019, 20:20