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 be installed using a similar syntax that was implemented during the installation of the Netify agent. Plugins are compiled and made available for x86 on mirrors. For other architectures like ARM and MIPS, please contact us

Select your installation target for specific instructions on how to install this plugin.

Plugins are compiled against specific Netify agent versions and require ABI compatibility. Click here for more information.
Netify mirros can be found here.

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
A plugin can also be disabled in this way by substituting --disable-plugin.

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}/netify-sink.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 defaultchannel. 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:
  • unix:// - File socket
  • tcp:// - TCP socket
  • ws:// - Web socket
The content after the prefix represents the path - a full path to a file for a File socket or the IP:port for a TCP or Web socket
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/netify-sink.sock (/var/run/netifyd/netifyd.sock in version 5.0.x or earlier):

{
    "channels": {
        "default": {
            "enable": true,
            "bind_address": "unix://${path_state_volatile}/netify-sink.sock"
        }
    }
}
Where the OS is based on BSD, the volatile path variable with map to /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"
        }
    }
}


Technical Support

Haven't found the answers you're looking for?

Contact Us