ITPub博客

首页 > Linux操作系统 > Linux操作系统 > net send message alert

net send message alert

原创 Linux操作系统 作者:golden_zhou 时间:2011-05-25 17:58:24 0 删除 编辑

开户防火墙port 137/138/139

1. net script. configure

#vi /usr/local/bin/net

#!/bin/sh

case "$1" in
send)
echo "$3"|smbclient -I "$2" -M `nmblookup -A "$2"|sed -e '1d'  -e '3,/*/d'|cut -f2|cut -d' ' -f1`
;;
*)
echo "Usage:net send "
exit 1
esac

#chmod +x /usr/local/bin/net


#service smb start


rpm -Uvh samba-3.0.33-3.7.el5.x86_64.rpm
rpm -Uvh samba-client-3.0.33-3.7.el5.x86_64.rpm
rpm -Uvh samba-common-3.0.33-3.7.el5.x86_64.rpm
rpm -Uvh samba-swat-3.0.33-3.7.el5.x86_64.rpm


nmblookup -A "10.109.133.25"
nmblookup -A "10.109.133.25"
service smb status
netbios-ns 137/tcp
netbios-ns 137/upd
netbios name service;
netbios name service
netbios session service
service netbios status
netstat -l
netstat -al


2. cat /u01/run/logicalStby_alert.sql

#!/bin/sh

ORACLE_HOME=/u01/product/oracle; export ORACLE_HOME
ORACLE_SID=delll10; export ORACLE_SID
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/usr/lib

output=`/u01/product/oracle/bin/sqlplus  /nolog <#su oracle -c "/u01/product/oracle/bin/sqlplus /nolog <        conn / as sysdba
        spool /u01/run/checkinfo.txt
        select count(*) from v\\$logstdby_process;
        spool off;
        exit
        EOF`


#echo "$output" >> /u01/run/log/checklog.log

value=`cat /u01/run/checkinfo.txt | sed -n '5,2p'`
#echo ${value:0:9}
#tmp=${value:0:9}

#source /home/oracle/.bash_profile

if [ "$value" -eq "0" ] ; then
/usr/local/bin/net send xxx.xxx.32.120  "WSJ Logical Standby Apply Processes have died"
/usr/local/bin/net send xxx.xxx.32.88  "WSJ Logical Standby Apply Processes have died"
/usr/local/bin/net send xxx.xxx.32.71  "WSJ Logical Standby Apply Processes have died"
/usr/local/bin/net send xxx.xxx.32.127  "WSJ Logical Standby Apply Processes have died"
/usr/local/bin/net send xxx.xxx.32.110  "WSJ Logical Standby Apply Processes have died"
/usr/local/bin/net send xxx.xxx.32.119  "WSJ Logical Standby Apply Processes have died"
/usr/local/bin/net send xxx.xxx.32.151  "WSJ Logical Standby Apply Processes have died"
/usr/local/bin/net send xxx.xxx.32.100  "WSJ Logical Standby Apply Processes have died"
/usr/local/bin/net send xxx.xxx.32.97  "WSJ Logical Standby Apply Processes have died"
/usr/local/bin/net send 10.109.133.25  "WSJ Logical Standby Apply Processes have died"
/usr/local/bin/net send xxx.xxx.10.95  "WSJ Logical Standby Apply Processes have died"
# /usr/local/bin/net send 192.168.0.2 "WSJ Logical Standby Apply Processes have died"
#elif [ "$value" -ne "0" ] ; then
#/usr/local/bin/net send 10.109.133.25  "WSJ Logical Standby Apply Processes are normal"
#/usr/local/bin/net send xxx.xxx.32.120  "WSJ Logical Standby Apply Processes are normal"
#/usr/local/bin/net send xxx.xxx.32.127  "WSJ Logical Standby Apply Processes have died"

elif [ "${value:0:9}" = "ORA-01034" ] ; then
/usr/local/bin/net send xxx.xxx.32.120 "WSJ Logical Standby has stopped"
/usr/local/bin/net send xxx.xxx.32.88 "WSJ Logical Standby has stopped"
/usr/local/bin/net send xxx.xxx.32.71 "WSJ Logical Standby has stopped"
/usr/local/bin/net send xxx.xxx.32.127 "WSJ Logical Standby has stopped"
/usr/local/bin/net send xxx.xxx.32.110 "WSJ Logical Standby has stopped"
/usr/local/bin/net send xxx.xxx.32.119 "WSJ Logical Standby has stopped"
/usr/local/bin/net send xxx.xxx.32.151 "WSJ Logical Standby has stopped"
/usr/local/bin/net send xxx.xxx.32.100 "WSJ Logical Standby has stopped"
/usr/local/bin/net send xxx.xxx.32.97 "WSJ Logical Standby has stopped"
/usr/local/bin/net send 10.109.133.25 "WSJ Logical Standby has stopped"
/usr/local/bin/net send xxx.xxx.10.95  "WSJ Logical Standby has stopped"
fi


3. 定制任务(crontab -u oracle -e)

*/2 * * * * sh /u01/run/logicalStby_alert.sql 1>/u01/run/log/logicalStby_alert.log 2>/u01/run/log/logicalStby_alert.bad


4. 开户客户端 message 服务

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/25198367/viewspace-696264/,如需转载,请注明出处,否则将追究法律责任。

下一篇: 日誌輪詢設置
请登录后发表评论 登录
全部评论

注册时间:2011-03-09

  • 博文量
    238
  • 访问量
    308331