CMDB Operations Development Project

Source: Internet
Author: User
Tags saltstack

Itil:information Technology Infrastructure Library Information Technology infrastructure libraries, primarily for IT Service Management (ITSM). ITIL provides an objective, rigorous, quantifiable standard and specification for IT service management practices in the enterprise.

CMDB (Configuration Management database)

Stores and manages the various configuration information for devices in the enterprise IT architecture, which is closely linked to all service support and service delivery processes, supports the operation of these processes, the value of the configuration information, and relies on the process to ensure the accuracy of the data. In actual projects, the CMDB is often considered to be the basis for building other ITIL processes, and the success or failure of the ITIL project is very much related to the successful establishment of the CMDB.
70%~80% 's IT-related issues have a direct relationship with environmental changes. The difficulty and focus of implementing change management is not a tool, but a process. The change is managed through an automated, repeatable process that, when the change occurs, has a standardized process to execute, anticipating the impact of the change on the overall system management and assessing and controlling the impact. The key to automating the change management process is the CMDB.

    • Consolidation is the ability to take full advantage of information from other data sources, access the records source attributes contained in the CMDB, merge multiple data sources into one view, and generate reports with information from the CMDB and other data sources
    • Harmonic ability is to maintain the integrity of each configuration item data source in the CMDB by comparing the matching fields from each data source to ensure that the records in the CMDB are not duplicated in multiple data sources; automatic adjustment process minimizes initial implementation, manual operation of database administrators, and onsite maintenance support
    • Synchronization means ensuring that the information in the CMDB reflects the updates of federated data sources, determining the CMDB update schedule based on the frequency of federated data source updates, updating the CMDB with approved changes, and identifying unapproved changes
    • Application mapping and visualization, relationship between applications, dependencies between applications and other components, impact of changes, etc.
    • Configuration items: The work that is included in the configuration management category is a configuration item (CI)
    • Configuration Item Name: The name information that the configuration item automatically generates based on the build rule
    • Device Name: hostname of the device
    • Device Serial number: Factory S/n number of the device
    • Supervisor: Equipment/System Supervisor
    • Maintenance personnel: equipment/System maintenance personnel
    • System name: The standard name of the device/application/system (the system name of the city adds a prefix to the city name, such as: Guangzhou Unified information Platform)
    • Area: Equipment/systems/software used by companies, such as: Provincial companies, Guangzhou, Shenzhen and other
    • Network element Status: Engineering, back to the network, to remove the network to be deleted, the current network (do not carry business), the current network (bearer business)
    • Device type: The type of device used, i.e. switches, routers, firewalls, small machines, etc.
    • Brand: The brand of equipment, general foreign manufacturers in English big logo, domestic manufacturers in Chinese logo; virtual machine brand for virtual technology brand, such as VMware
    • Manage IP: The actual management IP of the device
    • Standard name: Unified standard naming normalization; City _ Business System _ Device Type _ number. such as: Provincial company _ Integrated network Management System _ Firewall _001

The current implementation of CMDB Asset management is as follows:
1.SSH class

Implementation of command for remote server based on CMDB Central controller and SSH

1 #based on Paramiko module, PIP3 install Paramiko2 ImportRequests3 ImportParamiko4 5 ################### Gets the host name not collected today ##################6 #result = Requests.get (' http://www.127.0.0.1:8000/assets.html ')7 #result = [' c1.com ', ' c2.com ']8 9 Ten ################### connect remote server via Paramiko, execute command ################## One #To create an SSH object ASSH =Paramiko. Sshclient () - #allow connections to hosts that are not in the Know_hosts file - Ssh.set_missing_host_key_policy (Paramiko. Autoaddpolicy ()) the #connecting to a server -Ssh.connect (hostname='192.168.179.130', Port=22, Username='Root', password="') -  - #Execute Command +stdin, stdout, stderr = Ssh.exec_command ('ifconfig') -  + #Get command Results Aresult =Stdout.read () at  - #Close Connection - ssh.close () - Print(Result) -  - #data_dict = {result} in  - ################### sending data ################## to #requests.post (' http://www.127.0.0.1:8000/assets.html ', data=data_dict)

To the API to take the host list of today's not collected assets, take the host name, remote connection server, the execution of commands, the results back to the central control machine to report to api--responsible for storage.

The advantage is no agent, the disadvantage is slow

2.Agent Shell-based command implementation

ImportsubprocessImportRequests#PIP3 Install requests################### Data Acquisition ##################result = Subprocess.getoutput ('ipconfig')#result is processed to get the desired data#Organize asset informationData_dict ={    'Nic': {},    'Disk':{},    'Mem':{}}################## sending data ##################Requests.post ('http://www.127.0.0.1:8000/assets.html', data=data_dict)

For the implementation of the agent version of the idea:

    • Agent acquisition of hardware assets
    • API provides interfaces for related processing
    • Management platform to provide users with visual operations

3.saltstack

#1. Installing Saltstack#rpm--import https://repo.saltstack.com/yum/redhat/6/x86_64/latest/SALTSTACK-GPG-KEY.pub#Master:yum Install Salt-Master Master Preparation: A. configuration file, monitoring native IP vim/etc/salt/Master interface: native IP address B. Start Master/etc/init.d/salt-Master start Slave:yum install salt-Minion Slave Preparation: A. config file, connect that master vim/etc/salt/Minion 16 Line Master: Remote Master address b. Start slave/etc/init.d/salt-Minion Start2. Create a Relationship view Master:salt-key-L Accepted keys:denied keys:unaccepted Keys:c1.com c2.com C3. COM rejected Keys: Accept Master:salt-key-a c1.com Accepted Keys:c1.com c2.com Denied keys:unaccepted Keys: C3.com rejected Keys:3. Execute command master:salt'c1.com'Cmd.run'ifconfig'    ImportSalt.client Local=salt.client.LocalClient () result= Local.cmd ('c2.salt.com','Cmd.run', ['ifconfig']) Vim/usr/bin/SaltImportRequests################## Gets the host name not collected today ##################result = Requests.get ('http://www.127.0.0.1:8000/assets.html') Result= ['c1.com','c2.com']################## remote Server execution command ##################ImportSubprocessresult= Subprocess.getoutput ("Salt ' c1.com ' cmd.run ' ifconfig '")Importsalt.clientlocal=salt.client.LocalClient () result= Local.cmd ('c2.salt.com','Cmd.run', ['ifconfig'])################## sending data ##################Requests.post ('http://www.127.0.0.1:8000/assets.html', data=data_dict)

4.Puppet
Implementation of factor and report functions based on puppet

The advantage is automatic reporting, with the disadvantage of using the Ruby language

CMDB Operations Development Project

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.