View previous topic :: View next topic |
Author |
Message |
jivetolkein
Joined: 19 Jul 2007 Posts: 96
|
Posted: Mon Feb 25, 2008 9:57 am Post subject: Shell script method on SLES 10 |
|
|
Running a shell script method script on standard RMA on SLES 10:
#!/usr/bin/ksh
ERROR=0
STR="down"
ps -ef > /var/tmp/process
for i in cron ntpd postfix\/master beremote
do
if [ `grep -c $i /var/tmp/process` -ne 1 ]
then
ERROR=1
STR=$i" "$STR
fi
done
if [ $ERROR -eq 0 ]
then
echo scriptres:OK:All_backgrounds_active
else
echo scriptres:BAD:$STR
fi
Run from a shell, ps -ef returns processes as expected.
From the shell script above, run via RMA, we get the /var/tmp/process output of ps -ef truncated so its only 80 characters wide.
Any ideas? |
|
Back to top |
|
|
jivetolkein
Joined: 19 Jul 2007 Posts: 96
|
Posted: Tue Feb 26, 2008 3:37 am Post subject: |
|
|
FIXED: Setting the TERM and COLUMNS variable in the script sorts it, not necessary on other *nix/linux for some reason.
TERM=xterm
COLUMNS=500
export TERM COLUMNS
[ $# -ne 3 ] && exit
.. on the top of the script.. |
|
Back to top |
|
|
KS-Soft Europe
Joined: 16 May 2006 Posts: 2832
|
Posted: Tue Feb 26, 2008 3:52 am Post subject: |
|
|
jivetolkein wrote: | FIXED: Setting the TERM and COLUMNS variable in the script sorts it, not necessary on other *nix/linux for some reason. | Thank you for your feedback. You save our time.
Regards,
Max |
|
Back to top |
|
|
jivetolkein
Joined: 19 Jul 2007 Posts: 96
|
Posted: Tue Feb 26, 2008 4:20 am Post subject: |
|
|
No problem, I suspect you've saved rather more of mine in the past |
|
Back to top |
|
|
|