I am writing a script to send digest of the netware logs. It seems to work,
but i still need a utillity to send it by email

currently the script is meant to rotate the logs daily, using cat it
generates a digest into a single file (/etc/mail/attachment.txt)

when the script is tested and working, i'll put it in the coolsollutions area

send.nlm http://www.huweb.hu/maques/dl/sendnlm.zip
seems to work from the console, but not from bash

nwmail.nlm (coolsollutions)
does not seemto work

netiher allow me to use the file generated in the script:

#!/bin/bash

#######################################
# logrotate script voor netware
# door Bernd Schepman, OGD
# netware 6.5 sp3 and above

#### NOT WORKING YET ####

# needed: sendnlm
# sendnlm can be found at http://www.huweb.hu/maques/dl/sendnlm.zip

# install: copy this script to sys:system
# put this in your cron via Remote Manager

# with older versions of netware you'll need a linux box
# use ncpmount to mount the volumes of a netware server

# ATTENTION
# Bash is case sensitive
# sys:system is in /SYS
# sys/etc is /ETC
########################################

# script start loggen
echo logrotate gestart
date

# variables
mailpath=/ETC/mail #path to copy the logs to
archive=/ETC/logs #archive path
maisrvr=localhost #mailserver, must be in hosts file
fromaddr=srvr-burn@schepman.demon.nl #mail form
toaddr=burn@schepman.demon.nl #mail to
subj=serverlogs #mail subject

#some need to be exported, for commands in backticks
export archive
export mailpath

# make paths (uncomment these later)
# mkdir $mailpath
# mkdir $archive

# clear mailpad
#rm $mailpath/*.log
rm $mailpath/attachment.txt

# begin text
echo netware logfiles rotate script, by Bernd Schepman, Operator Groep
Delft>$mailpath/attachment.txt
date>>$mailpath/attachment.txt

# function to copy the logs, this will be called later
kopierendiehandel()
{
if [ -e $pad/$log.$ext ]
then
cp $pad/$log.$ext $mailpath/$log.log
rm $archive/$log.14
mv $archive/$log.13 $archive/$log.14
mv $archive/$log.12 $archive/$log.13
mv $archive/$log.11 $archive/$log.12
mv $archive/$log.10 $archive/$log.11
mv $archive/$log.9 $archive/$log.10
mv $archive/$log.8 $archive/$log.9
mv $archive/$log.7 $archive/$log.8
mv $archive/$log.6 $archive/$log.7
mv $archive/$log.5 $archive/$log.6
mv $archive/$log.4 $archive/$log.5
mv $archive/$log.3 $archive/$log.4
mv $archive/$log.2 $archive/$log.3
mv $archive/$log.1 $archive/$log.2
mv $pad/$log.$ext $archive/$log.1
else
echo $pad/$log.$ext not found >>$mailpath/attachment.txt
fi
}


### some things are commented for debugging purposes
# console log, stop logging first
pad=/ETC
log=console
ext=log
# ls -l $pad/$log.$ext
# kopierendiehandel

# health.log
pad=/SYSTEM
log=HEALTH
ext=LOG
# ls -l $pad/$log.$ext
# kopierendiehandel

# syslog.err
pad=/SYSTEM
log=SYS\$LOG
ext=ERR
# ls -l $pad/$log.$ext
# kopierendiehandel

# bootlog.err
pad=/SYSTEM
log=BOOT\$LOG
ext=ERR
# ls -l $pad/$log.$ext
# kopierendiehandel

# ftp
### where is that logfile?

# gwia
### do i want this?

# apache
### do i want this ?

# ABEND.LOG
# you'll want to keep these
# if it excist, mail it and rename the tog to abend_date_time
if [ -e SYS:/SYSTEM/ABEND.LOG ]
then echo new abend
cp SYS:/SYSTEM/ABEND.LOG $mailpath/ABEND.log
abenddag=`ls -l SYS:/SYSTEM/ABEND.LOG|awk '{print $6}'`
echo $abenddag
tijd=`ls -l SYS:/SYSTEM/ABEND.LOG|awk '{print $7}'|tr : _`
# tijd met een underscore. een : mag niet in de naam voorkomen
mv /SYSTEM/ABEND.LOG $archive/ABEND_"$abenddag"_"$tijd".log

else
echo abend.log not found
fi

# abends overview
for a in `ls $archive/ABEND*`
do
cat $a|grep -e ^Server -e ^Abend >>$mailpath/overz_abend.log
done

# create mail attachment
for a in `ls $mailpath/*.log`
do
echo _____________________________ >>$mailpath/attachment.txt
echo $a >>$mailpath/attachment.txt
echo _____________________________ >>$mailpath/attachment.txt

cat $a>>$mailpath/attachment.txt
done

#call send.nlm and use the attachment file as message body
/SYSTEM/SEND.NLM $toaddr $mailsrvr -f$fromaddr -s$subj -y5
-m$mailpath/attachment.txt
## does not work!