Skip to content

OpenSIPS can bind to network sockets for mi_datagram instead of unix domain sockets #13

@gwvandesteeg

Description

@gwvandesteeg

Version

OpenSIPS Exporter Version: 2.0.4
OpenSIPS 2.4.8

File / Feature

switch *protocol {

This is the switch statement which looks at the type of connection and either connects via the mi_http interface, or the unix domain socket (a file on the filesystem), which would normally match the filename of the socket used in the socket_name setting of mi_datagram. However, the opensips configuration allows the socket to be defined as a network socket instead of a filename.

loadmodule "mi_datagram.so"
modparam("mi_datagram", "socket_name", "udp:127.0.0.1:8090")

Expected behaviour

The socket connection would be accepted and relevant metrics get provided when queried for.
This means that the client interprets the socket path and checks whether it is a UDP socket instead of a filename and connects and queries accordingly.

Actual behaviour

$ opensips_exporter -protocol mi_datagram -addr 127.0.0.1:9434 -socket udp:127.0.0.1:8090
2020/12/06 22:52:29 Started OpenSIPS exporter, listening on 127.0.0.1:9434
2020/12/06 22:52:31 Error encountered while reading statistics from opensips socket: write unixgram opensips_exporter422669750/1.sock->udp:127.0.0.1:8090: sendto: no such file or directory
2020/12/06 22:52:31 Problems registering the *processors.pkmemProcessor processor (could be due to no metrics found for this processor). Error: collector has no descriptors

Stacktrace / Error message

nil

Other info

nil

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinggood first issueGood for newcomers

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions