How can I read the systems serial number using dmidecode

sudo dmidecode -s system-serial-number

I have passed dmidecode as plugin. Also passed in the physical-memory as a plugin but no luck.

Please help me here

The below code works fine for me!!

IMPORTANT!! we need to connect this dmidecode to the hardware-observe plug manually. dmidecode doesn’t connect to hardware-observe unlike other libraries snap connect <YOUR_SNAP_NAME:hardware-observe> :hardware-observe

apps:
  dmidecode:
    command: usr/sbin/dmidecode
    plugs:
      - hardware-observe
parts:
  dmidecode:
    plugin: nil
    stage-packages:
      - dmidecode
plugs:
  hardware-observe:
    interface: hardware-observe

You can ask for auto-connection by opening a new post in the store-requests category…