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

Tomcat status monitoring script

2025-04-05 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/02 Report--

Tar zxvf heirloom-mailx_12.5.orig.tar.gz

Cd heirloom-mailx-12.5/

Make & & make install UCBINSTALL=/usr/bin/install

Cp / etc/nail.rc / etc/nail.rc.bak

Vim / etc/nail.rc

Set from=xxx@126.com sends mailbox

Set smtp=smtp.126.com send email smtp address

Set smtp-auth-user=xxx@126.com receive mailbox

Set smtp-auth-password=xxx mailbox password

Set smtp-auth=login

Echo 123 | mailx-v-s "zabbix test mail" xxx@126.com

Com

-bash: echp: command not found

Resolving host smtp.126.com. . . Done.

Connecting to 220.181.15.111:25. . . Connected.

220 126.com Anti-spam GT for Coremail System (126com [20140526])

> EHLO vm172-18-0-18.ksc.com

250-mail

250-PIPELINING

250-AUTH LOGIN PLAIN

250-AUTH=LOGIN PLAIN

250-coremail 1Uxr2xKj7kG0xkI17xGrU7I0s8FY2U3Uj8Cz28x1UUUUU7Ic2I0Y2UFhQBZHUCa0xDrUUUUj

250-STARTTLS

250 8BITMIME

> AUTH LOGIN

334 dXNlcm5hbWU6

> d3loMTk4NzI1QDEyNi5jb20 =

334 UGFzc3dvcmQ6

> V1lIMTk4NzI1IUAj

235 Authentication successful

> MAIL FROM:

250 Mail OK

> RCPT TO:

250 Mail OK

> DATA

354 End data with.

>.

250 Mail OK queued as smtp1,C8mowABnDOoAivZZ4IC0AQ--.8734S2 1509329409

> QUIT

221 Bye

Touch / root/health_crm.sh

Touch / tmp/health_crm/health_crm.log

Vim / root/health_crm.sh

#! / bin/bash

Set iTunes 10

While true

Do

Let "i=i+10"

Response= `curl-- silent http://xx.com/-I | egrep "HTTP/1.1" | awk-F'{print $2}'`

Code= `curl-- silent http://xxx.com/ > > / tmp/health_tomcat/health_ crm.log`

If [$response! = 200]

Then

Echo "$response" | mail-s "your website is not ok now!" Xx@xx.com

Else

Curl-- silent http://xx.com/ > > / tmp/health_crm/health_crm.log

Sleep 300

Fi

Done

# done

Crontab-e

5 * root/ bin/sh / root/health_crm.sh

Service crond restart & & service ntpd restart

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