博客

  • zabbix-mail

    zabbix  邮件 时间

    配置,安装 邮件 输出 log

    cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
    ntpdate us.pool.ntp.org

     zabbix系统的时区只与/etc/localtime有关。如果用/usr/share/zoneinfo/下面的某个时区文件(比如我用的Aisa/Shanghai)覆盖/etc/localtime,那么zabbix的系统时区就是相应的localtime(我的就是CST了)。如果不覆盖/etc/localtime,则zabbix就是采用UTC时间。这个可以通过敲入date命令看出来。

    (网上也查了很多资料,关于linux系统时区的设置。比较多的是说与/etc/sysconfig/clock文件里的“UTC=true、false”有关。但zabbix的clock文件里边没有“UTC=true、false”,而且自己给加上这么一行也没用。而且与clock文件里的hwclock=–localtime无关系。即便=–localtime,如果不覆盖/etc/localtime,用date命令显示的仍是UTC。)

     

    zypper install ncurses-devel gcc make

    wget ftp://ftp.mutt.org/mutt/mutt-1.4.2.3.tar.gz

    tar zxvf mutt-1.4.2.3.tar.gz

    ./configure –prefix=/usr/local/msmtp

    make

    make install

     

    Muttrc

    /usr/local/msmtp/etc/Muttrc

     

     

    set sendmail=”/usr/local/msmtp/bin/mutt”

     


    正常的发送邮件应该是

    ./usr/local/msmtp/bin/mutt [email protected]

    fin

    配置文件在

    /usr/local/msmtp/etc/Muttrc


    配置文件为止

    /usr/local/msmtp/etc/Muttrc



     

    echo “neirong” |./mutt -s “tt” [email protected]

  • mutt

    mutt

    先msmtp
    yum 安装时候的配置文件
    nano /usr/local/etc/Muttrc
    echo $3 |mutt -s $2 $1
  • zabbix fping

    zabbix fping

    shell> chown root:zabbix /usr/sbin/fping
    shell> chmod 710 /usr/sbin/fping
    shell> chmod ug+s /usr/sbin/fping
    CentOS 5centos.karan.org/el5/extras/testing/x86_64/RPMS/fping-2.4b2-7.el5.kb.x86_64.rpm
    CentOS 5centos.karan.org/el5/extras/testing/i386/RPMS/fping-2.4b2-7.el5.kb.i386.rpm
    Checks if server is accessible by ICMP ping. 0 – ICMP ping fails. 1 – ICMP ping successful. One of zabbix_server processes performs ICMP pings once per PingerFrequency seconds
    zabbix fping

    web03# wget http://fping.sourceforge.net/download/fping.tar.gz
    web03# tar zxf fping.tar.gz
    web03# cd fping-2.4b2_to
    web03# ./configure
    web03# make && make install

    安装完毕后,一起就2个文件:

    /usr/local/sbin/fping #执行文件
    
    /usr/local/man/man8/fping.8 #man文件

    设置fping权限:

    web03# chown root:zabbix /usr/local/sbin/fping
    web03# chmod 710 /usr/local/sbin/fping
    web03# chmod ug+s /usr/local/sbin/fping
  • zabbix_get

    zabbix_get

    zabbix_get -s 172.16.188.50 -p10050 -k”cpu[*]”

    这个是测试的命令

    UserParameter=key[*],command
    这个是格式

    UserParameter=httpd[cpu],ps auxw|grep httpd|grep -v grep| awk ‘{s+=$3} END {print s}’

    这个是我们测试CPU的条目当然了,没成功

    UserParameter=httpd[cpu],ps auxw|grep httpd|grep -v grep| awk ‘{s+=$3} END {print s}’//放在zabbix_agent.conf里面

  • centos关闭fw

    centos 关闭fw

    chkconfig –level 35 iptables off

  • zabbix ossim 协同

    zabbix ossim 协同

    修改syslog脚本发送出去
    /etc/rsyslog.conf

    local0,local1.*    @@10.1.5.124:514
    发送到124

    修改报警脚本

    /home/zabbix/bin/baojing

    #!/bin/bash
    logger -p local1.1 “$2 $3”

  • syslog_level

    Severity Level Keyword Description

    0 emergencies  System unusable
    1 alerts Immediate action required
    2 critical Critical condition
    3 errors Error conditions
    4 warnings Warning conditions
    5 notifications Normal but significant conditions
    6 informational Informational messages
    7 debugging Debugging messages

  • msmtp conf

    msmtp conf

    如果是手动安装的话,是通过nano ~/.msmtprc文件配置的

    defaults
    account user
    host mail.163.com
    domain 163.com
    from [email protected]
    auth login
    user [email protected]
    password 11111111
    account default:user
    logfile /var/log/maillog

    account default logfile .msmtp.log #日志文件,可用touch创建此文件
    host smtp.163.com
    from [email protected]
    auth login #改为logon会出现错误
    user kpshare
    password ******
    测试: msmtp [email protected] good ctrl+d
    3.
    配置esmtp(如果选择esmtp工具发送邮件,则需要
    配置此项)
    1)进入当前主目录(/root),创建.esmtprc和.emsmtp.log,可用touch .esmtprc和touch .esmtp.log命令创建
    2)chmod 600 .esmtprc #一定要改权限,否则无法使用
    3)vi .esmtprc,添加以下内容: identity [email protected] #此项一定要有,否则会运行错误,网上有些参考资料就没有写此项 hostname smtp.163.com:25 #端口号一定要写 username “kpshare” password “******” mda=”/usr/bin/procmail -d %T”
    4.设置mutt
    1)进入当前主目录(/root),创建.muttrc,可用touch .muttrc命令创建
    2)vi .muttrc,添加以下内容: #以下两行任选一个 set sendmail = “/usr/local/bin/msmtp -v -X ~/.msmtplog” #指定msmtp发送邮件 set sendmail = “/usr/local/bin/esmtp -v -X ~/.esmtplog” #指定esmtp发送邮件 set fast_reply = yes #在回复邮件的时候,不用自己输入地址和标题 set folder = ~/Mail #邮件存放目录 set include = yes #回信时是否包含原文 my_hdr From: kpshare<[email protected]> #这俩行一定要写,否则你的信件会以 my_hdr Reply-To: kpshare<[email protected]> #root@localhost这样的地址发送出去,

  • nomachine

    nomachine

    nomachine nx server

    ubuntu
    http://64.34.161.181/download/3.5.0/Linux/nxclient_3.5.0-7_i386.deb
    http://64.34.161.181/download/3.5.0/Linux/nxnode_3.5.0-7_i386.deb
    http://64.34.161.181/download/3.5.0/Linux/FE/nxserver_3.5.0-9_i386.deb

    sudo dpkg -i nxclient_3.5.0-7_i386.deb&&sudo dpkg -i nxnode_3.5.0-7_i386.deb &&sudo dpkg -i nxserver_3.5.0-9_i386.deby

    centos
    wget http://64.34.161.181/download/3.5.0/Linux/nxclient-3.5.0-7.i386.rpm
    http://64.34.161.181/download/3.5.0/Linux/nxnode-3.5.0-7.i386.rpm
    wget
    http://64.34.161.181/download/3.5.0/Linux/FE/nxserver-3.5.0-9.i386.rpm

    sudo rpm -i nxclient-3.5.0-7.i386.rpm
    sudo rpm -i nxnode-3.5.0-7.i386.rpm
    sudo rpm -i nxserver-3.5.0-9.i386.rpm

  • linux大文件夹

    du -s * | sort -nr | head