# client.py # ————————01CMDB获取服务器基本信息———————— from src import plugins #__init__.py from lib.serialize import Json #转成字符串或者模式 # ————————02CMDB将服务器基本信息提交到API接口———————— import requests #伪造页面访问 from config import settings #文件配置 # ————————02CMDB将服务器基本信息提交…
#settings.py # ————————01CMDB获取服务器基本信息———————— import os BASEDIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))##当前路径 # 采集资产的方式,选项有:agent(默认), salt, ssh MODE = 'agent' # ————————01CMDB获取服务器基本信息———————— # ————————02CMDB将服务器基本信息提交到API接口—…
#settings.py # ————————01CMDB获取服务器基本信息———————— import os BASEDIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))##当前路径 # 采集资产的方式,选项有:agent(默认), salt, ssh MODE = 'agent' # ————————01CMDB获取服务器基本信息———————— # ————————02CMDB将服务器基本信息提交到API接口—…
#base.py # ————————01CMDB获取服务器基本信息———————— from config import settings #配置文件 class BasePlugin(object): def __init__(self, hostname=''): if hasattr(settings, 'MODE'): self.mode = settings.MODE #采集资产的方式 else: self.mode = 'agent'#默认,采集资产的方式 def execute(…
#__init__.py # ————————05CMDB采集硬件数据的插件———————— from config import settings import importlib # ————————05CMDB采集硬件数据的插件———————— # ————————01CMDB获取服务器基本信息———————— from src.plugins.basic import BasicPlugin def get_server_info(hostname=None): """…
AutoClient #settings.py # ————————01CMDB获取服务器基本信息———————— import os BASEDIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))##当前路径 # 采集资产的方式,选项有:agent(默认), salt, ssh MODE = 'agent' # ————————01CMDB获取服务器基本信息———————— #settings.py #base.py…
root 123456 ip addr init 0 root 123456 ip addr root 123456 python3 yum -y install zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel gdbm-devel db4-devel libpcap-devel xz-devel yum -y install wget 在Linux上安装Python3…
#settings.py """ Django settings for AutoCmdb project. Generated by 'django-admin startproject' using Django 2.0.6. For more information on this file, see https://docs.djangoproject.com/en/2.0/topics/settings/ For the full list of settings…
AutoCmdb # urls.py """AutoCmdb URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/2.0/topics/http/urls/ Examples: Function views 1. Add an import: from my_app im…
#settings.py """ Django settings for AutoCmdb project. Generated by 'django-admin startproject' using Django 2.0.6. For more information on this file, see https://docs.djangoproject.com/en/2.0/topics/settings/ For the full list of settings…