Member-only story
100 Days of DevOps — Day 65-Bash Script to Monitor Service
3 min readApr 16, 2019
To view the updated DevOps course(101DaysofDevOps)
Course Registration link: https://www.101daysofdevops.com/register/
Course Link: https://www.101daysofdevops.com/courses/101-days-of-devops/
YouTube link: https://www.youtube.com/user/laprashant/videos
Welcome to Day 65 of 100 Days of DevOps, Focus for today is Bash Script to Monitor Service
Step1: How to check if the service is running?
- There are a number of ways we can check it
- First approach netstat
# netstat -antulp|grep httpdtcp6 0 0 :::80 :::* LISTEN 19122/httpd
- The second approach is ps command
# ps aux|grep -v grep |grep -i httpdroot 19122 0.0 0.5 228280 5116 ? Ss Mar22 0:13 /usr/sbin/httpd -DFOREGROUNDapache 19123 0.0 0.3 228416 3740 ? S Mar22 0:00 /usr/sbin/httpd -DFOREGROUNDapache 19124 0.0 0.3 228416 3740 ? S Mar22 0:00 /usr/sbin/httpd -DFOREGROUND