Monitor DHCP Server []

Rene Fertig me at renux.de
Fri Apr 21 10:58:39 CEST 2006


Am Freitag, 21. April 2006 10:23 schrieb Melkiades:
> # 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
>
> # ls -ls|grep dhcp
> 56 -rwxr-xr-x   1 root root 56028 Apr 21 10:21 check_dhcp
> 36 -rw-r--r--   1 root root 34869 Jan 25  2005 check_dhcp.c
> 32 -rw-r--r--   1 root root 31540 Mar 14 14:57 check_dhcp.o
>
> # sudo /opt/nagios/nagios-plugins-1.4.2/plugins/check_dhcp -s
> my.dhcp.server -v DHCP socket: 3
> Error: Could not bind to DHCP socket (port 68)!  Check your privileges...

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.
If this work, try
chmod u+s check_dhcp
and then run it as a normal user like
su - rene
cd /opt/nagios/nagios-plugins-1.4.2/plugins
./check_dhcp -s my.dhcp.server

In the meantime I have compiled and updated to plugins 1.4.3. There are no 
problems with check_dhcp, execpt that make install didn't set the execution 
permissions for all users. So if nagios runs as user daemon one need to make
chmod a+x check_dhcp

Bye, 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=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
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