当前位置:网站首页>Development guidance document of CMDB
Development guidance document of CMDB
2022-07-04 10:10:00 【Stestack】
Cmdb Developing documents
Catalog
Cmdb Developing documents ... 1
1 Deployment instructions ... 1
1.1 Environmental statement ... 1
1.3 Clone deployment code ... 2
2.1 Description of the purpose of each data sheet ... 5
2.2 assets_host Table structure design ... 6
2.3 Computer room management ... 9
3 Automatic operation and maintenance ... 9
1 Deployment instructions
1.1 Environmental statement
Python Environmental Science :Python2.7
Django Environmental Science Django1.7.4
1.2 Django Of MTV Model
1.3 Clone deployment code
git clone https://github.com/voilet/cmdb
mv cmdb /data
cd /data/cmdb
pip install -r requirements.txt --index https://pypi.mirrors.ustc.edu.cn/simple/
Some may not have the need to install database construction
pip install MySQL-python
establish mysql Database and authorize account login :
Ø create database cmdb_v2 default charset=utf8;
Import database table file :
doc/cmdb.sql
insert data :
INSERT INTO `users_department_mode` VALUES (1,' Operation and maintenance department ','',1001);
insert into `users_customuser` (`id`, `password`, `last_login`, `is_superuser`, `email`, `username`, `first_name`, `last_name`, `department_id`, `mobile`, `session_key`, `user_key`, `menu_status`, `user_active`, `uuid`, `is_staff`, `is_active`, `date_joined`) values('1','pbkdf2_sha256$15000$uM1f5HMxHOqE$zPzKtNJMheQe62Q592V5l0m60nq/5Vj4rgzlVf5nXYs=','2016-08-04 14:12:56','1','[email protected]','admin','','',NULL,'','ff3a3s4vj7ivjl7km1teqhxrizwbdrek',NULL,'1','0','3eceb1e9-df90-38ed-9960-03183bc85cce','0','1','2015-12-29 14:05:50');
4、 Modify the configuration file mysite/settings.py:( This can be modified later )
EMAIL_HOST = 'mail.qq.com'
EMAIL_PORT = '25'
EMAIL_HOST_USER = 'devops'
EMAIL_HOST_PASSWORD = '123456'
EMAIL_USE_TLS = False
EMAIL_PUSH = True
# Email account
SendMail = "[email protected]"
REDIS_HOST = "127.0.0.1"
REDIS_PORT = 6379
REDIS_DB = 0
Modify the configuration file mysite/prod.py:( Database correlation , Must be modified )
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.mysql', # Add 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'.
# 'NAME': 'voilet_cmdb_v1', # Or path to database file if using sqlite3.
'NAME': 'cmdb_v2', # Or path to database file if using sqlite3.
'USER': 'root',
'PASSWORD': '123456', # Not used with sqlite3.
'HOST': '127.0.0.1', # Set to empty string for localhost. Not used with sqlite3.
'PORT': '3306', # Set to empty string for default. Not used with sqlite3.
"OPTIONS": {
"init_command": "SET foreign_key_checks = 0;",
},
},
Modify the boot configuration file uwsgi:( Must be modified , among /home/jm/uwsgi Change to the actual path )
DESC="uwsgi daemon"
NAME=uwsgi
DAEMON=/usr/bin/uwsgi
CONFIGFILE=/data/cmdb/mysite_uwsgi.ini
PIDFILE=/data/cmdb/mysite.pid
SCRIPTNAME=/etc/init.d/$NAME
Modify site profile mysite_uwsgi.ini:( Change to the actual address )
chdir = /data/cmdb
5 And then copy the program to /etc/init.d/
cp uwsgi /etc/init.d/uwsgi
6 Add nginx The host is configured to nginx.conf( among /data/cmdb Actual address )
server {
listen 80;
server_name cmdb.com;
proxy_buffer_size 64k;
proxy_buffers 32 32k;
proxy_busy_buffers_size 128k;
location /static {
alias /data/cmdb/static;
}
location /static/admin {
alias /usr/local/python2.7/lib/python2.7/site-packages/django/contrib/admin/static/admin;
}
location /static/ueditor {
expires 30d;
alias /data/cmdb/DjangoUeditor/static/ueditor;
}
location / {
include uwsgi_params;
uwsgi_pass 127.0.0.1:8100;
}
}
7 Start
service nginx reload
/etc/init.d/uwsgi start
notes :uwsgi adopt /etc/init.d/uwsgi stop Unable to close , It can be closed by directly killing the process
Open the web page to visit
Default password admin: Admin_147258
8 After logging in
First create a product line , Then create the project , Machine room under construction
Then add the service
2 Asset management
2.1 Description of the purpose of each data sheet
| AuthNode |
| AuthSudo |
| assets_conftemplate |
| assets_host | # Server information table
| assets_host_business | # Server and project correspondence table
| assets_host_service | # Server and service correspondence table
| assets_hostrecord | #cmdb User operation host record
| assets_idc | #idc Machine room information table
| assets_iplist | #ip list
| assets_line | # Product line data sheet
| assets_project | # Service and project correspondence table
| assets_projectuser | The user of the project
| assets_service | # Service information table
| assets_zabbixrecord | #zabbix Information sheet
| audit_ssh_audit | # Log audit - Command record table
| auth_group | #django Default automatic grouping
| auth_group_permissions | #django Default group permissions
| auth_permission | #django Permissions on the table
| cmdb_auth_auth_group | #django Authenticated group permission table
| cmdb_auth_auth_group_group_user | # User association table
| cmdb_auth_user_auth_cmdb | # Permissions on the table , by false There is no authority
| django_admin_log |
| django_content_type | #django Model
| django_migrations | # Database change operation record
| django_session | #session Information records ( The new permission will be written session in )
| gitCode | #git Code record
| incident |
| monitor_monitorhttp | # monitor http Table record of data
| monitor_monitorhttplog | # monitor http Data logging
| monitor_monitormysql | # monitor mysql Table record of data
| project_swan |
| project_swan_node |
| project_swan_push_user |
| push_system |
| salt_ui_operationlog | #
| salt_ui_salt_api_log |
| salt_ui_salt_conf |
| salt_ui_salt_mode_name |
| salt_ui_setuplog |
| swan_apply |
| swan_swanlog |
| users_customuser | #cmdb User information sheet
| users_customuser_groups | #cmdb User group information table
| users_customuser_user_permissions | # User table and permission correspondence table
| users_department_mode | # Department information sheet
| users_departmentgroup | # Department group information
| users_server_auth |
2.2 assets_host Table structure design
+-------------------+--------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+-------------------+--------------+------+-----+---------+-------+
| uuid | char(32) | NO | PRI | NULL | | #uuid
| node_name | varchar(100) | YES | | NULL | | # Host name
| eth1 | char(15) | YES | | NULL | | #eth1 network card ip
| eth2 | char(15) | YES | | NULL | | #eth2 network card ip
| mac | varchar(20) | YES | | NULL | | #MAC Address
| internal_ip | char(15) | YES | | NULL | | # Remote control card IP
| brand | varchar(64) | YES | | NULL | | # Server model
| cpu | varchar(64) | YES | | NULL | | #cpu Model description
| hard_disk | varchar(128) | YES | | NULL | | # Hard disk description
| memory | varchar(128) | YES | | NULL | | # Memory description
| system | varchar(32) | YES | | NULL | | # operating system
| system_cpuarch | varchar(32) | YES | | NULL | | # The operating system is platform based
| system_version | varchar(8) | YES | | NULL | | # System version
| create_time | datetime | NO | | NULL | | # Record creation time
| guarantee_date | date | YES | | NULL | | # Expiration time of server over warranty
| cabinet | varchar(32) | YES | | NULL | | # Cabinet
| server_cabinet_id | int(11) | YES | | NULL | | # The position of the cabinet where the machine is located
| number | varchar(32) | YES | | NULL | | # Serial number
| editor | longtext | YES | | NULL | | # Machine remarks
| status | int(11) | NO | | NULL | | # The current state of the server
| type | int(11) | NO | | NULL | | # Type of machine , Physical machine or virtual machine
| Services_Code | varchar(16) | YES | | NULL | | # Express service number
| env | varchar(32) | YES | | NULL | | # The environment of the machine
| room_number | varchar(32) | YES | | NULL | | # Room number of machine room floor
| server_sn | varchar(32) | YES | | NULL | | # The server sn Number
| switch_port | varchar(12) | YES | | NULL | | # Corresponding switch port
| idle | tinyint(1) | NO | | NULL | | # Are you free — This field is useless
| idc_id | char(32) | YES | MUL | NULL | | # Corresponding machine room id
| vm_id | char(32) | YES | MUL | NULL | | # Is the corresponding virtual machine
+-------------------+--------------+------+-----+---------+-------+
About asset management - Machine scrapping
from cmdb Delete this server in the system
Asset management increased raid Field
Add fields to the database
Model Add fields
Write fields to file
Synchronize the fields in the file to the database ( Found an error )
Force update to database
The fields in the table have been generated by querying the database
2.3 Server export
First static Under the directory, you need to create pdf Catalog
Secondly, repair -- Export all servers as virtual machines bug
The correct result can be derived after judgment .
2.3 Computer room management
desc assets_idc Field description
+-------------+--------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+-------------+--------------+------+-----+---------+-------+
| uuid | char(32) | NO | PRI | NULL | | # Computer room uuid
| name | varchar(64) | NO | | NULL | | # Name of machine room
| bandwidth | varchar(64) | YES | | NULL | | # Bandwidth size
| phone | varchar(32) | NO | | NULL | | # Computer room contact number
| linkman | varchar(32) | YES | | NULL | | # Computer room contact
| address | varchar(128) | YES | | NULL | | # Machine room address
| network | longtext | YES | | NULL | | #IP Address segment
| create_time | date | NO | | NULL | | # Record creation time
| operator | int(11) | YES | | NULL | |
| type | int(11) | YES | | NULL | | # Machine room type
| comment | longtext | YES | | NULL | | # remarks
+-------------+--------------+------+-----+---------+-------+
3 Automatic operation and maintenance
4 Business monitoring
5 fault management
边栏推荐
- Write a jison parser from scratch (5/10): a brief introduction to the working principle of jison parser syntax
- C语言指针经典面试题——第一弹
- Write a jison parser (7/10) from scratch: the iterative development process of the parser generator 'parser generator'
- 有老师知道 继承RichSourceFunction自定义读mysql怎么做增量吗?
- Kubernetes CNI 插件之Fabric
- Exercise 9-5 address book sorting (20 points)
- View CSDN personal resource download details
- El Table Radio select and hide the select all box
- Histogram equalization
- Exercise 7-8 converting strings to decimal integers (15 points)
猜你喜欢
IIS configure FTP website
Histogram equalization
Advanced technology management - how to design and follow up the performance of students at different levels
C # use gdi+ to add text to the picture and make the text adaptive to the rectangular area
Some summaries of the third anniversary of joining Ping An in China
Hands on deep learning (32) -- fully connected convolutional neural network FCN
Safety reinforcement learning based on linear function approximation safe RL with linear function approximation translation 2
C # use ffmpeg for audio transcoding
C # use gdi+ to add text with center rotation (arbitrary angle)
Application of safety monitoring in zhizhilu Denggan reservoir area
随机推荐
C # use ffmpeg for audio transcoding
Summary of reasons for web side automation test failure
View CSDN personal resource download details
C language pointer interview question - the second bullet
SSM online examination system source code, database using mysql, online examination system, fully functional, randomly generated question bank, supporting a variety of question types, students, teache
Write a jison parser (7/10) from scratch: the iterative development process of the parser generator 'parser generator'
System.currentTimeMillis() 和 System.nanoTime() 哪个更快?别用错了!
Normal vector point cloud rotation
百度研发三面惨遭滑铁卢:面试官一套组合拳让我当场懵逼
PHP personal album management system source code, realizes album classification and album grouping, as well as album image management. The database adopts Mysql to realize the login and registration f
Exercise 8-7 string sorting (20 points)
libmysqlclient. so. 20: cannot open shared object file: No such file or directory
In the case of easyUI DataGrid paging, click the small triangle icon in the header to reorder all the data in the database
智能网关助力提高工业数据采集和利用
mmclassification 标注文件生成
Kotlin set operation summary
7-17 crawling worms (15 points)
Hands on deep learning (46) -- attention mechanism
Exercise 9-5 address book sorting (20 points)
2021-08-10 character pointer