Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

KEA dhcp client hostname to syslog #8054

Open
thsundel opened this issue Nov 12, 2024 · 5 comments
Open

KEA dhcp client hostname to syslog #8054

thsundel opened this issue Nov 12, 2024 · 5 comments

Comments

@thsundel
Copy link

thsundel commented Nov 12, 2024

Important notices

Before you add a new report, we ask you kindly to acknowledge the following:

Describe the solution you like

Would it be possible to send device hostname to syslog when device contacts server?
At the moment it only sends mac adress, example: INFO [kea-dhcp4.dhcp4.0x33e0b3417b00] DHCP4_QUERY_LABEL received query: [hwtype=1 ma:ca:dd:re:ss:xx], cid=[ma:ca:dd:re:ss:xx], tid=0xa573c42c

Additional context

According to kea documentation this logger-name needs to be activated.
kea-dhcp4.ddns, kea-dhcp6.ddns | core | Used by the DHCP server to log messages related to Client FQDN and Hostname option processing. It also includes log messages related to the relevant DNS updates.

https://kea.readthedocs.io/en/kea-2.2.0/arm/logging.html#the-name-string-logger

@AdSchellevis
Copy link
Member

@thsundel can you update the ticket with documentation links you found? It helps when someone wants to implement the feature

@AdSchellevis
Copy link
Member

I'm not sure if anything needs to be activated here, according to the documentation, loggers inherit from their parent:

The loggers form a hierarchy. For each program in Kea, there is a “root” logger, named after the program (e.g. the root logger for kea-dhcp4, the DHCPv4 server, is named kea-dhcp4). All other loggers are children of this logger and are named accordingly, e.g. the allocation engine in the DHCPv4 server logs messages using a logger called kea-dhcp4.alloc-engine.

My guess would be that messages you're searching for need a higher log level, you could try to change the level for testing purposes in:

@thsundel
Copy link
Author

Thank you for having a look at this feature request and yes I think you are correct. I had to set severity to DEBUG and debuglevel to 55 before hostname was included in the syslog message.

'severity' => 'INFO',
'debuglevel' => 55,

But that setting produces a lot of extra noise that I'm not interested in, I guess I'm out of luck then...

Thanks again for taking the time.

@thsundel
Copy link
Author

But if I add the following then I get the result I'm looking for, without extra noise. I guess this is not possible to get into the distro and I have to manually change whenever I update OPNsense?

                     [
                        'name' => 'kea-dhcp4.ddns',
                        'output_options' => [
                            [
                                'output' => 'syslog'
                            ]
                        ],
                        'severity' => 'DEBUG',
                        'debuglevel' => 55,
                    ]

@AdSchellevis
Copy link
Member

I guess the amount of noise is staggering when changing the top level collector (kea-dhcp4) to debug/55, that would be an easy addition, micro managing the options will be quite an effort to do properly, not sure I want to spend my time on that to be honest.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants