#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): """…
#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…
cd /py/AutoClient/bin python3 auto-client.py /usr/local/python3/bin/pip install requests python3 auto-client.py https://www.bejson.com/ { 'os_platform': 'Linux', 'os_version': '\\S', 'hostname': 'DKL18U83RFAQI3G', 'cpu': { 'status': True, 'message':…
#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…
# client.py # ————————01CMDB获取服务器基本信息———————— from src import plugins #__init__.py from lib.serialize import Json #转成字符串或者模式 # ————————02CMDB将服务器基本信息提交到API接口———————— import requests #伪造页面访问 from config import settings #文件配置 # ————————02CMDB将服务器基本信息提交…
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…