Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to alarm shell according to whether the file time is updated or not?

2025-01-30 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)05/31 Report--

Editor to share with you how shell reports to the police according to whether the file time is updated or not. I hope you will get something after reading this article. Let's discuss it together.

! / bin/sh

Export PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin

Export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/data/oracle/product/ora10/lib

Export TNS_ADMIN=/data/oracle/product/ora10/network/admin

Export ORACLE_HOME=/data/oracle/product/ora10

Export ORACLE_SID=dbmisc

LOG= "/ data/oracle/product/ora10/network/log/listener.log"

DIR= "/ home/shell/hostmonitor/logs"

MAILLIST= "pso@datou.com"

LOGDATE= `date +% s-r $LOG`

CURDATE= `date +% s`

COUNT= `expr $CURDATE-$LOGDATE`

If [$COUNT-ge 300]; then

Cat $DIR/listener.txt

# ps-ef | grep oracle | grep LISTENER

# lsnrctl start

EOF

Mailx-s "# 192.168.1.208 dbmisc listener alert #" $MAILLIST < $DIR/listener.txt

$ORACLE_HOME/bin/sqlplus / nolog

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report