Sink Socket
Netify Sink Socket Plugin
Introduction
Using sockets can be an extremely efficient way of exposing data originating from an upstream Netify processor plugin. The Netify Sink Socket plugin supports three types of sockets:
- File Sockets - special files used for inter-process communication (IPC) between processes on the same or different systems
- TCP Sockets - used extensively in client-server applications where a server listens on a specific port for incoming connections
- Web Sockets - a protocol designed for interaction between Netify and a web browser
License
The Netify Sink Socket Plugin is open-source software. It can be dual-licensed under the GPLv3 or a commercial license. Please contact us for details.
Installation
Netify plugins are packaged in the same workflow as the agent and can usually be installed using a similar syntax that was implemented during the installation of the Netify agent. Exceptions to this rule occur when the plugin requires a Software License Agreement or if an upgrade or downgrade to a different version of the plugin is required.
Alma Linux
Alma Linux 9
Assuming you have installed the Netify repository during the Netify Agent installation, you can install the Netify Sink Socket by running:
yum update
yum install netify-sink-socket
To install a package manually, you can find the version you wish to install from our download servers and install it as you would any other package. For example:
cd /tmp/
wget https://download.netify.ai/5/almalinux/9/stable/x86_64/netify-sink-socket_1.0.30-1.os9.x86_64.rpm
yum install ./netify-sink-socket_1.0.30-1.os9.x86_64.rpm
Alma Linux 8
Assuming you have installed the Netify repository during the Netify Agent installation, you can install the Netify Sink Socket by running:
yum update
yum install netify-sink-socket
To install a package manually, you can find the version you wish to install from our download servers and install it as you would any other package. For example:
cd /tmp/
wget https://download.netify.ai/5/almalinux/8/stable/x86_64/netify-sink-socket_1.0.30-1.os8.x86_64.rpm
yum install ./netify-sink-socket_1.0.30-1.os8.x86_64.rpm
Debian
Debian 13 (Bookworm)
Assuming you have installed the Netify repository during the Netify Agent installation, you can install the Netify Sink Socket by running:
apt update
apt install netify-sink-socket
To install a package manually, you can find the version you wish to install from our download servers and install it as you would any other package. For example:
cd /tmp/
wget https://download.netify.ai/5/debian/12/amd64/netify-sink-socket_1.0.30-1_amd64.deb
apt install ./netify-sink-socket_1.0.30-1_amd64.deb
Debian 11 (Bullseye)
Assuming you have installed the Netify repository during the Netify Agent installation, you can install the Netify Sink Socket by running:
apt update
apt install netify-sink-socket
To install a package manually, you can find the version you wish to install from our download servers and install it as you would any other package. For example:
cd /tmp/
wget https://download.netify.ai/5/debian/11/amd64/netify-sink-socket_1.0.30-1_amd64.deb
apt install ./netify-sink-socket_1.0.30-1_amd64.deb
Debian 10 (Buster)
Assuming you have installed the Netify repository during the Netify Agent installation, you can install the Netify Sink Socket by running:
apt update
apt install netify-sink-socket
To install a package manually, you can find the version you wish to install from our download servers and install it as you would any other package. For example:
cd /tmp/
wget https://download.netify.ai/5/debian/10/amd64/netify-sink-socket_1.0.30-1_amd64.deb
apt install ./netify-sink-socket_1.0.30-1_amd64.deb
OpenWRT
OpenWRT 23.05
Assuming you have installed the Netify repository during the Netify Agent installation, you can install the Netify Sink Socket by running:
opkg update
opkg install netify-sink-socket
To install a package manually, you can find the version you wish to install from our download servers and install it as you would any other package. For example:
pkg add https://download.netify.ai/5/openwrt/23.05/x86/netify-sink-socket_1.0.30-1_x86_64.ipk
OpenWRT 22.03
Assuming you have installed the Netify repository during the Netify Agent installation, you can install the Netify Sink Socket by running:
opkg update
opkg install netify-sink-socket
To install a package manually, you can find the version you wish to install from our download servers and install it as you would any other package. For example:
pkg add https://download.netify.ai/5/openwrt/22.03/x86/netify-sink-socket_1.0.30-1_x86_64.ipk
OpenWRT 21.02
Assuming you have installed the Netify repository during the Netify Agent installation, you can install the Netify Sink Socket by running:
opkg update
opkg install netify-sink-socket
To install a package manually, you can find the version you wish to install from our download servers and install it as you would any other package. For example:
pkg add https://download.netify.ai/5/openwrt/21.02/x86/netify-sink-socket_1.0.30-1_x86_64.ipk
OpenWRT 19.07
Assuming you have installed the Netify repository during the Netify Agent installation, you can install the Netify Sink Socket by running:
opkg update
opkg install netify-sink-socket
To install a package manually, you can find the version you wish to install from our download servers and install it as you would any other package. For example:
pkg add https://download.netify.ai/5/openwrt/19.07/x86/netify-sink-socket_1.0.30-1_x86_64.ipk
OPNsense
OPNsense 24.1 - Savvy Shark
Assuming you have installed the Netify repository during the Netify Agent installation, you can install the Netify Sink Socket by running:
pkg update
pkg install netify-sink-socket
To install a package manually, you can find the version you wish to install from our download servers and install it as you would any other package. For example:
pkg add https://download.netify.ai/5/freebsd/13.2/amd64/netify-sink-socket_1.0.30,1.pkg
OPNsense 23.7 - Restless Roadrunner
Assuming you have installed the Netify repository during the Netify Agent installation, you can install the Netify Sink Socket by running:
pkg update
pkg install netify-sink-socket
To install a package manually, you can find the version you wish to install from our download servers and install it as you would any other package. For example:
pkg add https://download.netify.ai/5/freebsd/13.2/amd64/netify-sink-socket_1.0.30,1.pkg
pfSense
pfSense Plus 23.x
Assuming you have installed the Netify repository during the Netify Agent installation, you can install the Netify Sink Socket by running:
pkg update
pkg install netify-sink-socket
To install a package manually, you can find the version you wish to install from our download servers and install it as you would any other package. For example:
pkg add https://download.netify.ai/5/freebsd/13.2/amd64/netify-sink-socket_1.0.30,1.pkg
pfSense CE 2.7.x
Assuming you have installed the Netify repository during the Netify Agent installation, you can install the Netify Sink Socket by running:
pkg update
pkg install netify-sink-socket
To install a package manually, you can find the version you wish to install from our download servers and install it as you would any other package. For example:
pkg add https://download.netify.ai/5/freebsd/13.2/amd64/netify-sink-socket_1.0.30,1.pkg
Rocky Linux
Rocky Linux 9
Assuming you have installed the Netify repository during the Netify Agent installation, you can install the Netify Sink Socket by running:
yum update
yum install netify-sink-socket
To install a package manually, you can find the version you wish to install from our download servers and install it as you would any other package. For example:
cd /tmp/
wget https://download.netify.ai/5/rockylinux/9/stable/x86_64/netify-sink-socket_1.0.30-1.os9.x86_64.rpm
yum install ./netify-sink-socket_1.0.30-1.os9.x86_64.rpm
Rocky Linux 8
Assuming you have installed the Netify repository during the Netify Agent installation, you can install the Netify Sink Socket by running:
yum update
yum install netify-sink-socket
To install a package manually, you can find the version you wish to install from our download servers and install it as you would any other package. For example:
cd /tmp/
wget https://download.netify.ai/5/rockylinux/8/stable/x86_64/netify-sink-socket_1.0.30-1.os8.x86_64.rpm
yum install ./netify-sink-socket_1.0.30-1.os8.x86_64.rpm
openSUSE Linux
openSUSE Leap 15.5
Assuming you have installed the Netify repository during the Netify Agent installation, you can install the Netify Sink Socket by running:
zypper update
zypper install netify-sink-socket
To install a package manually, you can find the version you wish to install from our download servers and install it as you would any other package. For example:
cd /tmp/
wget https://download.netify.ai/5/opensuse/15.5/stable/x86_64/netify-sink-socket_1.0.30-1.os15.5.x86_64.rpm
zypper install ./netify-sink-socket_1.0.30-1.os15.5.x86_64.rpm
Ubuntu
Ubuntu 24.04 - Noble
Assuming you have installed the Netify repository during the Netify Agent installation, you can install the Netify Sink Socket by running:
apt update
apt install netify-sink-socket
To install a package manually, you can find the version you wish to install from our download servers and install it as you would any other package. For example:
cd /tmp/
wget https://download.netify.ai/5/ubuntu/noble/binary-amd64/netify-sink-socket_1.0.30-1_amd64.deb
apt install ./netify-sink-socket_1.0.30-1_amd64.deb
Ubuntu 22.04 - Jammy
Assuming you have installed the Netify repository during the Netify Agent installation, you can install the Netify Sink Socket by running:
apt update
apt install netify-sink-socket
To install a package manually, you can find the version you wish to install from our download servers and install it as you would any other package. For example:
cd /tmp/
wget https://download.netify.ai/5/ubuntu/jammy/binary-amd64/netify-sink-socket_1.0.30-1_amd64.deb
apt install ./netify-sink-socket_1.0.30-1_amd64.deb
Ubuntu 20.04 - Focal
Assuming you have installed the Netify repository during the Netify Agent installation, you can install the Netify Sink Socket by running:
apt update
apt install netify-sink-socket
To install a package manually, you can find the version you wish to install from our download servers and install it as you would any other package. For example:
cd /tmp/
wget https://download.netify.ai/5/ubuntu/focal/binary-amd64/netify-sink-socket_1.0.30-1_amd64.deb
apt install ./netify-sink-socket_1.0.30-1_amd64.deb
Configuration
Plugin Loader Configuration
All plugins are disabled by default, and the Netify Sink Socket plugin is no different. To enable:
netifyd --enable-plugin sink-socket
Alternatively, you can edit /etc/netifyd/plugins.d/10-netify-sink-socket.conf and set enable to yes.
# Netify Agent Socket Sink Plugin Loader
# Copyright (C) 2023 eGloo Incorporated
#
# This is free software, licensed under the GNU General Public License v3.
#
##############################################################################
[sink-socket]
enable = yes
plugin_library = /usr/lib64/libnetify-sink-socket.so.0.0.0
conf_filename = ${path_state_persistent}/netify-sink-socket.json
# vim: set ft=dosini :
Plugin Configuration
Once the plugin has been enabled, it can be configured using the defined JSON configuration file specified in the plugin loader configuration. Let's look at a configuration sample to review the syntax and parts of the file.
{
"default_port": 1750,
"channels": {
"default": {
"enable": true,
"bind_address": "unix://${path_state_volatile}/netifyd.sock"
}
}
}
Property | default_port |
---|---|
Description | Global setting that sets the default port to use for TCP and Web sockets. |
Type | unsigned |
Default | 1750 |
Property | channels |
---|---|
Description | An object array that defines one or more channels to be available to the core processors. |
Type | object |
Options | Depends on local configuration (see Channel Objects section below) |
Channel Objects
The Socket Sink's channel object list determines which instances to log to. In the example above, we are defining only one, the default
channel.
Let's take a closer look at the configuration.
Property | enable |
---|---|
Description | Enable or disable the output. |
Type | boolean |
Property | bind_address |
---|---|
Description | Defines the type and location of the socket. Three prefixes are used to identify the socket type:
|
Type | string |
Examples
Create a default
channel to send data coming from processors (ex. core, aggregate, device discovery, etc.) to a file socket located at
/var/run/netifyd/netifyd.sock
.
{
"channels": {
"default": {
"enable": true,
"bind_address": "unix://${path_state_volatile}/netifyd.sock"
}
}
}
/usr/local/var/run/netifyd/
.
Create a tcp
channel to send data coming from processors (ex. core, aggregate, device discovery, etc.) to a TCP socket listening on all
interfaces on port 1750.
{
"channels": {
"tcp": {
"enable": true,
"bind_address": "tcp://0.0.0.0:1750"
}
}
}
Create a web
channel to send data coming from processors (ex. core, aggregate, device discovery, etc.) to a Web socket listening on all
interfaces on port 1760.
{
"channels": {
"web": {
"enable": true,
"bind_address": "ws://0.0.0.0:1760"
}
}
}