lists.netmrg.net lists.netmrg.net
NetMRG discussion and support
 
FAQ :: Search :: Memberlist :: Usergroups :: Register
Profile :: Log in to check your private messages :: Log in

Problems with events and responses

 
Post new topic   Reply to topic    lists.netmrg.net Forum Index -> Support
Author Message
mrjack
Beginner


Joined: 16 Aug 2004
Posts: 2
Location: Germany, Nuremberg

PostPosted: Tue Aug 17, 2004 12:18 pm    Post subject: Problems with events and responses Reply with quote

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

PostPosted: Wed Aug 18, 2004 1:55 am    Post subject: Reply with quote

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

PostPosted: Tue Sep 14, 2004 12:20 am    Post subject: Reply with quote

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
Display posts from previous:   
Post new topic   Reply to topic    lists.netmrg.net Forum Index -> Support All times are GMT
Page 1 of 1

 



smartBlue Style © 2002 Smartor
Powered by phpBB © 2001, 2002 phpBB Group