Integrating with the Internet of Things using Node-RED
The Internet of Things is the network of physical objects embedded with electronics, software, sensors, and connectivity to enable the exchanging of data with the manufacturer, operator, and other connected devices. Each thing is uniquely identifiable through its embedded computing system and can interoperate within the existing Internet infrastructure.
Node-RED is a tool for wiring together hardware devices, APIs, and online services. It is built on Node.js, a JavaScript runtime platform for building fast, scalable network applications. Node.js uses an event-driven, non-blocking I/O model.
The Probe Extension Package uses Node-RED to integrate IBM Netcool/OMNIbus with the Internet of Things. It provides two Node-RED nodes that allow you to send events from any data source to any IBM probe that supports the event factory facility. For example, you can configure a Netcool/OMNIbus Socket Probe or a Netcool/OMNIbus Generic Log File Probe to run in passive mode listening to incoming HTTP requests from Node-RED.
Requirements
- Netcool/OMNIbus V7.4 or later.
- Node.js installed and configured to use the node: http://nodejs.org
- Node-RED installed and configured to use the node: http://nodered.org
- A Netcool/OMNIbus probe that supports HTTP/HTTPS mode configured to listen to HTTP/HTTPS requests from the Node-RED nodes provided by the Probe Extension Package.
Configuring the probe
To configure the integration with the Internet of Things, follow these steps:
- Ensure that you have followed the instructions in Extracting the Probe Extension Package and configuring a probe to use the additional rules.
- Ensure that the prerequisite software is installed and running.
- Copy the
JavaScript and HTML files from the following directory:
$PROBE_EXT/iot/nodered/nodes/omnibus
to your Node-RED/node installation directory. For example:
$NODERED/node/omnibus
- Optional step: Copy the example flow (push2omnibus.js) file to the NodeRed directory ($NODERED).
- Copy
the nodered.props file and nodered.rules file
from the $PROBE_EXT/iot/nodered directory to
the following directory:
$OMNIHOME/probes/arch/
The nodered.props file is intended as reference to help you to edit the probe properties file.
- Set the RulesFile property
of the properties
file of the probe that you will be using to listen to requests from
the Node-RED to the following path:
$OMNIHOME/probes/arch/nodered.rules
- Make the following additional changes to the probe properties
file:
- Set the Server property to the name of the ObjectServer.
- Set the Nhttpd.ListeningPort property to an open port.
- Update any other properties as required.
- Start the probe.
The probe will run as a listener to the HTTP port number set in the properties file and is not listening to any target.
- Start Node-RED.
In the Node-RED GUI, you will see two new nodes in the left pane: EventFieldMap and EventFactory.
- Configure the EventFactory node to point
to the host name and HTTP port number that the probe is listening
to.Note: This setting can be made on the EventFactory node itself by double clicking on the node.