Håkan Franzén
(fableman) Freewares
You are free to use my programs as long as you like.
( feel free to visit my photopage at www.mediakonst.se )
Local TCP Port Opener
DWL-SignalStrength
3ware raid alert script
With this program you can
open TCP ports on your computer. #!/bin/sh email="xxx@yyy.zzz" #your email address here. hostname=`hostname` #get servername using hostname command. # Don't change anything after this line please. istdm2running=`ps x | grep 3dm2 | grep -c sbin` ls -n /var/log/tdm_aen_*.txt ls -n /tmp/3ware-checker-tmpfile lastfilesize=`cat /tmp/3ware-checker-tmpfile` else # End of script
Its a great tool if you want to test your personal
firewall rules or if you working with bigger hardware firewall rules to test
rules against DMZ,INSIDE,OUTSIDE.
Let say you have 30 servers in DMZ with lots of different IPs and different
services running that need lots of different ports.
You start to config up the rules but you cant test all rules and make sure you
made everything correct cos then you need the live servers for that.
But if you put this tool on a computer and give it the same IP and OPEN Ports,
then you can test everything before you go live and make sure your configuration
are correct.
Tested on WinXP / Vista 32 bit.
If your under Vista and using NMAP, then use nmap -sV x.x.x.x ( Vista dont noticed nmap scans all times)
Version: 1.1 (2007-10-10):Fixed soo local IP address to show correct under Vista
Added support for application upgrade, it will check for new version on start up.
Version 1.0 (2007-09-03) First release.
DOWNLOAD Local TCP Port Opener.

DWL-SignalStrength is a linux script that you can use to get Rx or Ack Signal Strength from D-link Wireless Units DWL-3200 or DWL-2100
USAGE: DWL-SignalStrength x.x.x.x Rx/Ack password MAC
(ex. ./DWL-SignalStrength 10.123.123.2 Rx password or ./DWL-SignalStrength 10.123.123.2 Ack password 00:13:86:22:a2:1c)
x.x.x.x = IP-address or Host name
Rx = RxSignalStrength Ack = AckSignalStrength
password = admin password for telnet login
MAC = Mac address. Only needed if you have more then one Radio device configured. (ex. 00:13:86:22:a2:1c)
Version: 1.0 (2007-12-06)
DWL-SignalStrength.tgz download.
Includes: DWL-grep DWL-SignalStrength
unpack: tar -zxvf DWL-SignalStrength.tgz
configure: vim DWL-SignalStrength
edit the line: dwlgrep="/etc/zabbix/externalscripts" #The script dwl-grep must be at that location you put in there.
3ware raid alert script / 3ware-alerter
3ware built great hardware raid cards (not software based raids) that is supported by linux, centos / redhat, windows..
When you use the raid controller you install 3DM2 CLI tool soo you can update raid, get email alerts and more.
But the function to send out email alerts works only when pressing test button, but when its a real error it dose not work!!!
Soo I made this small bash script for linux to send out alerts and raid messages to your email.
Here is the script:
#
# To have use of this script then. Buy a 3ware raid controller and install 3dm2 CLI utility for Linux from www.3ware.com homepage.
# Script tested under: centos 5.1 / RE5.1
#
#
# This script will check the log file from 3DM2 Raid CLI utility
# and mail the log file changes to $email
#
# Q: Why use it ? 3dm2 have built in email alerter?!
# A: Yes, But only the Test to send email alerts works as it should, but when it's a real raid problem, nothing happends.
# Soo then I created this script to make sure I get information when my 3ware raid cards needs my attention.
#
# Install instruction.
# Make a file including this script under /root name it /root/3ware-alerter
# chmod u+x /root/3ware-alerter
# crontab -e then insert this line: */5 * * * * /root/3ware-alerter >/dev/null 2>&1
# Now this script will run every 5 mins to check if something happend with your 3ware raid controller
# and will then send an email to email="xxxx@yyyy.zzz"
# Feel free to use and modify my script for your needs.
#
# Made By: Håkan Franzen email: Hakan(d0t)Franzen((a))oxelosund(d0t)se
#
#--------------------------------------------------------------------------------------------
# Settings
#hostname="my 3ware server" #or uncomment this to set server name yourself
#--------------------------------------------------------------------------------------------
if [ $istdm2running -eq 0 ]
then
echo "TDM2 not running!!!!"
printf "%s\n" "ALERT: 3DM2 is not running on server: $hostname" "." | mail -s "ALERT: 3DM2 is not running on server: $hostname" $email
exit 3
fi
if [ $? -eq 2 ]
then
filesize=0
echo 0 >/tmp/3ware-checker-tmpfile
echo "No log file = no errors"
exit 0
else
filesize=`ls -n /var/log/tdm_aen_*.txt | awk '{ print $5 }'`
fi
if [ $? -eq 2 ]
then
echo 0 >/tmp/3ware-checker-tmpfile
fi
filesize=`ls -n /var/log/tdm_aen_*.txt | awk '{ print $5 }'`
if [ $filesize -eq $lastfilesize ]
then
echo "No new alerts."
exit 0
echo "New alerts!!! Sending mail to $email "
echo $filesize >/tmp/3ware-checker-tmpfile
getfile=`ls -n /var/log/tdm_aen_*.txt | awk '{ print $9 }'`
mail -s "ALERT: NEW RAID INFO AT: $hostname" $email < $getfile
fi