System-files for the alertsync snap

Hello,

I am writing to discuss the approval of the system-files interface for usage on the alertsync snap. Ideally, the two plugs below would be auto-connected, as they are required for the software’s interaction with Nagios and other compatible software. I suspect I will have to amend these paths to support other monitoring systems such as Icinga, etc, but for now, the below paths are enough.

plugs:
  read-nagios3-livestatus:
    interface: system-files
    read:
      - /var/lib/nagios3/livestatus
  write-nagios3-livestatus:
    interface: system-files
    write:
      - /var/lib/nagios3/livestatus

Is this currently the preferred method for accessing (rw) a UNIX domain socket on the host system?
Alternatively, livestatus could be reconfigured to use TCP, and this snap could use the network binding, however that would be less secure than the current configuration of using a local domain socket, as livestatus connections are only needed locally.

Thanks!
James

FYI write implies read so there is no need for both a read and write version of this interface.

However I am not sure this would even work in practice since /var/ inside the snap is not the real /var from the host - instead I think you would have to access this path via hostfs - ie. /var/lib/snapd/hostfs/var/lib/nagios3/livestatus - and so this should be modified to:

plugs:
  hostfs-var-lib-nagios3-livestatus:
    interface: system-files
    write:
      - /var/lib/snapd/hostfs/var/lib/nagios3/livestatus
1 Like

Hi Alex,

Thanks for reviewing this and your suggestion. I’ve pushed an updated snap which is building on my CI system right now.

Best,
James

+1 from me for write access to /var/lib/snapd/hostfs/var/lib/nagios3/livestatus as above. Can other @reviewers please vote?

+1 from me for write access to that location.

+1 from me as well for write access to /var/lib/snapd/hostfs/var/lib/nagios3/livestatus.

3 votes for, 0 against for write access to /var/lib/snapd/hostfs/var/lib/nagios3/livestatus using the nagios3-livestatus reference. This is now live.