Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 58808 - mon 0.99.2-r1 included fping.monitor script has a bit of a bug, easily fixed
Summary: mon 0.99.2-r1 included fping.monitor script has a bit of a bug, easily fixed
Status: RESOLVED LATER
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Server (show other bugs)
Hardware: All Linux
: High minor (vote)
Assignee: Gentoo Netmon project
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-07-29 11:29 UTC by Daniel
Modified: 2004-07-29 14:24 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Daniel 2004-07-29 11:29:48 UTC
After doing a fresh emerge of app-admin/mon-0.99.2-r1 which installs net-analyzer/fping-2.4_beta2-r1 I've found that the included /usr/lib/mon/mon.d/fping.monitor script has a bit of a bug in that it erroneously reports "unidentified output from fping: ..." when the target host is clearly unreachable. This causes the script to run really slow. My solution is below. My appologies if this is the wrong place to post this.

Reproducible: Always
Steps to Reproduce:
This maybe dependent upon hardware used, I'm not sure.
1. Emerge mon-0.99.2-r1.
2. Run /usr/lib/mon/mon.d/fping.monitor and supply it with an IP that you know is unreachable.
3. The response will be very slow and start with erroneous messages.
Actual Results:  
This is the output from "/usr/lib/mon/mon.d/fping.monitor 192.168.1.77" where
192.168.1.9 happens to be the localhost:
unidentified output from fping: [ICMP Host Unreachable from 192.168.1.9 for ICMP
Echo sent to 192.168.1.77]
unidentified output from fping: [ICMP Host Unreachable from 192.168.1.9 for ICMP
Echo sent to 192.168.1.77]
unidentified output from fping: [ICMP Host Unreachable from 192.168.1.9 for ICMP
Echo sent to 192.168.1.77]
unidentified output from fping: [ICMP Host Unreachable from 192.168.1.9 for ICMP
Echo sent to 192.168.1.77]
192.168.1.77

start time: Thu Jul 29 10:27:23 2004
end time  : Thu Jul 29 10:27:39 2004
duration  : 16 seconds

------------------------------------------------------------------------------
unreachable hosts
------------------------------------------------------------------------------
192.168.1.77




Expected Results:  
This is the correct output after fixing the script:
192.168.1.77

start time: Thu Jul 29 10:44:59 2004
end time  : Thu Jul 29 10:44:59 2004
duration  : 0 seconds

------------------------------------------------------------------------------
unreachable hosts
------------------------------------------------------------------------------
192.168.1.77




###############################
#######   FIX   ###############
###############################
The problem is that the fping response has the word "Unreachable" in it and the
script is looking for "unreachable". Here's how to fix it:
In /usr/lib/mon/mon.d/fping.monitor line 70 which looks something like:
    if (/^(\S+).*unreachable/)

change it to:
    if (/^(\S+).*unreachable/i)

this makes the regex case insensitive. It may be a good idea to make all the
regex's this way in the even that fping responses change case as apparently has
happend. This makes the script work like it should and in particular return an
unreachable response as fast as it should.

Fun stuff!
Comment 1 Daniel 2004-07-29 14:24:11 UTC
Here's a snippet from an email I got from Jim Trocki, the author of mon:


thank you, i've just checked the fix into the mon-1-0-0pre1
branch in sourceforge.

i'd suggest you give the latest "stable" branch a try. i've recently
fixed lots of outstanding bugs in it, and hopefully sometime soon
it'll turn into the officially blessed 1.0.0 stable release.

see this to get the latest stable branch from cvs:

    http://www.kernel.org/software/mon/development.html