我有典型的情况。需要为CentOS7上的memcached配置monit。问题是,我在谷歌找到的所有信息都包含了这一行:
check process memcached with pidfile /var/run/memcached/memcached.pid但是,/var/run和/var/run/memcached文件夹中没有memcached.pid文件。我检查了/usr/lib/systemd/system/memcached.service
[Service]
Type=simple
EnvironmentFile=-/etc/sysconfig/memcached
ExecStart=/usr/bin/memcached -u $USER -p $PORT -m $CACHESIZE -c $MAXCONN $OPTIONS因此,没有通向.pid文件的路径。问题是,我可以在没有.pid文件的情况下检查memcached吗?第二个问题--这个.pid文件能在另一个位置吗?
发布于 2016-02-08 09:37:29
在monit配置中替换
check process memcached with pidfile /var/run/memcached/memcached.pid使用
check process memcached with match memcached我的memcached配置:
check process memcached with match memcached
start program = "/usr/bin/systemctl start memcached"
stop program = "/usr/bin/systemctl stop memcached"
if failed host 127.0.0.1 port 11211 protocol MEMCACHE then restart
if cpu > 70% for 2 cycles then alert
if cpu > 98% for 5 cycles then restart
if 2 restarts within 3 cycles then timeoutCentos 7,monit 5.14
https://stackoverflow.com/questions/35077485
复制相似问题