hi
I have a script. Worked fine on 4 web servers, including the one where
it just stopped working 3 days ago!!!
Rebooted, etc. Apache 1.2.4, everytihng works fine, except CGI scripts
written in BASH! In them, anything in a
cat << EOM
Messages to be displayed
EOM
Do not get displayed!!!! So the HTML does not happen....Anything from
program output seems to come out. It USED to work. Works on 3 other
servers, and happens with ANY CGI-Script.
Here is my script....try it! The URL is www.isone.com/cgi-bin/systat
Thanks. Pulling my hair out over this one!!!
#!/bin/sh
if [ -e /tmp/pmwho.tmp ]; then
rm /tmp/pmwho.tmp
fi
#
/usr/local/bin/pmstat PM3-1 > /tmp/pmwho.tmp
chmod 777 /tmp/pmwho.tmp
#
echo Content-type: text/html
echo
cat << EOM
<TITLE>ISONE SERVER System Status Page</TITLE>
<H1>ISONE SERVER System Status</H1>
<HR>
EOM
cat << EOM
<H3>Current Portmaster Dialup users:</H3>
<PRE>
EOM
cat /tmp/pmwho.tmp
cat << EOM
</PRE>
EOM
cat << EOM
<H3>Current uptime/Local users:</H3>
<PRE>
EOM
w
cat << EOM
</PRE>
<HR><BR>
<P ALIGN=left><H3>Disk Space:</H3></P>
<PRE>
EOM
df
cat << EOM
</PRE>
<HR><BR>
<H3>Network Status:</H3>
<PRE>
EOM
/sbin/route
cat << EOM
</PRE>
<HR><BR>
<H3>Current Processes:</H3>
<PRE>
EOM
ps -ax
cat << EOM
</PRE>
<HR><BR>
<H3>Last 20 Portmaster logins:</H3>
<PRE>
EOM
/usr/local/bin/pmlast
cat << EOM
</PRE>
<HR><BR>
<H3>Last 20 local logins:</H3>
<PRE>
EOM
last | head -n20
cat << EOM
</PRE>
<HR><BR>
<H3>Last 25 system messages:</H3>
<PRE>
EOM
tail -n25 /var/adm/messages
cat << EOM
</PRE>
<HR>
<H3>Have a nice day!</H3>
EOM
--
======================================================================
System Administrator work: (603)424-5278
Internet Services of New England WWW: www.isone.net
Merrimack, NH 03054 "New England Internet for less"