Hi,
i've build a script, 1: neon_script and the other 2:neon_mailing those to scripts i run with 3:neon_handmatig
After that i get a mail in plain text in my mail box and i want it in html format. I already tried already a several things but nothings seems to work.
Somebody got i idea how i got to fix this?
bash-2.03$ more neon_script
PHP Code:
:
#! /bin/csh
# Neon - nmslog check
# v0.1 : Richare_NEON: trail version
VERSIE="v0.1"
D1R=/home/richare/neon_instandhouding/neon_script_output
TMPD1R=/home/richare/neon_instandhouding/neon_script_tmp
TIJD=`date '+'%d' '%B' '%y' '%T''`
TIJD2=`date "+%Y-%m-%d_%H:%M"`
ZGR3P=/opt/CCOgnu/bin/zgrep
echo building report ...... please wait, this will take some minutes.....
echo +-----"$TIJD"----"$versie"---------------------------+ > "$D1R"/"$TIJD2".log
echo +----Stack meldingen ----------------------- vandaag : `grep STACK /var/log/mon/nmslog | wc -l` >> "$D1R"/"$TIJD2".log
echo +----------------------------------------------------------+ >> "$D1R"/"$TIJD2".log
grep %STACKMGR-4-STACK_LINK_CHANGE /var/log/mon/nmslog | cut -d ':' -f1,2,3,8,9 >> "$D1R"/"$TIJD2".log
echo +----------------------------------------------------------+ >> "$D1R"/"$TIJD2".log
echo +----Stack meldingen vorige dag -------- gisteren: `zgrep %STACKMGR-4-STACK_LINK_CHANGE /var/log/mon/nmslog.1.gz | wc -l` >> "$D1R"/"$TIJD2".log
echo +----------------------------------------------------------+ >> "$D1R"/"$TIJD2".log
zgrep %STACKMGR-4-STACK_LINK_CHANGE /var/log/mon/nmslog.1.gz | cut -d ':' -f1,2,3,8,9 >> "$D1R"/"$TIJD2".log
echo +----------------------------------------------------------+ >> "$D1R"/"$TIJD2".log
echo +----------------Port Securty meldingen--------------------+ >> "$D1R"/"$TIJD2".log
echo +----------------------------------------------------------+ >> "$D1R"/"$TIJD2".log
echo +-------Aantal Port Security Meldingen vandaag: `grep %PORT_SECURITY-2-PSECURE /var/log/mon/nmslog|wc -l`------+>> "$D1R"/"$TIJD2".log
echo +----------------------------------------------------------+ >> "$D1R"/"$TIJD2".log
perl /home/richare/neon_instandhouding/count_port_security_today |sort +2 -3 -nr|head -5 >> "$D1R"/"$TIJD2".log
echo +----------------------------------------------------------+ >> "$D1R"/"$TIJD2".log
echo +-------Aantal Port Security Meldingen gisteren: `zgrep %PORT_SECURITY-2-PSECURE /var/log/mon/nmslog.1.gz|wc -l`------+>> "$D1R"/"$TIJD2".log
echo +----------------------------------------------------------+ >> "$D1R"/"$TIJD2".log
perl /home/richare/neon_instandhouding/count_port_security_yesterday |sort +2 -3 -nr |head -5 >> "$D1R"/"$TIJD2".log
echo +----------------------------------------------------------+ >> "$D1R"/"$TIJD2".log
echo +-------Aantal Port Security Meldingen eergisteren: `zgrep %PORT_SECURITY-2-PSECURE /var/log/mon/nmslog.2.gz|wc -l`---+>> "$D1R"/"$TIJD2".log
echo +----------------------------------------------------------+ >> "$D1R"/"$TIJD2".log
perl /home/richare/neon_instandhouding/count_port_security_daybeforeyesterday |sort +2 -3 -nr |head -5 >> "$D1R"/"$TIJD2".log
echo +----------------------------------------------------------+ >> "$D1R"/"$TIJD2".log
bash-2.03$ more neon_mailing
PHP Code:
#! /bin/csh
# Neon Mailing
# v0.1 : Richare : trail version
set namen=richare
set bestand=`ls -latr /home/richare/neon_instandhouding/neon_script_output/*.log | cut -d ':' -f2,3 | cut -d ' ' -f2 | tail -1`
perl -i -pe 's/\.sus\.beheer\.kpn\.net//' $bestand
#perl -i -pe 's/\n/\r\n/' $bestand
/usr/bin/cat "$bestand" | /usr/bin/mailx -s "Neon Nmslog Analyzer" "$namen"
bash-2.03$ more neon_handmatig
PHP Code:
# daily run & mailing(on weekdays only) of neon-parser #
/home/richare/neon_instandhouding/neon_script ##>/dev/null 2>&1
/home/richare/neon_instandhouding/neon_mailing