Add some troubleshooting comments.
Change the AGENT variable comparison to numeric to avoid "unexpected operator" fault on bash 5 / Debian 11.
Verify the radcheck result is valid before parsing it.
Parse result using a single call to sed with multiple commands to cut CPU time in half and syscalls by 90%.
Since the LibreNMS app module carefully extracts only the stats it needs, I experimented with just matching on FreeRADIUS-Total or FreeRADIUS-Queue, but found no significant improvement. At least this method explicitly declares what is being passed.
I canceled my prior similar PR which had dropped the .sh extension, since that could break existing configs.
Add some troubleshooting comments. Change the AGENT variable comparison to numeric to avoid "unexpected operator" fault on bash 5 / Debian 11. Verify the radcheck result is valid before parsing it. Parse result using a single call to sed with multiple commands to cut CPU time in half and syscalls by 90%.
Since the LibreNMS app module carefully extracts only the stats it needs, I experimented with just matching on FreeRADIUS-Total or FreeRADIUS-Queue, but found no significant improvement. At least this method explicitly declares what is being passed.
I canceled my prior similar PR which had dropped the .sh extension, since that could break existing configs.