Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env python
- from fabric.api import run, env, sudo
- net_part = '192.168.1.'
- env.hosts = [net_part + str(i) for i in range(1, 255)]
- env.user = 'administrator'
- env.password = 'password'
- def host_type():
- try:
- type_host = run('uname -s')
- if type_host == 'Linux':
- check_apache()
- except:
- pass
- def check_apache():
- run('ps -e -O rss,pcpu |grep apache')
- def test_memory():
- run('free -m')
- def update():
- sudo('apt-get update')
- if __name__ == '__main__':
- host_type()
- check_apache()
- test_memory()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement