OpenBSD: check_dhcp dumps core

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
mksmr
Posts: 55
Joined: Thu Sep 22, 2016 7:17 am

OpenBSD: check_dhcp dumps core

Post 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
Hulluna humpasta taas
Minä olen hulluna humpasta taas
Minen toivu koskaan, luotan voimaan votkan
Hulluna humpasta taas
avandemore
Posts: 1597
Joined: Tue Sep 27, 2016 4:57 pm

Re: OpenBSD: check_dhcp dumps core

Post 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
Previous Nagios employee
Locked