An open API service indexing awesome lists of open source software.

https://github.com/tylpk1216/linux-service-monitor

The script will monitor your services, and will start it if it is not running.
https://github.com/tylpk1216/linux-service-monitor

linux monitoring script

Last synced: about 1 month ago
JSON representation

The script will monitor your services, and will start it if it is not running.

Awesome Lists containing this project

README

        

# linux-service-monitor
The script will monitor your services, and will start the service if it is not running.

You can add your service process in processes array and service name in services array.

You can also modify sleepSecs to decide your check interval.

If you want to do more things, you can also modify this script to send email or do something.

I hope this script is useful to you.

### User controllable variables
```
# your service process name to monitor
processes=('php-fpm' 'mysql' 'nginx')

# your service name to start
services=('php7.0-fpm' 'mysql' 'nginx')

# monitor interval
sleepSecs=10
```

### Do more things not only log
You can do anything you want to do here.
```
addLog()
{
date=`date +%Y-%m-%d\ %H:%M:%S`
msg="[$date] $service not exists"
echo $msg
echo $msg >> agent.log
}
```