iopsgroup / imoocc Goto Github PK
View Code? Open in Web Editor NEWpython+django运维自动化,实现自动化探测扫描,ansible2.4的自动化任务执行等功能
License: GNU General Public License v2.0
python+django运维自动化,实现自动化探测扫描,ansible2.4的自动化任务执行等功能
License: GNU General Public License v2.0
在终端使用createsuperuser命令创建用户和密码后,在数据库中可以看到新建的密码,但是在网页上却一直显示密码错误(但是密码并没有输入错误)。。。
Password Login ... {'10.4.7.20': ('22', '123456', 'root', 'Ubuntu 16.04', 'cmdb\n', '000c290a6796_', 'VMware-564d7280be67c8f3-2f4c4748960a6796\n', 'VMware, Inc.VMware Virtual Platform'), '10.4.7.30': ('22', '123456', 'root', 'CentOS Linux 7.7', 'localhost.localdomain\n', '000c29c5c0d8_', 'VMware-564dd180c9c331c6-8494264cf3c5c0d8\n', 'VMware, Inc.VMware Virtual Platform')} {}
Key Login ... {} {}
(535, 'Error: authentication failed')
Traceback (most recent call last):
File "./main.py", line 201, in
main()
File "./main.py", line 126, in main
key_ip_dic = ft.run()
File "/data/git/imoocc/scanhosts/util/j_filter.py", line 31, in run
self.filter_type()
File "/data/git/imoocc/scanhosts/util/j_filter.py", line 98, in filter_type
VirtualServerInfo.objects.create(server_ip=item_val[0],server_type=item_val[-1],system_ver=item_val[6],sys_hostname=item_val[7],mac=item_val[-3],sn=item_val[-2],vir_phy_id=1,conn_vir_id=int(self.key_sn_relate[sn_key]))
File "/opt/python2.7/lib/python2.7/site-packages/django/db/models/manager.py", line 127, in manager_method
return getattr(self.get_queryset(), name)(*args, **kwargs)
File "/opt/python2.7/lib/python2.7/site-packages/django/db/models/query.py", line 348, in create
obj.save(force_insert=True, using=self.db)
File "/opt/python2.7/lib/python2.7/site-packages/django/db/models/base.py", line 710, in save
force_update=force_update, update_fields=update_fields)
File "/opt/python2.7/lib/python2.7/site-packages/django/db/models/base.py", line 738, in save_base
updated = self._save_table(raw, cls, force_insert, force_update, using, update_fields)
File "/opt/python2.7/lib/python2.7/site-packages/django/db/models/base.py", line 822, in _save_table
result = self._do_insert(cls._base_manager, using, fields, update_pk, raw)
File "/opt/python2.7/lib/python2.7/site-packages/django/db/models/base.py", line 861, in _do_insert
using=using, raw=raw)
File "/opt/python2.7/lib/python2.7/site-packages/django/db/models/manager.py", line 127, in manager_method
return getattr(self.get_queryset(), name)(*args, **kwargs)
File "/opt/python2.7/lib/python2.7/site-packages/django/db/models/query.py", line 920, in _insert
return query.get_compiler(using=using).execute_sql(return_id)
File "/opt/python2.7/lib/python2.7/site-packages/django/db/models/sql/compiler.py", line 974, in execute_sql
cursor.execute(sql, params)
File "/opt/python2.7/lib/python2.7/site-packages/django/db/backends/utils.py", line 79, in execute
return super(CursorDebugWrapper, self).execute(sql, params)
File "/opt/python2.7/lib/python2.7/site-packages/django/db/backends/utils.py", line 64, in execute
return self.cursor.execute(sql, params)
File "/opt/python2.7/lib/python2.7/site-packages/django/db/utils.py", line 97, in exit
six.reraise(dj_exc_type, dj_exc_value, traceback)
File "/opt/python2.7/lib/python2.7/site-packages/django/db/backends/utils.py", line 64, in execute
return self.cursor.execute(sql, params)
File "/opt/python2.7/lib/python2.7/site-packages/django/db/backends/mysql/base.py", line 124, in execute
return self.cursor.execute(query, args)
File "/opt/python2.7/lib/python2.7/site-packages/MySQLdb/cursors.py", line 205, in execute
self.errorhandler(self, exc, value)
File "/opt/python2.7/lib/python2.7/site-packages/MySQLdb/connections.py", line 36, in defaulterrorhandler
raise errorclass, errorvalue
django.db.utils.DataError: (1406, "Data too long for column 'sys_hostname' at row 1")
aaaaaaaaaaaaaaa
python main.py 运行出错:
/home/hj/Projects/imoocc/apps/detail/models.py:7: RemovedInDjango19Warning: Model class apps.detail.models.ConnectionInfo doesn't declare an explicit app_label and either isn't in an application in INSTALLED_APPS or else was imported before its application was loaded. This will no longer be supported in Django 1.9.
class ConnectionInfo(models.Model):
Traceback (most recent call last):
File "main.py", line 21, in <module>
from scanhosts.util.nmap_all_server import NmapNet
File "/home/hj/Projects/imoocc/scanhosts/util/nmap_all_server.py", line 23, in <module>
from apps.detail.models import ConnectionInfo, VirtualServerInfo, PhysicalServerInfo, NetConnectionInfo, NetWorkInfo
File "/home/hj/Projects/imoocc/apps/detail/models.py", line 7, in <module>
class ConnectionInfo(models.Model):
File "/root/.virtualenvs/imooc/lib/python2.7/site-packages/django/db/models/base.py", line 309, in __new__
new_class._meta.apps.register_model(new_class._meta.app_label, new_class)
File "/root/.virtualenvs/imooc/lib/python2.7/site-packages/django/apps/registry.py", line 221, in register_model
(model_name, app_label, app_models[model_name], model))
RuntimeError: Conflicting 'connectioninfo' models in application 'detail': <class 'detail.models.ConnectionInfo'> and <class 'apps.detail.models.ConnectionInfo'>.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.