Giter VIP home page Giter VIP logo

adminset's Introduction

AdminSet QuickStart

release
Adminset基于DevOps理念开发,以整合全部运维场景为己任。Adminset是一个真正的基于运维思维而开发的全自动化运维平台。

v0.50 新功能

全新用户权限系统
基于用户角色的部署权限关联
基于用户权限的功能按钮自动显示隐藏
基于用户的WEBSSH授权
django安全更新

开发环境

centos 7.2(1511) django 1.11.16 python 2.7

服务端安装

生产服务器建议 4核CPU,6G内存以上.
学习测试建议 2核CPU,2G内存以上.
服务器操作系统版本要求 centos7.2 centos7.4
安装之前请关闭防火墙
git clone https://github.com/guohongze/adminset.git
adminset/install/server/auto_install.sh

说明:手动自定义安装请使用 adminset/install/server/server_install.sh

客户端安装

客户端脚本目前rhel/centos6、centos7,ubuntu16.04
客户端python版本支持2.6.6及以上
说明:为保证注册IP是管理IP(后续会被ansible等调用),客户端的IP抓取目前使用主机名解析,否则报错。
如:主机名为cn-bj-web01 请在/etc/hosts中加入相应的解析 192.168.x.x cn-bj-web01,这样再执行adminset_agent.py 可以保证正常运行。

step1: 修改文件install/client/adminset_agent.py :

客户端正常使用需要修改脚本中的两个字段:
token = 'HPcWR7l4NJNJ'        #token是上传到服务器的密钥可以在WEB界面的系统配置中自定义
server_ip = '192.168.47.130'  #此项目为adminset server的IP地址

step2: 拷贝install/client/ 目录到客户机的任意位置并执行:

cd client
/bin/bash install.sh

step3: 客户端管理

service adminsetd start|stop|restart|status

注意:客户端全部功能需要配置服务器到客户端的ssh免密登录。

访问

关闭防火墙或开通80端口
http://your_server_ip
自动安装的用户名admin 密码Adminset123
手动安装使用自定义创建的super admin用户名密码

说明

使用手册,使用手册
详细使用说明:自动化安装完成后打开 http://your_server_ip/static/docs/
FAQ参考,常见问题

demo

每2小时重置一次数据
http://adminset.cn
用户名admin 密码Adminset123

安全

强烈建议您不要将程序对公网开放
如果需要公网访问请使用VPN
建议生产环境中使用https配置服务器,并对命令执行、webssh等模块进行安全强化
由于开发方便,在django的settings中开启了DEBUG,在生产中需要关闭并指定自己的域名。

开发者交流

请加入开发者群
3号群 730232593

adminset's People

Contributors

cclauss avatar cindywang0728 avatar guohongze avatar jimmy201602 avatar reflyhight avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

adminset's Issues

打开监控页面报错了

image

很不错的东西 我自己也有开发一套运维系统的想法,但是新人好多东西自己写起来特别吃力 目前只写了一个简单的基于ansible的cmdb 希望以后多跟你交流

获取CPU数量的方法需要修改

install/client/adminset_agent.py
修改:
cpu_cores = {"physical": psutil.cpu_count(logical=False) if psutil.cpu_count(logical=False) else 0, "logical": psutil.cpu_count()}

关于adminset相关建议

测试了一下adminset,体验还不错。简洁明了,使用方便。在使用过程中有几个小小的建议,具体如下:

  1. 资产管理,显示数据较少,具体如下图:
    image

比如能再增加一些操作系统版本信息、CPU型号、硬盘大小等更好;

  1. 增加一下用户的操作记录;

  2. 对用户的权限增加做一些说明,比如下图:
    image

对其中的权限添加的URL始终不解;

暂时只想到这些,非常感谢你的项目;

nginx反代问题

用nginx加上ssl证书反代后,点击资产管理(其他ajax请求需要弹出的对话框)都会有问题,会js console出现报错mix content,应该是https里面嵌入了http的request导致的,没有找到好的解决方法。

deploy no response 部署卡住

在应用管理中源类型使用git 源地址使用http方式时容易卡住。
原因是在启用认证以后admisnet会将URL进行重组,将关联联的认证用户的用户名密码带入到URL中,如果此时密码存在特殊字符则URL无法识别卡住。
临时解决
方法1:使用ssh方式下载代码。
方法2:在deploy时不使用认证功能,而是将用户名密码直接填写在应用管理的源地址上如下:
http://giuser:[email protected]/adminset.git
在gitpasswd中如果有特殊字符在前边加上转义符号\

进行同步操作时覆盖原Ansible的hosts文件

进行同步操作时会覆盖原Ansible的hosts文件,建议此操作改成生成一个特有的hosts文件,比如文件名为:adminset_<日期时间>_hosts。这样可以减少因误操作而覆盖原hosts文件。

对python3.6的支持不是很理想

对python3.6的支持不是很理想,我fork了一个版本,做了下python3.6的修改。
另外,我建议出一个docker部署的版本。如果,作者比较忙,没时间,我可以帮忙做docker化。
可以联系我。

主机信息采集问题

嗨,您好,
首先就是很高兴能够遇到adminset这么好的项目!
但是在测试过程中发现一个小的问题。那就是磁盘采集信息的问题,采集的不是物理机硬盘的块数,这方面是否想过进行优化呢。
还有就是比较关心的就是,该项目用到了mongodb/redis/MySQL数据库,关于该软件架构文档可以提供吗?
最后,还是非常感谢您能提供这么好的项目!!!!

是否考虑集成LDAP统一账号认证

今天下载项目安装了下,感觉非常简洁实用,另外是否能实现如下需求:
1.默认首页是否直接展示后台设置的网站导航呢?
2.能不能增加LDAP统一账号认证;
3.暂时还未正式使用,希望后面熟悉后一起加入到开发队伍。。。

执行agent_post_info.py提示如下错误

image

提示如图错误,从图中可以看出我打印该值,并没有cpu cores对应的值,这是为什么呢?还有该值是获取的物理CPU吗?我测试的环境是虚拟机环境,还请大师指点指点。
image

我该怎么办?请指教。

关于crontab的问题

hi,新建crontab的时候格式 不是分时日月星期么 UI上面写的是分时日月年 这种说法怎么理解

无法创建普通文件"/usr/lib/systemd/system/webssh.service": 没有那个文件或目录

创建文件夹 重复执行 还是报错

npm http 200 http://registry.cnpmjs.org/cycle
/usr/local/bin/forever -> /usr/local/lib/node_modules/forever/bin/forever
[email protected] /usr/local/lib/node_modules/forever
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected] ([email protected], [email protected])
├── [email protected] ([email protected], [email protected])
├── [email protected] ([email protected], [email protected])
├── [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected], [email protected])
├── [email protected] ([email protected], [email protected], [email protected])
├── [email protected] ([email protected], [email protected])
├── [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected], [email protected])
├── [email protected] ([email protected], [email protected])
├── [email protected] ([email protected], [email protected], [email protected], [email protected])
└── [email protected] ([email protected], [email protected], [email protected], [email protected])
sending incremental file list

sent 68421 bytes received 539 bytes 137920.00 bytes/sec
total size is 31514339 speedup is 456.99
adminset/install/server/auto_install.sh: line 63: systemctl: command not found

脚本提示安装成功了,但是访问报302呢

##############install finished###################
Restarting redis (via systemctl): [ 确定 ]
Redirecting to /bin/systemctl restart mariadb.service
Redirecting to /bin/systemctl restart adminset.service
Redirecting to /bin/systemctl restart celery.service
Redirecting to /bin/systemctl restart beat.service
Redirecting to /bin/systemctl restart mongod.service
Redirecting to /bin/systemctl restart sshd.service
Redirecting to /bin/systemctl restart webssh.service
please access website http://server_ip
you have installed adminset successfully!!!
################################################

[root@SZC-l201872 server]# curl -i http://localhost:80
HTTP/1.1 302 Found
Server: nginx/1.12.2
Date: Mon, 26 Feb 2018 11:00:32 GMT
Content-Type: text/html; charset=utf-8
Content-Length: 0
Connection: keep-alive
X-Frame-Options: SAMEORIGIN
Location: /navi/

Job for webssh.service failed because the control process exited with error code. See "systemctl status webssh.service" and "journalctl -xe" for details.

请问这个问题怎么解决,谢谢!
systemctl status webssh.service
● webssh.service - Celery Service
Loaded: loaded (/usr/lib/systemd/system/webssh.service; enabled; vendor preset: disabled)
Active: failed (Result: exit-code) since 一 2018-02-26 16:31:37 CST; 1min 31s ago
Process: 3693 ExecStart=/usr/bin/forever start --minUptime 1000 --spinSleepTime 1000 index.js (code=exited, status=203/EXEC)
Main PID: 3693 (code=exited, status=203/EXEC)

2月 26 16:31:37 SZC-l201872 systemd[1]: Starting Celery Service...
2月 26 16:31:37 SZC-l201872 systemd[1]: webssh.service: main process exited, code=exited, status=203/EXEC
2月 26 16:31:37 SZC-l201872 systemd[1]: Failed to start Celery Service.
2月 26 16:31:37 SZC-l201872 systemd[1]: Unit webssh.service entered failed state.
2月 26 16:31:37 SZC-l201872 systemd[1]: webssh.service failed.

使用adminset_agent.py报错

客户端用docker容器运行

容器内系统是 CentOS Linux release 7.3.1611 (Core)

在adminset_agent.py上修改了 server_ip = '172.17.0.7' 此为容器ip
token 这个是根据服务端上的token进行修改的吗?

运行adminset_agent.py后报错:

Traceback (most recent call last):
File "adminset_agent.py", line 303, in
asset_info_post()
File "adminset_agent.py", line 176, in asset_info_post
osenv = os.environ["LANG"]
File "/usr/lib64/python2.7/UserDict.py", line 23, in getitem
raise KeyError(key)
KeyError: 'LANG'

请问如何解决?

adminset 客户端执行报错

[root@test opt]# python adminset_agent.py
Get the hardwave infos from host:
Traceback (most recent call last):
File "adminset_agent.py", line 303, in
asset_info_post()
File "adminset_agent.py", line 179, in asset_info_post
print asset_info()
File "adminset_agent.py", line 166, in asset_info
data_info['sn'] = parser_dmi(get_dmi())['Serial Number']
KeyError: 'Serial Number'
[root@jira opt]# vim adminset_agent.py
[root@jira opt]# python adminset_agent.py
Get the hardwave infos from host:
Traceback (most recent call last):
File "adminset_agent.py", line 303, in
asset_info_post()
File "adminset_agent.py", line 179, in asset_info_post
print asset_info()
File "adminset_agent.py", line 166, in asset_info
data_info['sn'] = parser_dmi(get_dmi())['Serial Number']
KeyError: 'Serial Number'

WEBSSH无法使用

免密已经配置,ansible shell都没问题,打开webssh显示SSH CONN ERROR: All configured authentication methods failed。客户端和服务端的systemctl webssh status都是active,都是打开的,请问还要检查哪里?
另外一个问题,HOSTS.adminset.cn:2222这个自动跳转的域名的代码是在哪儿,希望作者回复下,感谢。

页面一直打不开。

192.168.2.34 - - [30/Aug/2017:23:00:07 +0800] "HEAD / HTTP/1.1" 502 0 "-" "curl/7.29.0"
页面一直打不开。

权限管理咨询

hi 兄弟 权限管理系统url的使用方式 可以举几个例子说明么

在运行server_install.sh时报npm: relocation error: npm: symbol SSL_set_cert_cb, version libssl.so.10 not defined in file libssl.so.10 with link time reference

我在运行安装脚本时遇到报错
...
Verifying : 1:nodejs-6.11.3-1.el7.x86_64 4/4

Installed:
nodejs.x86_64 1:6.11.3-1.el7

Dependency Installed:
http-parser.x86_64 0:2.7.1-5.el7_4 libuv.x86_64 1:1.10.2-1.el7 npm.x86_64 1:3.10.10-1.6.11.3.1.el7

Complete!
npm: relocation error: npm: symbol SSL_set_cert_cb, version libssl.so.10 not defined in file libssl.so.10 with link time reference

然后找到了 node.js安装后的命令手工运行,报了相同的错误
70 /usr/bin/yum install -y nodejs
71 cd $cur_dir/vendor/WebSSH2
72 /usr/bin/npm install -g cnpm --registry=https://registry.npm.taobao.org
73 /usr/bin/cnpm install --production

[root@localhost ~]# find / -type d -name WebSSH2
find: ‘/run/user/1000/gvfs’: Permission denied
/root/adminset/vendor/WebSSH2
[root@localhost ~]# cd /root/adminset/vendor/WebSSH2
[root@localhost WebSSH2]# /usr/bin/npm install -g cnpm --registry=https://registry.npm.taobao.org
npm: relocation error: npm: symbol SSL_set_cert_cb, version libssl.so.10 not defined in file libssl.so.10 with link time reference
[root@localhost WebSSH2]#

我系统的版本
[root@localhost server]# cat /etc/release
CentOS Linux release 7.2.1511 (Core)
Derived from Red Hat Enterprise Linux 7.2 (Source)
NAME="CentOS Linux"
VERSION="7 (Core)"
ID="centos"
ID_LIKE="rhel fedora"
VERSION_ID="7"
PRETTY_NAME="CentOS Linux 7 (Core)"
ANSI_COLOR="0;31"
CPE_NAME="cpe:/o:centos:centos:7"
HOME_URL="https://www.centos.org/"
BUG_REPORT_URL="https://bugs.centos.org/"

[root@localhost server]# npm -v
3.10.10

服务端资产管理显示安装脚本

目前需要手动在目标主机中运行client的install,能否在资产页面上显示一个安装脚本地址,在客户端运行这个脚本,就可以建立起目标主机和服务端的联系。

如何使用docker 化部署?

[root@5a4dd2da36bc server]# ./server_install.sh
./server_install.sh: line 22: getenforce: command not found

docker 中不能用。

Python 3下面安装不了

出错如下: ModuleNotFoundError: No module named 'ConfigParser'
详细错误:
Collecting django==1.9.8 (from -r requirements.txt (line 1))
Using cached Django-1.9.8-py2.py3-none-any.whl
Collecting sh==1.12.9 (from -r requirements.txt (line 2))
Using cached sh-1.12.9-py2.py3-none-any.whl
Collecting mysql-python==1.2.5 (from -r requirements.txt (line 3))
Using cached MySQL-python-1.2.5.zip
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "", line 1, in
File "/private/var/folders/fm/hxx1g7yd7dn1m0rtrgfb218w0000gn/T/pip-build-jvoobcwo/mysql-python/setup.py", line 13, in
from setup_posix import get_config
File "/private/var/folders/fm/hxx1g7yd7dn1m0rtrgfb218w0000gn/T/pip-build-jvoobcwo/mysql-python/setup_posix.py", line 2, in
from ConfigParser import SafeConfigParser
ModuleNotFoundError: No module named 'ConfigParser'

install失败

用server_install.sh安装的时候, 下了40多个G的内容, 最后磁盘满了才停掉, 不知是怎么回事?

webssh功能无法使用

客户端探针运行正常,服务器已经分发ssh公钥到各客户机上,ssh登录密码和系统配置-密钥设置-ssh password一致。但是点击资产管理列表的webssh按钮,并没有弹出SSH登录对话框,而是打开了浏览器新窗口地址栏显示http://172.16.100.101:2222/ssh/host/172.16.100.101。请问是否还有什么组件未部署?
我看到其他的issue中提到了webssh 服务,请问这个是adminset自带的模块?安装说明中似乎没有提到如何安装。

计划给Adminset 添加windows 功能

1.windows powershell / bat 支持
2.windows agent 自动上报服务器信息
3.支持saltstack任务
4.windows主机支持RDP协议登录
5.支持SCP协议
请楼主给我一些建议和指导

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.