Graphical Internet and Website Server Monitor
Author: Carl Sassenrath
This example requires REBOL/View
Return to REBOL Cookbook
Here is the improved Internet server monitor that I use a lot these
days. It's different in a few ways from prior monitors:
- Monitors multiple servers.
- Can monitor web sites but also other services that allow TCP connections,
such as AltME worlds, game servers, etc.
- Updates every 10 minutes (or set it to whatever time period you want).
- Click any indicator button to check again. Right click to open web
browser to that site.
- Only makes the TCP connection - no data transferred (so should not
cause your website statistics be affected.)
- Cool looking graphical interface (with DRAW generated indocators).
Here's a screen shot of the site monitor. Green means good, red
means bad. The indicators are created from a DRAW description not an
image, so you can modify how they look just with a few small edits
to the script.
- This approach uses a simple TCP connection. Sometimes a physical
server may make the connection, but the service itself (e.g. web
server) may not actually be down. It is rare, but it can happen.
This monitor will not detect such outages.
- Some web sites use redirection of the URL to the actual server.
The method here will not account for that redirection.
Here is the code. Just change the sites list for the servers you
want to monitor. Note the example that checks an AltME world by
specifying a check on port 5400.
Title: "GISMo - Graphical Internet Server Monitor"
Author: "Carl Sassenrath"
Needs: [view 1.3.1]
time-out: 5 ; Seconds to wait for the connection (adjust it!)
; List of URLs (http or tcp are allowed)
foreach site sites [
; Convert any http to tcp on port 80
if find/match site http:// [
insert remove/part site 7 tcp://
append site ":80"
img: make image! [200x40 0.0.0.255]
draw img [
fill-pen linear 0x0 0 44 89 1 1 silver gray coal silver
box 8.0 0x0 199x39
out: [backeffect [gradient 0x1 black coal]]
foreach site sites [
port: make port! site
append out compose/deep [
image img (form port/host) [check-site face] [browse face/data]
with [data: (site)]
append out [
btn water 100 "Refresh" rate poll-time feel [
engage: func [f a e] [if find [time down] a [check-sites]]
color-face: func [face color] [
face/effect: reduce ['colorize color]
check-site: func [face] [
color-face face gray
color-face face either attempt [close open face/data true][green][red]
check-sites: does [
foreach face out/pane [
if face/style = 'image [check-site face]
out: layout out
Depending on the speed of your Internet access and the location of
the server on the net, it may be necessary to adjust the time-out