On Wed, Oct 18, 2023 at 01:49:00PM +0200, Martijn van Duren wrote: > Right now we return the same value for both hrSWRunName and hrSWRunPath. > hrSWRunPath should return the full path of the binary, and hrSWRunName > a description of the running software. > > Afaik there's no proper way to retrieve the full path of the running > binary.
No there isn't. It's been discussed many times. > However, in a lot of cases argv[0] can contain the full or > relative path. But if argv[0] gets overwritten (like most of our > daemons' children) it gives a more descriptive name, which is more in > line with hrSWRunName. > > netsnmp's snmpd uses argv[0] for hrSWRunPath and kinfo_proc's p_comm for > hrSWRunName, and snmptop defaults to hrSWRunName. top(1) also defaults > to p_comm, but contrary to top(1), snmptop allows us to switch between > hrSWRunName, and hrSWRunPath and toggling of hrSWRunParameters > independently, where top(1) toggles between p_comm and argv[]. > > So there's an argument to be made either way, but for this diff I stuck > with netsnmp's choices. I am fine with your choices and people feeling strongly about this had week to object. > > While here, change the buffer length from 128 to 129. HOST-RESOURCES-MIB > allows up to 128 characters in the response, so make room for the > terminating NUL. > > Thoughts? OK? ok tb