Page 1 of 1

OpenBSD: check_dhcp dumps core

Posted: Fri Nov 11, 2016 7:27 am
by mksmr
OS: OpenBSD 6.0 on amd64
Nagios: Core 4.2.2

Good $TIMEOFDAY,

I am getting these errors:

Code: Select all

# doas -u _nagios ./check_dhcp -i em0
Error: Could not bind to DHCP socket (port 68)!  Check your privileges...
Doing the same as root results in

Code: Select all

Abort trap (core dumped)
Some more facts:
- Nagios 4.2.2 has been built with user/group _nagios/_nagios, following OpenBSD's naming
- the check modules are from OpenBSD's packages (OpenBSD comes with Nagios 4.0.8)
- the DHCP server is Microsoft's DHCP, running in a different subnet that the Nagios machine, and configured to serve IP-Addresses from a pool in this subnet

The dumped core is available.

Does anybody have ideas on that?

TIA
Matthias

Re: OpenBSD: check_dhcp dumps core

Posted: Fri Nov 11, 2016 1:45 pm
by avandemore
Please do not use doasor sudoto test unless instructed. If you need to run a test as nagios, use su - nagios

Your error message seems to outline the issue quite well. DHCP is really a layer 2 protocol and as such needs raw socket permissions to run. For example, on in a FreeBSD jail ping will not work without relaxing security sysctl. This permission isn't usually granted to standard users. The easiest thing to do is alter the command to use sudo and insure your sudoers file allows for as least that command to run without a password:

Code: Select all

nagios ALL=NOPASSWD: <PATH>/check_dhcp