当前位置:首页 > Linux

linux Tomcat/mysql监视器

canca9年前 (2017-09-29)Linux734

#! /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下安装和使用MySQL

一、引言 想使用Linux已经很长时间了,由于没有硬性任务一直也没有系统学习,近日由于工作需要必须使用Linux下的 MySQL。本以为有Windows下使用SQL Server的经验,觉得在Linux下安装MySql应该是易如反掌的事,可在真正安装和使用…

linux删除乱码文件

一些乱码文件不可以通过普通的rm命令进行管理。可以通过删除i节点的方式删除。[root@192_168_100_35 musicwap]# ls??,?K?k??a*.?J]?k?Φ??P???Z?b?A?R???X??u??.?????*H@B?T???xS*查看乱码文件的i结点[root@192…

centos 7 crontab定时器及开机自启

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

centos7 手动修改dns

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

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

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

Debian更新系统时间

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

发表评论

访客

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