Skip to content

Commit

Permalink
Update install-agent.py
Browse files Browse the repository at this point in the history
Added inject for debian os
  • Loading branch information
deepamartin authored Dec 21, 2018
1 parent 3247d61 commit e14c48e
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions install-agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,7 @@ def create_collectd_service(self):
create a service for collectd installed
:return:
"""
if self.os == "ubuntu":
if self.os == "ubuntu" or self.os == "debian":
print "found ubuntu ..."
version = platform.dist()[1]
print "ubuntu version: {0}".format(version)
Expand Down Expand Up @@ -428,7 +428,7 @@ def create_collectd_service(self):
self._run_cmd("kill $(ps aux | grep -v grep | grep 'collectd' | awk '{print $2}')", shell=True, ignore_err=True)
print "start collectd ..."
# self._run_cmd("systemctl daemon-reload", shell=True, ignore_err=True)
if self.os in ["ubuntu", "centos", "redhat"]:
if self.os in ["ubuntu","debian", "centos", "redhat"]:
self._run_cmd("service collectd start", shell=True, print_output=True)
self._run_cmd("service collectd status", shell=True, print_output=True)
else:
Expand Down Expand Up @@ -647,7 +647,7 @@ def create_configurator_service(self):
"""
print "create_configurator_Service started"
print "OS is: {0}".format(self.os)
if self.os == "ubuntu":
if self.os == "ubuntu" or self.os == "debian":
print "found ubuntu ..."
version = platform.dist()[1]
print "ubuntu version: {0}".format(version)
Expand Down Expand Up @@ -712,7 +712,7 @@ def configure_iptables(self):
"""
add_rule = "iptables -I INPUT 1 -p tcp -m tcp --dport {0} -j ACCEPT".format(self.port)
save_rule = "iptables-save"
if self.os == "ubuntu":
if self.os == "ubuntu" or self.os == "debian":
restart_iptables = "service ufw restart"
elif self.os in ["centos", "redhat"]:
save_rule = "iptables-save | sudo tee /etc/sysconfig/iptables"
Expand Down

0 comments on commit e14c48e

Please sign in to comment.