Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

This topic is 7046 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

After experiencing several interuptions in service where the Web Publishing Engine went down, causing downtime for remote offices trying to access IWP as well as several PHP scripts that access different databases, I wrote my own shell script to check to see if it was still accessible.

Part of the problem was that I've seen this happen where the WPE is still running, but it's no longer responding from the /fmi/config pages... I can log in, but can't get the WPE portion to respond. Sometimes it affects IWP right away, but sometimes it takes hours to eventually crash altogether.

What I've done is check the web page for IWP to see if it's still returning "200 OK", otherwise tries to restart WPE. Here's the script:

:)

#!/bin/sh



# script to be run from cron to watchdog the WPE service



if (curl -sI http://your_server_ip/fmi/iwp/res/iwp_home.html | grep -c '200 OK' ) ; then

# WPE appears to be up and running.

        echo 'WPE Up!'

else

# WPE service down, we'll restart it now

        echo 'WPE Down!'

        systemstarter stop 'FileMaker Web Publishing'

        systemstarter start 'FileMaker Web Publishing'

fi





I saved this as "watchdog.sh" in the Scripts folder of FileMaker Server's Library folder. Just replace out "your_server_ip" with the IP address of your server.



Next, I run this from cron every 5 minutes to make sure it's still up. Here's the syntax for that (the crontab is at "/etc/crontab")
*5      *       *       *       *       root    /bin/sh /Library/FileMaker Server 7/Data/Scripts/watchdog.sh

Note: those are tabs in between the different "fields" on the crontab, otherwise it won't work.

Hope this helps someone out, if they're having the same trouble with WPE going down.

  • Newbies
Posted

Duncan,

I was having the exact same problem, and was actually working on the syntax for a watchdog script of my own. Thanks for being generous enough to post your own efforts. It saved me several hours of angst...

  • 2 weeks later...
Posted

I added a timeout to the curl call, since it will wait indefinitely unless otherwise specified. Here's where it changed, but I'm still having problems getting this to restart after IWP goes down, which is really frustrating. Cron runs it as root, and I'm logging to a file now, so I know it's trying to run... anyone have any ideas?

#!/bin/sh



# script to be run from cron to watchdog the WPE service



if (curl -sI --connect-timeout 10 --max-time 30 http://10.0.0.38/fmi/iwp/res/iwp_home.html | grep -c '200 OK' ) ; then

# WPE appears to be up and running.

        echo WPE-Up:`date +%Y%m%d%H%M%S` >> /Users/master/Desktop/wpe.log

else

# WPE service down, we'll restart it now

        echo WPE-Down:`date +%Y%m%d%H%M%S` >> /Users/master/Desktop/wpe.log

        systemstarter stop 'FileMaker Web Publishing'

        systemstarter start 'FileMaker Web Publishing'

fi

The phrase "goes down more than an asian whore" was uttered by one of my colleaques, it's a little frustrating. Not happy with IWP right now.

Posted

How many users are accessing your machine via IWP. I've been running for months now without a hiccup on OS X 10.3.8. I have about 150 users on the system in total, but I've never had more than 10 sessions going simultaneously.

Posted

I don't think I've ever seen more than 10 IWP users connected at any one time. There is a xml accessed app, which has a php script watching a particular FM file on the server, which makes a request once a minute. That's not IWP though.

It just went down again, this time it wouldn't even come back up by running the systemstarter command manually, which sometimes works.

;)

Posted

Update: I may have had some success by adding a line to the shell script. I added in "sleep 5" between the stop and start commands in the script. It seems that it was calling the start command too soon after, and it allows it time to stop before trying to start again.

I still don't feel 100% confident with it, but it just restarted on it's own like it was supposed to. This time at least.

This topic is 7046 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.