ConceptΒΆ
Since the tool smbstatus provided by the samba project can only run with elevated rights, and a prometheus exporter always exposes a public network endpoint, the samba_exporter package contains two services.
- samba_exporter: The prometheus exporter service that exposes the public network endpoint for the prometheus server to collect the data running as non privileged user
- samba_statusd: The service uses
smbstatus
to collect data and return it when requested running as privileged user
Both services can communicate using a named pipe owned by a common group, see diagram below.
%%{init: {'theme':'dark'}}%%
sequenceDiagram
participant samba_exporter
participant request.pipe
participant response.pipe
participant samba_statusd
samba_exporter->>request.pipe: Request status data
loop
samba_statusd ->> request.pipe: Check request data
end
samba_statusd ->> samba_statusd: Process request
samba_statusd ->> response.pipe: Send response data
loop
samba_exporter ->> response.pipe: Wait for response
end
samba_exporter ->> samba_exporter: Process response