Exemplo n.º 1
0
def installGangliaClient():
    if ((not fabfile.myenv.append) or env.host in fabfile.myenv.new_hosts):
        fabfile.__rootUser()
        sudo('apt-get install -y ganglia-monitor')
        put(os.path.join(os.path.split(env.real_fabfile)[0], 'files/gmond.conf'),
            os.path.join('/home', env.user, 'fabric-gmond.conf'))
        sudo('cat '+os.path.join('/home', env.user, 'fabric-gmond.conf') +' > /etc/ganglia/gmond.conf')
        sudo('service ganglia-monitor restart')
Exemplo n.º 2
0
def runCouch(status='start', multi='n'):
    if (len(env.hsots) > 1 and multi != 'y'):
        print "if you are sure that you want to install couchdb server on multi servers, please use `fab installCouch:y`"
        return
    else:
        if ((not fabfile.myenv.append) or env.host in fabfile.myenv.new_hosts):
            fabfile.__rootUser()
            sudo('couchdb ' + status)
Exemplo n.º 3
0
def runCouch(status='start',multi='n'):
    if (len(env.hsots) > 1 and multi != 'y'):
        print "if you are sure that you want to install couchdb server on multi servers, please use `fab installCouch:y`"
        return
    else:
        if ((not fabfile.myenv.append) or env.host in fabfile.myenv.new_hosts):
            fabfile.__rootUser()
            sudo('couchdb '+status)
Exemplo n.º 4
0
def installGangliaClient():
    if ((not fabfile.myenv.append) or env.host in fabfile.myenv.new_hosts):
        fabfile.__rootUser()
        sudo('apt-get install -y ganglia-monitor')
        put(
            os.path.join(
                os.path.split(env.real_fabfile)[0], 'files/gmond.conf'),
            os.path.join('/home', env.user, 'fabric-gmond.conf'))
        sudo('cat ' + os.path.join('/home', env.user, 'fabric-gmond.conf') +
             ' > /etc/ganglia/gmond.conf')
        sudo('service ganglia-monitor restart')
Exemplo n.º 5
0
def installCollectd():
    if ((not fabfile.myenv.append) or env.host in fabfile.myenv.new_hosts):
        fabfile.__rootUser()
        sudo('apt-get install collectd -y')
        sudo("sed -i 's/#LoadPlugin network/LoadPlugin network/g' /etc/collectd/collectd.conf")
        configuration='<Plugin "network">\n\tServer "'+fabfile.cf.get('collectd','server_ip')+'" "'+fabfile.cf.get('collectd','server_port')+'"'+'\n</ Plugin >'
        sudo("echo '"+configuration+"' >>/etc/collectd/collectd.conf ")
        configuration=fabfile.cf.get('collectd','interval')
        sudo("sed -i 's/#Interval 10/Interval "+configuration+"/g' /etc/collectd/collectd.conf")
        sudo("/etc/init.d/collectd stop")
        sudo("/etc/init.d/collectd start")
Exemplo n.º 6
0
def installCollectd():
    if ((not fabfile.myenv.append) or env.host in fabfile.myenv.new_hosts):
        fabfile.__rootUser()
        sudo('apt-get install collectd -y')
        sudo(
            "sed -i 's/#LoadPlugin network/LoadPlugin network/g' /etc/collectd/collectd.conf"
        )
        configuration = '<Plugin "network">\n\tServer "' + fabfile.cf.get(
            'collectd', 'server_ip') + '" "' + fabfile.cf.get(
                'collectd', 'server_port') + '"' + '\n</ Plugin >'
        sudo("echo '" + configuration + "' >>/etc/collectd/collectd.conf ")
        configuration = fabfile.cf.get('collectd', 'interval')
        sudo("sed -i 's/#Interval 10/Interval " + configuration +
             "/g' /etc/collectd/collectd.conf")
        sudo("/etc/init.d/collectd stop")
        sudo("/etc/init.d/collectd start")
Exemplo n.º 7
0
def installCouch(multi='n'):
    if (len(env.hsots) > 1 and multi != 'y'):
        print "if you are sure that you want to install couchdb server on multi servers, please use `fab installCouch:y`"
        return
    else:
        if ((not fabfile.myenv.append) or env.host in fabfile.myenv.new_hosts):
            fabfile.__rootUser()
            sudo('apt-get install software-properties-common -y')
            sudo('add-apt-repository ppa:couchdb/stable -y')
            sudo('apt-get update -y')
            sudo('apt-get remove couchdb couchdb-bin couchdb-common -yf')
            sudo('apt-get install -V couchdb -y')
            sudo('couchdb stop')
            #TODO: mudify the listen address of couchdb.
            #sudo('')
            sudo('couchdb start')
Exemplo n.º 8
0
def installCouch(multi='n'):
    if (len(env.hsots) > 1 and multi != 'y'):
        print "if you are sure that you want to install couchdb server on multi servers, please use `fab installCouch:y`"
        return
    else:
        if ((not fabfile.myenv.append) or env.host in fabfile.myenv.new_hosts):
            fabfile.__rootUser()
            sudo('apt-get install software-properties-common -y')
            sudo('add-apt-repository ppa:couchdb/stable -y')
            sudo('apt-get update -y')
            sudo('apt-get remove couchdb couchdb-bin couchdb-common -yf')
            sudo('apt-get install -V couchdb -y')
            sudo('couchdb stop')
            #TODO: mudify the listen address of couchdb.
            #sudo('')
            sudo('couchdb start')
Exemplo n.º 9
0
def runCollectd(status='start'):
    if ((not fabfile.myenv.append) or env.host in fabfile.myenv.new_hosts):
        fabfile.__rootUser()
        sudo("/etc/init.d/collectd " + status)
Exemplo n.º 10
0
def runCollectd(status='start'):
    if ((not fabfile.myenv.append) or env.host in fabfile.myenv.new_hosts):
        fabfile.__rootUser()
        sudo("/etc/init.d/collectd "+status)