Build Python software Building series

Source: Internet
Author: User

The company took over a small project, the customer proposed an operational requirements, that is, through a command, or a script to obtain the performance of multiple servers.

There is no doubt that I naturally think of using Python to write a gadget that meets the requirements described above. The following is a detailed procedure.

    1. Build Python third-party module Paramiko.

      See the previous Blog

    2. Gets the IP address, user name, and password for all servers.

This information is required for executing the Paramiko module.

3. Write the code.

The code is mainly experienced in two versions.

Version 1.1.1


650) this.width=650; "Src=" https://s5.51cto.com/wyfs02/M02/06/AF/wKiom1m777TimW3TAADmY2sY1wQ385.jpg-wh_500x0-wm_ 3-wmp_4-s_1290610938.jpg "title=" ui.jpg "alt=" Wkiom1m777timw3taadmy2sy1wq385.jpg-wh_50 "/>

The host IP of the #安装paramiko module is 167, the first version, not written into the code.


Vision 1.1.2

650) this.width=650; "Src=" https://s3.51cto.com/wyfs02/M01/06/AF/wKiom1m78XbzV35tAAD6sKZOmdM116.jpg-wh_500x0-wm_ 3-wmp_4-s_1176103116.jpg "title=" u2.jpg "alt=" Wkiom1m78xbzv35taad6skzomdm116.jpg-wh_50 "/>

The code above uses localhost to communicate with the native, without the need for a separate Python module called the shell command.


To this end, all of the project's host's memory, disk and other information are executed in a single script to get it all. The subsequent version is how to format the output, as well as the use of storage, in the browser display, or even the C/s architecture. Think of Ansible is not the integration of various resources of the birth.

This article is from the "12723827" blog, please be sure to keep this source http://jason83.blog.51cto.com/12723827/1965769

Build Python software Building series

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.