|
|
| Author |
Message |
mrjack Beginner
Joined: 16 Aug 2004 Posts: 2 Location: Germany, Nuremberg
|
Posted: Tue Aug 17, 2004 12:18 pm Post subject: Problems with events and responses |
|
|
hi,
i have some problems getting netmrg to function correctly with my set responses.
i added a monitor "Ping Latency" and defined 3 events: highping (curval > 200), offline (curval = 0), and normal (curval >1 && < 200).. i set responses to send an email when the event is triggered.. (trigger options -> on change)
but when i filter the host i monitor, there is nothing triggered and i don't get my notification..
did i miss something?
any hints? |
|
| Back to top |
|
 |
balleman Site Admin
Joined: 20 Jan 2003 Posts: 282
|
Posted: Wed Aug 18, 2004 1:55 am Post subject: |
|
|
If you're using the ping_time.pl script, my quick test has it returning an empty line on failure, which should be parsed as a "U" (undefined/unknown value). As such, the "= 0" test should not match it.
If you can confirm that's your problem, we should probably change the script to return something like -1 when it fails, so that we can test for that, and say that the host is down. |
|
| Back to top |
|
 |
mrjack Beginner
Joined: 16 Aug 2004 Posts: 2 Location: Germany, Nuremberg
|
Posted: Tue Sep 14, 2004 12:20 am Post subject: |
|
|
the script has a bug, i changed the script like this:
# Return average ping time
($ip) = @ARGV;
@result = `ping -n -c 6 -i 0.2 -w 3 $ip 2>/dev/null`;
$result = $result[$#result];
$result =~ s/.*= //;
$result =~ s/\/.*//;
if ($result <= 0)
{
print("U\n");
}
elsif ($result eq "")
{
print "U";
}
else {
print($result);
}
now it works fine. |
|
| Back to top |
|
 |
|