in reply to Whats wrong with this? & Timeouts
It is supposed to display the down gif when any one of the variables in brackets i.e ($mx1pop|$mx1imap) is not responding, but if i take one of the servers down, it waits for ages before still displaying the up gif.if ($mx1pop3|$mx1imap|mx1smtp) { print "<IMG SRC='http://www.xxx.com/images/up.gif' WIDTH=38 HEIGHT=2 +1>"; } else { print "<IMG SRC='http://www.xxx.com/images/down.gif' WIDTH=38 HEIGHT +=21>"; }
In addition to the error that Ovid pointed out, you have a logic error as well. Since you want down.gif to be displayed if any of the servers is down, you want the up.gif to be displayed only when all of them are up. In other words, you should be using logical and, rather than logical or, in your if statements.
if ($mxlpop3 && $mxlimap && $mxlsmtp) { # Display up.gif } else { # Display down.gif }
-sauoq "My two cents aren't worth a dime.";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Whats wrong with this? & Timeouts
by lostperls (Initiate) on Sep 09, 2002 at 22:27 UTC | |
by sauoq (Abbot) on Sep 09, 2002 at 22:34 UTC | |
by lostperls (Initiate) on Sep 09, 2002 at 22:36 UTC | |
by sauoq (Abbot) on Sep 09, 2002 at 22:38 UTC |