Python for monitoring apache and restarting if down

 
Thread Tools Search this Thread
Top Forums UNIX for Beginners Questions & Answers Python for monitoring apache and restarting if down
# 1  
Old 03-01-2017
Python for monitoring apache and restarting if down

Are there any existing python module for service monitoring? For example apache service?

Last edited by ctrld; 03-01-2017 at 09:45 AM..
# 2  
Old 03-03-2017
Hello ctrld,
You could to use a simply command like this and why not to use crontab to perform this test periodically :
Code:
ps -aux |grep apache |grep -Ev 'grep' > /dev/null || service apache2 restart

Otherwise to monitor severals services with python modules you could to use a famous monitoring tool as Shinken. I hope I helped you ! Smilie
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Programming

Create a C source and compile inside Python 1.4.0 to 3.7.0 in Python for ALL? platforms...

Hi all... As you know I like making code backwards compatible for as many platforms as possible. This Python script was in fact dedicated for the AMIGA A1200 using Pythons 1.4.0, 1.5.2, 1.6.0, 2.0.1, and 2.4.6 as that is all we have for varying levels of upgrades from a HDD and 4MB FastRam... (1 Reply)
Discussion started by: wisecracker
1 Replies

2. SuSE

Restarting syslog-ng

Environment: SUSE 10.3 I made a configuration change in '/etc/syslog-ng/syslog-ng.conf' file in a server. An article found on web says "After the change '/etc/init.d/syslog-ng' should be restarted". But there is no 'syslog-ng' in /etc/init.d directory. What is syslog-ng or a... (4 Replies)
Discussion started by: JDBA
4 Replies

3. Shell Programming and Scripting

**python** unable to read the background color in python

I am working on requirement on spreadsheet in python scripting. I have a spreadsheet containing cell values and with background color. I am able to read the value value but unable to get the background color of that particular cell. Actually my requirement is to read the cell value along... (1 Reply)
Discussion started by: giridhar276
1 Replies

4. Shell Programming and Scripting

Need help in restarting process

Hi friends, I have one unix command which is used to check the network status manually. followig is the command check_Network this command give follwoing status Network 1 is ok Network 2 is ok network 3 is ok network 4 is ok . . . . Network 10 is... (8 Replies)
Discussion started by: Nakul_sh
8 Replies

5. UNIX for Dummies Questions & Answers

Restarting a process

Hi, How is it possible to restart only your process. I can get the process killed but I am not able to start it. For eg : i first did this ps -ef|grep _out --displays all the process with _out in the name then I killed kill -15 36044 -- process id. Now how can i start the same... (1 Reply)
Discussion started by: TH3M0Nk
1 Replies

6. Programming

Restarting the program

Hi, I use gfortran to run the code. Some times I need to stop the program and restart it. On restarting I need to run the program from the beginning. Is there any script or option available to restart the program from where it stopped? This script/option will be immensely useful for... (2 Replies)
Discussion started by: rpd25
2 Replies

7. Programming

Bandwidth monitoring using python

I wish to develop an application to monitor the network traffic of my system. I wish to know which computer networked to me is using most of the bandwidth. I know the basics of python but do not know how to start the work.. please suggest some good methods to follow. (7 Replies)
Discussion started by: coderhs
7 Replies

8. Solaris

server restarting

Hello people, My solaris server is rebooting, not sure how!!! Which log should I look in to? I checked /var/adm/messages and dmesg also. How do I check older dmesg logs? I checked lastlog and also ran the last command. Nothing useful pointing to why server rebooted. Also when server reboots I... (4 Replies)
Discussion started by: rcmrulzz
4 Replies

9. UNIX for Dummies Questions & Answers

Restarting the Spooler

:confused: Everytime our UNIXWARE 7 Server is restarted we also have to restart the spooler. If the spooler is not restarted, print jobs get stuck in the queu. Once restarted by using the following command lpstop and lpstart everything works fine. Does anyone have any ideas what could be causing... (0 Replies)
Discussion started by: Yorgy
0 Replies
Login or Register to Ask a Question