zabbix 客户端安装配置

摘要:下载安装客户端所有版本下载地址:http://www.zabbix.com/download.php,可以直接下载已经编译好的二进制文件,或者也可以源码安装。# cd /usr/local/src# wget "http://downloads.sourceforge.net/project/zabbix/ZABBIX%20Latest%20Stable/2.2.2/zabbix-2.2.2.tar.gz?r=http%3A%2F%2Fwww.zabbix.com%2Fdownload.php&ts=1395066528&use_mirror=jaist"# tar

 zabbix_agent.conf 和zabbix_agentd.conf区别

摘要:zabbix_agent.conf是用超级服务(xinetd)的方式来启动的,zabbix_agentd.conf是以独立进程的方式来启动的,

 Zabbix安装组合

摘要:安装组合:服务端: zabbix-2.4.0-1.el6.x86_64.rpm 核心组件 zabbix-server-2.4.0-1.el6.x86_64.rpm zabbix-server-mysql-2.4.0-1.el6.x86_64.rpm 或者:zabbix-server-pgsql-2.4.0-1.el6.x86_64.rpm web: zabbix-web-2.4.0-1.el6.x86_64.rpm zabbix-web-mysql-2.4.0-1.el6.x86_64.rpm 或者: zabbix-web-pgsql-2.4.0-1.el6.x86_64.rpm 手动获取数据: zabbix-get-2.4.0-1.e

 zabbix_get 测试服务端是否可以连接客户端

摘要:测试服务端是否可以连接客户端:[测试 zabbix agent 是否正常工作](不可以跨网段,跨网段将无法连接)最后我们测试一下是否正常(返回 1 表示正常,否则即代表监控异常):[root@zabbix-server ~]# /usr/local/zabbix/bin/zabbix_get -s 127.0.0.1 -p 10050 -k agent.ping 1例如:[root@localhost usr]# /usr/local/zabbix/bin/zabbix_get -s 192.168.1.17 -p 10050 -k age

 zabbix官方源YUM安装

摘要:web访问:http://repo.zabbix.com/zabbix/2.4/rhel/6/x86_64/wget  http://repo.zabbix.com/zabbix/2.4/rhel/6/x86_64/zabbix-release-2.4-1.el6.noarch.rpmrpm -ivh zabbix-release-2.4-1.el6.noarch.rpm#yum makecache[root@localhost ~]# yum list all | grep zabbixzabbix-release.noarch                     &nb

 Zabbix server,agentd安装配置

摘要:一、zabbix安装环境zabbix的安装配置是个较繁杂的过程,它是基于lamp或lnmp,只不过之前装的lamp架构可能无法满足zabbix的需求,比如某些php的扩展,所以我建议重装php。1、查看linux的版本信息[root@localhost ~]# lsb_release -aLSB Version:    :base-4.0-amd64:base-4.0-noarch:core-4.0-amd64:core-4.0-noarch:graphics-4.0-amd64:graphics-4.0-noarch:printing

 生产环境代码包发布管理

摘要:#!/usr/bin/env pythonfrom fabric.api import *from fabric.colors import *from fabric.context_managers import *from fabric.contrib.console import confirmimport timeenv.user='root'env.hosts=['192.168.1.21','192.168.1.22']env.password='SKJh935yft#'env.project_dev_source = '/data/dev/Lwebadmin/'env.project_tar_source = '/data/dev/releases/'env.project_p

 部署LAMP业务服务环境

摘要:[root@node110 fabric]# cat simple5.py #!/usr/bin/env pythonfrom fabric.colors import *from fabric.api import *env.user='root'env.roledefs = {    'webservers': ['192.168.1.21', '192.168.1.22'],    'dbservers': ['192.168.1.23']}env.passwords = {    'root@192.168.1.21:22': 'SKJh935yft#',    'root@192.168.1.

 文件打包,上传与校验

摘要:[root@node110 fabric]# cat simple4.py#!/usr/bin/env pythonfrom fabric.api import *from fabric.context_managers import *from fabric.contrib.console import confirmenv.user='root'#env.hosts=['192.168.1.21','192.168.1.22','192.168.1.23']env.hosts=['192.168.2.110','192.168.2.120']env.password='123456'@task@runs_oncedef tar_task():    with lcd(

 网关模式文件上传与执行

摘要:[root@node110 fabric]# cat simple3.py#!/usr/bin/env pythonfrom fabric.api import *from fabric.context_managers import *from fabric.contrib.console import confirmenv.user='root'#env.gateway='192.168.1.23'env.gateway='192.168.2.120'#env.hosts=['192.168.1.21','192.168.1.22']env.hosts=['192.168.2.121']env.passwords = {   # 'root@192.168.1.21:

 动态获取远程目录列表

摘要:[root@node110 fabric]# cat simple2.py#!/usr/bin/env pythonfrom fabric.api import * env.user='root'env.hosts=['192.168.2.110','192.168.2.120']env.password="123456"@runs_oncedef input_raw():    return prompt("please input directory name:",default="/home")def worktask(dirname):    run("ls -l

 查看本地与远程主机信息

摘要:[root@node110 fabric]# cat simple1.py#!/usr/bin/env pythonfrom fabric.api import *env.user='root'env.hosts=['192.168.2.110','192.168.2.120']env.password='123456'@runs_once #只有第一台主机触发此函数(192.168.2.110)def local_task():    local("uname -a")def remote_task():    with cd("/tmp"):      &

 直接在命令行上批量执行命令

摘要:[root@node110 fabric]# fab -p 123456 -H 192.168.2.120,192.168.2.121 -- 'uname -s'[192.168.2.120] Executing task '<remainder>'[192.168.2.120] run: uname -s[192.168.2.120] out: Linux[192.168.2.120] out: [root@node110 fabric]# fab -p 123456 -H 192.168.2.120,192.168.2.121 -- 'uname -a'[192.168.2.120] Executing task '<remainder>'[192.16

 fabfile.py

摘要:[root@node110 fabric]# cat fabfile.py#!/usr/bin/env pythonfrom fabric.api import rundef host_type():    run('uname -s')结果:[root@node110 fabric]# fab -H 192.168.2.120 host_type[192.168.2.120] Executing task 'host_type'[192.168.2.120] run: uname -s[192.168.2.120] out: Linux[192.168.2.120] out: 

 实现堡垒机模式下的远程文件上传

摘要:[root@node110 paramiko]# cat simple4.py #!/usr/bin/env pythonimport paramikoimport os,sys,timehostname="192.168.2.121"username="root"password="123456"blip="192.168.2.120"bluser="root"blpasswd="123456"tmpdir="/tmp"remotedir="/data"localpath="/home/nginx_access.

 实现堡垒机模式下的远程命令执行

摘要:[root@node110 paramiko]# cat simple3.py #!/usr/bin/env pythonimport paramikoimport os,sys,timehostname="192.168.2.121"username="root"password="123456"blip="192.168.2.120"bluser="root"blpasswd="123456"port=22passinfo='\'s password: 'paramiko.util.log_to_file('syslogin.log')ssh=paramiko

 通过密钥方式登录远程主机

摘要:[root@node110 paramiko]# cat simple2.py #!/usr/bin/env pythonimport paramikoimport oshostname='192.168.2.120'username='root'paramiko.util.log_to_file('syslogin.log')ssh=paramiko.SSHClient()ssh.load_system_host_keys()#privatekey = os.path.expanduser('/home/key/id_rsa')privatekey = os.path.expanduser('/root/.ssh/id_rsa')key = paramiko.RSAKey.fro

 SFTPclient

摘要:#!/usr/bin/env pythonimport paramikousername="root"password="123456"hostname="192.168.2.120"port=22try:    t=paramiko.Transport((hostname,port))    t.connect(username=username,password=password)    sftp=paramiko.SFTPClient.from_transport(t)    sftp.put("/root/test.sql",

 登录远程SSH并返回执行结果SSHClient

摘要:[root@node110 paramiko]# cat simple1.py #!/usr/bin/env pythonimport paramikohostname='192.168.2.120'username='root'password='123456'paramiko.util.log_to_file('syslogin.log')ssh=paramiko.SSHClient()ssh.load_system_host_keys()ssh.connect(hostname=hostname,username=username,password=password)stdin,stdout,stderr=ssh.exec_command('free -m')print st

 pxssh

摘要:[root@node110 pexpect]# cat simple1-pxssh.py import pxsshimport getpasstry:    s = pxssh.pxssh()    hostname = raw_input('hostname: ')    username = raw_input('username: ')    password = getpass.getpass('password: ')    s.login (hostname, username, password)    s.sendline ('uptime') &
分页:« 42 43 44 45 46 47 48 49 50 51 »
Powered by AKCMS