Skip to content

Check socket file permissions before starting #9

@RubenHoms

Description

@RubenHoms

Version

v1.1.1

File / Feature

Reading metrics from the OpenSIPS socket file.

Expected behaviour

It should tell me that I don't have the right permissions to read from the socket file and exit with a useful info message.

Actual behaviour

The exporter runs and spits our permission denied errors.

Stacktrace / Error message

Started OpenSIPS exporter, listening on :9434
Error encountered while reading statistics from opensips socket: read unixgram /tmp/opensips_exporter158593694/1.sock: i/o timeout
ERROR:mi_datagram:mi_datagram_server: failed to send the response: Permission denied (13)

Other info

Same error came up in #8, with the simple fix being "run it as the same user your OpenSIPS socket file is created with". It would make sense to have the exporter check the socket file permissions against the user it is running as. If they're not the same user, or don't have the proper permissions to read from the file, the exporter should exit and print a message telling them to run the exporter as the correct user.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinggood first issueGood for newcomershelp wantedExtra attention is needed

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions