Skip to content
Snippets Groups Projects
Commit f908bb6d authored by Jupiter Hu's avatar Jupiter Hu
Browse files

fixed script

parent e82f97d1
No related branches found
No related tags found
1 merge request!20fixed script
......@@ -11,6 +11,8 @@ STATE_WARNING=1
dist = platform.dist()
if dist[0] == "debian":
command = "/usr/sbin/service apache2 status"
elif dist[0] == "centos":
command = "/sbin/service httpd status"
else:
command = "service apache2 status"
......
......@@ -3,11 +3,20 @@ import sys, os, pwd
import getopt
import commands
import subprocess
import platform
STATE_OK=0
STATE_WARNING=1
check_ldap=subprocess.Popen("service slapd status", shell=True, stdout=subprocess.PIPE)
dist = platform.dist()
if dist[0] == "debian":
command = "/usr/sbin/service slapd status"
elif dist[0] == "centos":
command = "/sbin/service slapd status"
else:
command = "service slapd status"
check_ldap=subprocess.Popen(command, shell=True, stdout=subprocess.PIPE)
ldap_status=check_ldap.communicate()[0]
if "run" in ldap_status:
......
......@@ -3,11 +3,20 @@ import sys, os, pwd
import getopt
import commands
import subprocess
import platform
STATE_OK=0
STATE_WARNING=1
check_mysql=subprocess.Popen("service mysqld status", shell=True, stdout=subprocess.PIPE)
dist = platform.dist()
if dist[0] == "debian":
command = "/usr/sbin/service mysql status"
elif dist[0] == "centos":
command = "/sbin/service mysqld status"
else:
command = "service mysql status"
check_mysql=subprocess.Popen(command, shell=True, stdout=subprocess.PIPE)
mysql_status=check_mysql.communicate()[0]
if "run" in mysql_status:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment