Turn your Pi into a network monitor and I/O device

Node-red Ping Monitor

A good starting program is to make a Web Dashboard that shows ping (node-to-node) delay times. The dashboards are defined in the right panel of Node-Red, (Figure 3). Dashboard items are put into groups, and groups are put into tabs. Each tab will be shown as a separate page on your smart phone.

Figure 3: Dashboard configuration.

To create our program drag and drop ping and chart nodes on to the flow sheet (Figure 4), and wire the node pairs together. Double click on the ping node and enter the IP address of the node to ping, and how often to ping it. Next double click on the chart node, and enter the dashboard group, size, label and chart time (Figure 5).

Figure 4: Ping program.
Figure 5: Chart node configuration.
Figure 6: Your first ping web dashboard.

After the configuration is done, click the Deploy button on the Node-Red dashboard. The Node-RED dashboard user interface is accessed by entering <IPaddress>:1880/ui (e.g., Figure 7 shows the final dashboard live. Chart data values are shown by clicking on the chart line.

Figure 7: SNMP to chart dashboard logic.

SNMP Nodes

The ping node is quite simple and it returns just the ping value. The snmp node is more complex and it returns multiple pieces of information. To use snmp nodes in a Node-Red program you need some support nodes to parse/pass the payload messages. To send SNMP data to a chart dashboard (Figure 7) the following nodes are used:

  • Big Timer triggers the polling of data
  • snmp gets SNMP/OID information
  • split splits the message into addressable variables
  • change puts the OID value into the message playload
  • chart shows the payload

The Big Timer node has many options for start and stop event times. By default, the middle output pin will generate a trigger event every minute. The snmp node must be configured with a numeric OID and a node name. The split node needs to split using a comma (,).

The change node is a powerful node that can adjust and move information within the msg and payload items. For this application we need to set the payload with the payload.value (Figure 8).

Figure 8: Change node configuration for the payload.
Figure 12: The PowerSwitch dashboard.

There are many possible SNMP objects you can monitor. Table 2 shows some of the more commonly monitored OIDs .

Table 2

Objects to Monitor



1 minute CPU Load

5 minute CPU Load

15 minute CPU Load

Idle CPU time (%)

Total RAM in machine

Total RAM used

Total RAM Free

Total disk/partion size(kBytes)

Available space on the disk

Used space on the disk

Figure 10: Setting SNMP values from buttons.

Figure 11 shows a dashboard where you monitor the CPU load, total free RAM and available disk space.

Figure 11: Exec node configuration.

Buy this article as PDF

Express-Checkout as PDF

Pages: 4

Price $2.95
(incl. VAT)

Buy Raspberry Pi Geek

Get it on Google Play

US / Canada

Get it on Google Play

UK / Australia

Related content