Bullwinkle: Hey Rocky, watch me pull a rabbit out of my hat.
Rocky: But that trick never works.
Bullwinkle: This time for sure.
Presto!
Well, I'm gettin' close.
Rocky: And now it's time for another special feature.
--- "Rocky and His Friends"

XmDipmon is a nifty little application that displays a button showing the
status of an Internet connection. It flashes and beeps when the connection
is broken, as is all too often the case in on rural telephone systems.
Unfortunately, XmDipmon works only with dip, making it useless
for those people, the majority, who use chat to connect.

Building XmDipmon is not a problem. XmDipmon links to the Motif
libraries, but it builds and works fine with Lesstif. The
challenge is to alter the package to work when using chat. This
involves actually tinkering with the source code, and necessarily requires
some programming knowledge.

"When xmdipmon starts up, it checks for a file called /etc/dip.pid
(you can let it look at another file by using the -pidfile
command line option). This file contains the PID of the dip
deamon (dip switches itself into deamon mode once it has
established a connection)."
--- from the XmDipmon README file

Using the -pidfile option, the program can be directed to
check for a different file upon startup, one that exists only during
a successful chat login. The obvious candidate is the modem
lock file. We could therefore try invoking the program with xmdipmon
-pidfile /var/lock/LCK..ttyS3 (this assumes that the modem is on
com port #4, ttyS3). This only solves part of the problem, however. The
program continually monitors the dip daemon, and we need to
change this so it instead polls a process associated with chat
or ppp.

There is only a single source file, and fortunately it is
well-commented. Scanning the xmdipmon.c file, we find the
getProcFile function, whose header description reads as follows.

Rebuild the revised package. No problems with the build. Now test it
with the new command line argument. It works like a charm. The little
blue button indicates when a ppp connection to the ISP has
been established, and flashes and beeps when the connection is broken.
Now we have a fully functional chat monitor.