User manual

The WebMux Pro and Model WM108E User Guide – Version 5. 8 Rev15
Copyright© 1997-2004 CAI Networks, Inc.
62
Appendix 5 – Sample Custom CGI Code
The custom cgi-bin checking program may be written in Java, VB, C, or Perl, for
example, or it may be a WB or shell script. Here is sample script written for the
linux shell bash which sees if an SSH daemon is running as its check criterion.
#!/bin/bash
echo "Content-type: text/plain"
echo # blank line
if ps -C sshd &>/dev/null ; then
echo "OK"
echo "SSH service available"
else
echo "NOT OK"
echo "SSH daemon not running"
fi