If the monit status, and the other CLI tools are not enough for you, then Monit comes with a simple user interface. You can check the monit overall status with: $ monit status info : 'redis-server' start: /etc/init.d/redis I stopped my Redis server from another SSH instance, and tailed the monit-log: $ tail -f /var/log/monitĬEST Jul 31 14:07:09] error : 'redis-server' process is not running You can eventually test the syntax of the monit configuration first: $ monit -t This is done with the following line: $ monit reload When your Monit changes are done, you need to reload Monit. This is the most simple form of checks you can create in Monit - there is a lot of options, and you can - just to notice - also use it for other monitoring than services and processes. Start program = "/etc/init.d/nginx start" Start program = "/etc/init.d/mysql start"Ĭheck process nginx with pidfile /var/run/nginx/nginx.pid Start program = "/etc/init.d/redis start"Ĭheck process redis-server with pidfile /var/run/mysql/mysql.pid I opened the monit-configuration file (nf), and added the following ( $ vi /etc/nf), which will create checks for both Redis, MySQL and NGINX: # Check RedisĬheck process redis-server with pidfile /var/run/redis/redis.pid The Redis server had a few accidents, with too much memory load, where it unfortunately went down. I had setup an ElasticSearch/Logstash/Kibana central server for at customer, with Redis as a buffer, receiving data from the Logstash-agents. It is a ~500Kb program for UNIX/Linux, which checks up on defined services and processes every 2 minute. I discovered this program some time ago, with the question: "How to monitor a process, and keep it alive always, in the best possible way?". Monit is a simple and lightweight, and really useful tool. Menu Monitor and keep services + proccesses alive with monit - lightweight, and great.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |