Skip to content

gm06120219/service_monitor

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

README

These python scripts are used to monitor the Ubuntu Server Service.

How it works:
1.get the result of ubuntu command: ps aux
2.filtering the keyword of the service like: "apache"
3.if it's still have data after filtering, the service was alive, else send e-mail with the log file to your e-mail address.

How to use it:
$sudo vi /etc/init/smonitor.conf
start on started networking
exec sh -c "python /your_unzip_directory/monitor.py > /var/log/smonitor/log.log 2>&1"
$mkdir /var/log/smonitor
$sudo service smonitor start


Config file
-----------------------------------
[monitor]
# service item of monitor
add service information format like "service_name = service_log_file_path"
PS: Please don't send too large log file.

For example:
"nginx = /var/log/nginx/access.log"

[disk]
# file system
add file system item for monitor its capacity

[loop]
# sleep time for check loop


About

Monitoring Ubuntu server service program

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages