[FX.php List] Monitoring WPE connection
Bob Patin
bob at patin.com
Thu Aug 25 04:21:51 MDT 2011
Hey Tim,
So will that test fail if the WPE loses connection to the database server?
Last night it failed and I did get the email, so perhaps my method's not as bad as I thought, but I'd like to have something that I could be sure will alert me each time.
Reinstalling FMServer right now, hope this fixes it. Very annoying.
Bob Patin
Longterm Solutions LLC
bob at longtermsolutions.com
615-333-6858
http://www.longtermsolutions.com
FileMaker 9, 10 & 11 Certified Developer
Member of FileMaker Business Alliance and FileMaker TechNet
--
Twitter: bobpatin
Google+: http://www.longtermsolutions.com/plus
AIM: longterm1954
iChat: bobpatin
--
Expert FileMaker Consulting
FileMaker Hosting for all versions of FileMaker
On Aug 24, 2011, at 9:02 PM, Tim 'Webko' Booth wrote:
> Dear Bob,
>>
>> Ah I see what you are trying to do... alert yourself from an FX page if it doesn't load correctly.
>
> Well, you can make a call from a page to check if Port 80 is responding on the remote server and do something then before FX is invoked - I do use that for some checks, but I think only on a single machine deployment.
>
> <?php
>
> // Insert valid hostname, user, password, database name and layout in the database (lines 5, 9, 10, 11 & 24)
> $dbHost='xxx.xxx.com.au'; //Database IP
> $port='80'; //Webserver Port
> $dbType='FMPro7'; //For FMPro7
> $conType='HTTP'; //Connection Type
> $dbUser='web_user'; //Database User Name
> $dbPass='password'; //Database Password
> $dbName='Database'; //Database Name
>
> include_once('FX/FX.php'); // FX.php file
>
> //Simple server tests
> $_SESSION['serverError'] = ""; // reset server error
> //Check if Port 80 works at all
> if( !fsockopen ($dbHost, 80, $errno, $errstr, 2) ) {
> $_SESSION['serverError'] = "Server not up";
> } else {
> //Check if a findany to an available table works
> $pageObj=new FX($dbHost,$port,$dbType,$conType);
> $pageObj -> setDBPassword($dbPass,$dbUser);
> $pageObj -> setDBData($dbName,'VALID LAYOUT NAME', 'all');
> $pageData = $pageObj -> FMFindAny();
> $_SESSION['serverError'] = $pageData['errorCode'];
> }
> if ($_SESSION['serverError'] != "0") {
> echo "Error: ".$_SESSION['serverError'];
> }
> ?>
>
>
> _______________________________________________
> FX.php_List mailing list
> FX.php_List at mail.iviking.org
> http://www.iviking.org/mailman/listinfo/fx.php_list
More information about the FX.php_List
mailing list