CMDB Project 1

Source: Internet
Author: User

CMDB Project


1.ip Address

2.mac Address


1. View basic Linux hardware information

1. View CPU Cat/proc/cpuinfo

(1) Processor: A unique identifier that includes this logical processor.

(2) Physical ID: includes a unique identifier for each physical package.

(3) Core ID: holds a unique identifier for each core.

(4) Siblings: Lists the number of logical processors in the same physical package.

(5) CPU cores: Contains the number of cores in the same physical package.

(6) If the processor is an Intel processor, the string in the vendor ID entry is Genuineintel.

(9) Model NAME:CPU models

2. Number of logical CPUs

Cat/proc/cpuinfo | grep ' Processor ' | Wc-l

3. Number of physical CPUs (CPU slots)

Cat/proc/cpuinfo | grep ' Physical ID ' | Sort | Uniq | Wc-l

3. See if the CPU supports 64bit

Cat/proc/cpuinfo | grep Flags | grep ' LM ' | Wc-l

Results greater than 0, indicating support for 64bit computing

4. View the CPU model

Cat/proc/cpuinfo | grep ' model name ' | Awk-f ': ' {print $} '

5.ip Address:

6.mac Address:


1. Modules used


Commands.getstatusoutput (CMD) returns two elements (status, results);

Commands.getoutput (cmd) returns results


Urllib.urlopen (Url,date,proxies,context)


The URLLIB2 module defines features and classes that facilitate the opening of URLs (primarily HTTP) in a complex world-basic and Digest authentication, redirection, cookies, etc.

Urllib2.urlopen (Url,data,timeout)


What do the delegates mean?

def __xxx (self):

def _xxx (self):

Hasattr (object, name) built-in function

The arguments is an object and a string. The result is True if the string is the name of the one of the object ' s attributes, False if not. (This was implemented by calling GetAttr (object, name) and seeing whether it raises a attributeerror or not.)

GetAttr (object, name[, default])

Return the value of the named attribute of object. Name must is a string. The If the string is the name of the one of the object ' s attributes, and the result is the value of this attribute. For example, GetAttr (x, ' Foobar ') are equivalent to X.foobar. If the named attribute does not exist, the default is returned if provided, and otherwise attributeerror is raised.{}

{' CPU ': {' cpumodename ': ' Intel (R) Core (TM) i5-5200u CPU @ 2.20GHz ', ' processor ': ' 1 '}, ' hostname ': ' Kevin ', ' asset ': {' Wak ' e-up Type ': ' Power Switch ', ' UUID ': ' e4144d56-8399-ae0e-f1d1-5c01911b965c ', ' Serial number ': ' VMware-56 4d e4 0e AE-F1 D1 5c 1b 5c ', ' manufacturer ': ' VMware, Inc. ', ' Product Name ': ' VMware Virtual Platform '}, ' network ': {' maca DD ': ' 00:0c:29:1b:96:5c ', ' netmask ': ' ', ' IP ': ' ', ' Gateway ': ' '}}

3. Name = models. Charfield (max_length=64, Unique=true)

SN = models. Charfield (max_length=64, Unique=true)

Network = models. Genericipaddressfield (Null=true, Blank=true)

#asset = models. Onetoonefield (' Asset ')

IP = models. Genericipaddressfield (Null=true, Blank=true)

Mac = models. Charfield (MAX_LENGTH=50)

hostname = models. Charfield (MAX_LENGTH=50)

Processor=models. Booleanfield (default = 5)

Physicalid=models. Booleanfield (default = 5)


Support=models. Booleanfield (default = 5)

Models_name=models. Charfield (MAX_LENGTH=50)


IP address, MAC address,

CPU--Number of CPUs, CPU slots, see if CPU supports 64bit, view CPU model ...

4.Client send data to determine whether the same as the previous data?

5. Problems encountered:

1.django Erro

2. A piece of data from the client, how to determine whether it is Updata or Create??

A: New insert: Through the analysis of other people's Code over and over again, others switch ideas, create a new asset approval library in MySQL, and then insert the new data into the library .... Pending processing

When a piece of data is transmitted, determine whether the data has the same SN, if there is an update, none is new, and then create in the new asset approval library, and then in the management staff on the Web page to confirm.

3. Flowchart:

CMDB Project 1

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: 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.