unixsock plugin¶
| Plugin name | unixsock |
| Type | other |
| Callbacks | config, init, shutdown |
| Status | supported |
| Since | 4.0 |
| Copyright | 2007–2008 Florian octo Forster |
| License | MIT License |
| Configuration | collectd.conf(5) |
The UnixSock plugin opens a UNIX domain socket and accepts connections. Using this socket one can send commands to the daemon and receive information. The protocol used is documented in the collectd-unixsock(5) manual page and in the Plain-text-protocol wiki page.
This plugin is a generic plugin, i.e. it cannot work without configuration, because there is no reasonable default behavior. Please read the Plugin unixsock section of the collectd.conf(5) manual page for an in-depth description of the plugin's configuration.
Synopsis¶
LoadPlugin unixsock
# ...
<Plugin unixsock>
SocketFile "/path/to/socket"
SocketGroup "collectd"
SocketPerms "0770"
DeleteSocket true
</Plugin>
Dependencies¶
- none
Examples¶
collectdctl listval # collectdctl is available since version 5.0.0
echo "PUTNOTIF severity=okay time=$(date +%s) message=hello" | \
socat - UNIX-CLIENT:/path/to/socket
See also¶
Configuration¶
Configuration options · from collectd.conf(5)
See this section in the full configuration reference
- SocketFile Path
- Sets the socket-file which is to be created.
- SocketGroup Group
- If running as root change the group of the UNIX-socket after it has been created. Defaults to collectd.
- SocketPerms Permissions
- Change the file permissions of the UNIX-socket after it has been created. The permissions must be given as a numeric, octal value as you would pass to
chmod(1). Defaults to 0770. - DeleteSocket false|true
- If set to true, delete the socket file before calling
bind(2), if a file with the given name already exists. If collectd crashes a socket file may be left over, preventing the daemon from opening a new socket when restarted. Since this is potentially dangerous, this defaults to false.