当前位置:首页 > Linux

linux Tomcat/mysql监视器

canca8年前 (2017-09-29)Linux511

#! /bin/sh

##### tomcat monitor #####

ui=$(ps x |grep catalina |grep tomcat |grep -v grep|awk '{print $1}')

if [ "$ui" == "" ] ;
then

echo "[$(date +'%F %H:%M:%S')] TomcatMonitor starting tomcat.">>/tomcat-monitor.log

#startup tomcat
/mnt/sdb1/software/apache-tomcat-8.0.11/bin/startup.sh

fi

##### mysql monitor #####

ui=$(ps x |grep mysql |grep -v grep|awk '{print $1}')

if [ "$ui" == "" ] ;
then

echo "[$(date +'%F %H:%M:%S')] MysqlMonitor starting MySQL.">>/mysql-monitor.log

#startup mysql
/etc/init.d/mysql start

fi


扫描二维码推送至手机访问。

版权声明:本文由Ant.Master's Blog发布,如需转载请注明出处。

本文链接:https://iant.work/post/12.html

标签: Linux
分享给朋友:

“linux Tomcat/mysql监视器” 的相关文章

在linux下,完全杀死tomcat等进程脚本

在linux下,完全杀死tomcat等进程脚本

在linux下,安装tomcat后发现执行shutdown.sh不好使,以前在执行weblogic脚本stopWeblogic也出现过此现象,原因可能是命令端口更改之类等各种原因的导致其失效,与其排查错误,不如干脆自己写个一劳永逸的脚本,直接kill掉其进程好了...…

centos 7 crontab定时器及开机自启

crontab 建议直接采用centos7 自带得cronteb包,定时器:就是定时去执行干某一件事在这里我以脚本为媒介1 当然是创建一个脚本,创建目录随意但是你一定要记得。。直接通过vi来创建一个test.sh脚本!…

centos7 手动修改dns

方法一:vim /etc/resolv.conf…

linux 系统tar文件压缩打包命令

打包成tar.gz格式压缩包…

armbian修改为中文环境,解决中文乱码

step1:输入 dpkg-reconfigure locales…

Debian更新系统时间

Debian更新时间A 更新源,并安装ntpdate:0.date 查看当前的系统时间1.sudo apt-get update 更新源2.sudo apt-get install ntpdate 安装ntpdate3.sudo ntpdate ntp1.aliyun.…

发表评论

访客

◎欢迎参与讨论,请在这里发表您的看法和观点。