History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: GWMON-34
Type: Bug Bug
Status: Resolved
Resolution: Fixed
Priority: Standard Standard
Assignee: Richard Barry-Smith
Reporter: Bas Couwenberg
Votes: 0
Watchers: 1
Operations

If you were logged in you would be able to see more operations.
GroundWork Monitor Open Source

Nagios plugin check_fping cannot find fping executable

Created: 25/Apr/08 04:49 AM   Updated: 21/May/08 12:45 PM
Component/s: Installation/Upgrade, Nagios, Plugins
Affects Version/s: None
Fix Version/s: None

Original Estimate: Unknown Remaining Estimate: Unknown Time Spent: Unknown
Environment:
CentOS 5
GWMCE 5.2


 Description  « Hide
While testing GWMCE 5.2 I noticed that all Nagios checks using check_fping were not working, turned out that it couldn't find the fping executable:

[root@magma2 ~]# /usr/local/groundwork/nagios/libexec/check_fping -H 80.248.41.134 -w 500.0,20% -c 10000.0,90% -n 3 -v
/usr/local/groundwork/sbin -b 56 -c 3 80.248.41.134
FPING UNKNOWN - 80.248.41.134

I fixed it by recompiling check_fping from the upstream nagios-plugins-1.4.10 tarball:

[root@magma2 nagios-plugins-1.4.10]# ./plugins/check_fping -H 80.248.41.134 -w 500.0,20% -c 10000.0,90% -n 3 -v
/usr/local/groundwork/sbin/fping -b 56 -c 3 80.248.41.134
80.248.41.134 : [0], 84 bytes, 18.6 ms (18.6 avg, 0% loss)
80.248.41.134 : [1], 84 bytes, 18.5 ms (18.6 avg, 0% loss)
80.248.41.134 : [2], 84 bytes, 18.0 ms (18.4 avg, 0% loss)

80.248.41.134 : xmt/rcv/%loss = 3/3/0%, min/avg/max = 18.0/18.4/18.6
FPING OK - 80.248.41.134 (loss=0%, rta=18.400000 ms)|loss=0%;20;90;0;100 rta=0.018400s;0.500000;10.000000;0.000000

The nagios plugins were configured with:

./configure --prefix=/usr/local/groundwork/nagios --with-nagios-user=nagios --with-nagios-grp=nagios --with-fping-command=/usr/local/groundwork/sbin/fping

 All   Comments   Work Log   Change History      Sort Order:
Bas Couwenberg - [27/Apr/08 02:20 AM ]
The recompile was not enough, it gives us a working check_fping, but only for root, the nagios user cannot run the fping executable:

-bash-3.1$ id
uid=100(nagios) gid=1985(nagios) groups=1985(nagios)
-bash-3.1$ ./check-host.pl | less
Checking amf-ricoh (195.18.117.16)
Exec: /usr/local/groundwork/nagios/libexec/check_fping -H 195.18.117.16 -w 500.0,20% -c 10000.0,90% -n 3 -v
/usr/local/groundwork/sbin/fping -b 56 -c 3 195.18.117.16
This program can only be run by root, or it must be setuid root.
FPING WARNING - 195.18.117.16

So we have to make fping setuid root, and after this change the nagios user can successfully run the check_fping Nagios check command and the fping binary it depends on:

-bash-3.1$ ls -l /usr/local/groundwork/sbin/fping
-rwsr-sr-x 1 root root 28301 Mar 19 00:13 /usr/local/groundwork/sbin/fping
-bash-3.1$ ./check-host.pl | less
Checking amf-ricoh (195.18.117.16)
Exec: /usr/local/groundwork/nagios/libexec/check_fping -H 195.18.117.16 -w 500.0,20% -c 10000.0,90% -n 3 -v
/usr/local/groundwork/sbin/fping -b 56 -c 3 195.18.117.16
195.18.117.16 : [0], 84 bytes, 9.31 ms (9.31 avg, 0% loss)
195.18.117.16 : [1], 84 bytes, 7.86 ms (8.58 avg, 0% loss)
195.18.117.16 : [2], 84 bytes, 8.05 ms (8.40 avg, 0% loss)

195.18.117.16 : xmt/rcv/%loss = 3/3/0%, min/avg/max = 7.86/8.40/9.31
FPING OK - 195.18.117.16 (loss=0%, rta=8.400000 ms)|loss=0%;20;90;0;100 rta=0.008400s;0.500000;10.000000;0.000000


Bas Couwenberg - [27/Apr/08 02:24 AM ]
The GWMCE installer installs the fping binary in /usr/local/groundwork/sbin/fping with the permissions:

-rwxr-xr-x 1 nagios nagios 28301 Mar 19 00:13 fping

This is the sane thing to do securitywise, but it makes the fping binary unusable for the nagios user who executes the check_fping check command.

Richard Barry-Smith - [28/Apr/08 12:04 PM ]
Bas,

Thank you for __all__ your input. I have submitted this issue in to our internal bug database.

Bas Couwenberg - [02/May/08 02:59 AM ]
You're welcome.

Contributing to the Open Source version in this way is the least I can do while our company isn't using the Pro or Enterprise version.

Richard Barry-Smith - [21/May/08 12:45 PM ]
This issue was Resolved-Fixed with the 5.2.1 Release; which was posted on to SourceForge today.