Monitor DHCP Server []

Frank, Jason JasonFrank at srcp.com
Fri Apr 21 16:39:46 CEST 2006


There are several reasons to fail to bind a low numbered port.  The most
obvious is not having root privileges.  If you running as root
(regardless if the program is setuid root), that is not in play.  The
second most obvious is that something else is already listening on that
port.  I'd check that next.

Jason

-----Original Message-----
From: nagios-users-admin at lists.sourceforge.net
[mailto:nagios-users-admin at lists.sourceforge.net] On Behalf Of Melkiades
Sent: Friday, April 21, 2006 4:35 AM
To: nagios-users at lists.sourceforge.net
Subject: Re: [Nagios-users] Re: Monitor DHCP Server []

> [Rene]
> You're still in the compliation directory. check_dhcp is not set suid.
> If you do "make install" it will be copied to the plugin directory
> (usually /usr/local/nagios/libexec) and will get suid BUT as it seems
> you're execute check_dhcp as root in the example above (according to
> the '#'). This should work! Perhaps the problem isn't check_dhcp, but
> there's missing something...
> Please try to run check_dhcp directly as root without sudo.

So, as root

# rm /opt/nagios/nagios-plugins-1.4.2/plugins/check_dhcp
# rm /usr/local/nagios/libexec/check_dhcp

# cd /opt/nagios/nagios-plugins-1.4.2/plugins/

# make check_dhcp
gcc  -g -O2  -L. -o check_dhcp  check_dhcp.o netutils.o utils.o
../lib/libnagiosplug.a ../lib/libcoreutils.a  -lnsl -lresolv
-I/usr/include

# make install
make[1]: Entering directory `/opt/nagios/nagios-plugins-1.4.2/plugins'
mkdir -m 0755 -p -- /usr/local/nagios/libexec
  /usr/bin/install -c check_dhcp /usr/local/nagios/libexec/check_dhcp
...

# ll /opt/nagios/nagios-plugins-1.4.2/plugins/check_dhcp
-rwxr-xr-x  1 root root 56028 Apr 21 11:26 check_dhcp

# ll /usr/local/nagios/libexec/check_dhcp
-rwxr-xr-x  1 root root 56028 Apr 21 11:26 check_dhcp

# cd /usr/local/nagios/libexec

# ./check_dhcp -s 10.1.2.97 -v
DHCP socket: 3
Error: Could not bind to DHCP socket (port 68)!  Check your
privileges...

:-(
Thanks for your help, Rene


-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services,
security?
Get stuff done quickly with pre-integrated technology to make your job
easier Download IBM WebSphere Application Server v.1.0.1 based on Apache
Geronimo
http://sel.as-us.falkag.net/sel?cmd=k&kid0709&bid&3057&dat1642
_______________________________________________
Nagios-users mailing list
Nagios-users at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when
reporting any issue.
::: Messages without supporting info will risk being sent to /dev/null


<font size="1" face="arial">This message (including any attachments) may contain confidential or otherwise privileged information and is intended only for the individual(s) to which it is addressed. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately by e-mail if you have received this e-mail by mistake and delete this e-mail from your system. E-mail transmission cannot be guaranteed to be secured or error-free as information could be intercepted, corrupted, lost, destroyed, arrive late or incomplete, or contain viruses. The sender therefore does not accept liability for any errors or omissions in the contents of this message or that arise as a result of e-mail transmission. If verification is required please request a hard-copy version from the sender.

SOURCECORP, Incorporated
www.srcp.com
</font>


-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid0709&bid&3057&dat1642
_______________________________________________
Nagios-users mailing list
Nagios-users at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when reporting any issue. 
::: Messages without supporting info will risk being sent to /dev/null





More information about the Users mailing list