Author Topic: svcMonitor  (Read 7990 times)

0 Members and 1 Guest are viewing this topic.

Offline
*
svcMonitor
« on: April 22, 2016, 07:03:44 PM »

svcMonitor is not restarting services ...


[root@web:~]# service postfix status
master (pid  22024) is running...

[root@web:~]# service postfix stop
Shutting down postfix:                                     [  OK  ]

[root@web:~]# /usr/local/bin/svcMonitor

[root@web:~]# service postfix status
master is stopped


[root@web:~]# cat /usr/local/bin/svcMonitor
#!/bin/bash
export PATH=/sbin:/usr/sbin:/bin:/usr/bin:/usr/local/sbin:/usr/local/bin
for i in `cat /usr/local/etc/services-monitor`
do
service $i status 1> /dev/null
  if [ $? -eq 1 ]
  then
    echo Restarted service $i on `hostname` at `date`
    service $i restart
  fi
done

[root@web:~]# cat /usr/local/etc/services-monitor
crond
httpd
mysqld
postfix
pure-ftpd
sshd

Offline
*
Re: svcMonitor
« Reply #1 on: April 22, 2016, 07:49:53 PM »
ah:

0 program is running or service is OK
1 program is dead and /var/run pid file exists
2 program is dead and /var/lock lock file exists
3 program is not running
4 program or service status is unknown

svcMonitor is checking only - 1 program is dead and /var/run pid file exists

Offline
*
Re: svcMonitor
« Reply #2 on: May 02, 2016, 09:00:45 PM »
version 0.9.8.15 will have this fixed.
AntiDDoS Protection (web + mail)
http://centos-webpanel.com/website-ddos-protection-proxy

Join our Development Team and get paid !
http://centos-webpanel.com/develope-modules-for-cwp


Services Monitoring & RBL Monitoring
http://centos-webpanel.com/services-monitor


Do you need Fast and FREE Support included for your CWP linux server?
http://centos-webpanel.com/noc-partner-list
Installation Instructions
http://centos-webpanel.com/installation-instructions
Get Fast Support Here
http://centos-webpanel.com/support-services