2018年1月10日

nagios-安装配置

摘要: 怎样快速增加real server配置文件 编写插件 nagios是插件式的、 yum install nagios ,nagios-plugins-all yum instal nagios yum install nagios-plugins-all service nagios restart 阅读全文

posted @ 2018-01-10 22:10 linux-paul 阅读(89) 评论(0) 推荐(0) 编辑

gunicon

摘要: 先安装epel yum install nginx.x86_64 配置nginx /etc/nginx/conf.d/virtual.conf server { listen 192.168.17.139:8000; server_name node01; location /static/admi 阅读全文

posted @ 2018-01-10 21:54 linux-paul 阅读(191) 评论(0) 推荐(0) 编辑

wsgi

摘要: 生产环境不需要启动开发服务器,django随着apache一起启动 安装模块​ yum install httpd yum search mod_wsgi yum install mod_wsgi cat /etc/httpd/conf.d/django.conf <VirtualHost *:80 阅读全文

posted @ 2018-01-10 21:10 linux-paul 阅读(105) 评论(0) 推荐(0) 编辑

api-shell格式

摘要: shell格式API vim urls.py url(r'^hostinfo/gettxt/$', 'hostinfo.views.gettxt'), vim view.py ​ def gettxt(req): res = '' hg = HostGroup.objects.all() for g 阅读全文

posted @ 2018-01-10 19:51 linux-paul 阅读(139) 评论(0) 推荐(0) 编辑

2 API-json格式

摘要: api 应用程序接口 创建web组,分个成员 再创建一个db组,加其他成员 组成数据结构 一个列表,有2个字典 from hostinfo.modles import & HostGroup.objects.all() Host.objects.all() hg=HostGroup.objects. 阅读全文

posted @ 2018-01-10 15:41 linux-paul 阅读(112) 评论(0) 推荐(0) 编辑

json模块应用及数据库查询

摘要: pickle有局限性,与其他语言交互,可以用json import json d={} d['a']='a' d['b']=255 d['c']=('c1','c2') d['d']=True d['e']=None with open('/tmp/d.json',mode='w')as fd: j 阅读全文

posted @ 2018-01-10 15:05 linux-paul 阅读(189) 评论(1) 推荐(0) 编辑

python运维开发-pickle序列化

摘要: pickle的使用 json是跨语言的,pickle是只能在python用,涉及序列化,反序列化 import pickle d= {a':1,'b':2} with open('/tmp/1.pickle','wb')as fd: pickle.dumps(d,fd) pickle模块应用,应用到 阅读全文

posted @ 2018-01-10 12:22 linux-paul 阅读(119) 评论(0) 推荐(0) 编辑

导航