Warning: This plugin must be either run as root or setuid root.
To run as root, you can use a tool like sudo.
To set the setuid permissions, use the command:
 
chmod u+s yourpluginfile (chmod +s yourpluginfile

[root <at> nagios libexec]# su nagios
[nagios <at> nagios libexec]$ ./check_dhcp
Warning: This plugin must be either run as root or setuid root.
To run as root, you can use a tool like sudo.
To set the setuid permissions, use the command:
        chmod u+s yourpluginfile
Error: Could not bind socket to interface eth0.  Check your
privileges...
[nagios <at> nagios libexec]$ exit
exit
[root <at> nagios libexec]# chmod u+s check_dhcp
[root <at> nagios libexec]# ./check_dhcp
Warning: This plugin must be either run as root or setuid root.
To run as root, you can use a tool like sudo.
To set the setuid permissions, use the command:
        chmod u+s yourpluginfile
Error: Could not bind socket to interface eth0.  Check your
privileges...
[root <at> nagios libexec]# ls -lah check_dhcp
-rwsrwxr-x 1 nagios nagios 76K 2008-09-19 18:01 check_dhcp
[root <at> nagios libexec]# chown root:root check_dhcp
[root <at> nagios libexec]# ./check_dhcp
OK: Received 1 DHCPOFFER(s), max lease time = 0 sec.