sierracircle / services-checker Goto Github PK
View Code? Open in Web Editor NEWBash Script to check if services are running and restart if not. Sends email to you.
License: MIT License
Bash Script to check if services are running and restart if not. Sends email to you.
License: MIT License
Please help the one that is available is for ubuntu 14.04 and 16.04 only. Is there a services-checker for ubuntu 18.04.1?
I'm naive to bash script so please bear me and help me out here.
I added this service file at: /root/donotdelete
Then I added that path to the service file as well
Added my email address
In Services removed apache and mysql.
Then added 'nginx'
also added the code in crontab
Then I stopped my nginx service by this command "service nginx stop"
waited for 2 minutes, but it didn't restart.
Thank you
Hey, thanks for the script!
Just a question: what's the purpose of the temp file that is created when a service could not be restarted?
I am new to Linux and just wondering if I can rename "services" to "services.sh"?
Or what is the reason to have no file ending for the script.
Thank you.
Asking for a friend ๐
I don't know if this repo is still alive, but what would be awesome (if it's not already the case?) would be that there's a log file of the reboots (or unsuccessful restarts). Right now, since my server doesn't send out emails (another of my own problems lol) i would like to have a way to verify if the script actually works, AND how often do my services crash.
Thanks!
the script did restart the service, however, it did not send any email notification
I am rather new to the "server world" and am actually using serverpilot.io (that installs all the necessary components for web, mainly LAMP).
I am also running a droplet using digitalocean. You recommended your script there.
Now I would like to install the script but do not know how. You start with 1. put into your scripts folder
, could you just give an example of the how-to? And is this a special folder or can you define it yourself? Can I just upload it via FTP? Is the file services
a SH file?
PS: I already found out how to do the cronjob setup via serverpilot.
Looking at the closed issues, and one which was that the email wasn't sent, i configured my droplet for mail to be sent via sendmail (as you suggested to someone to install sendmail). Did some tests and server email works. However, not when the service crashes. Now, i am really FAR from knowing anything about this, but i noticed in your code, you use echo $MESSAGE | mail -s "$SUBJECT" "$EMAIL"
but shouldn't it be sendmail
instead of mail
?
Showing:
restart-services: 15: restart-services: Syntax error: "(" unexpected
Ubuntu 18.04 on DigitalOcean
I tried to use this script, take a look at how i configured it like below in "crontab -e"
*/1 * * * * sh /var/www/html/jobs/services.sh
I changed the email and stopped my apache2. I didn't get any email.
Can u pls help me in resolving this.
Thank you.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.