Binding Multiple IP Addresses on the Same Network Interface

Posted by 4Aiur on 2012/01/13 in MacOSX with Comments closed |

Binding Multiple IP Addresses on the Same Network Interface

Add new address

Remove alias address


Installing Logster on CentOS

Posted by 4Aiur on 2012/01/10 in SysAdmin with Comments closed |

# Installing Logster on CentOS

Install EPEL repository

Setting locale

Install Dependence

logcheck dependencies:

  • liblockfile
  • lockfile-progs
  • perl-IPC-Signal
  • perl-Proc-WaitStat
  • perl-mime-construct

Install logster

dry run

Add crontab


Installing and Configuring Graphite on CentOS

Posted by 4Aiur on 2012/01/10 in SysAdmin with Comments closed |

Installing and Configuring Graphite on CentOS

Install EPEL repository


Install Dependences

Install Python package management software

Install Graphite

  • carbon

    a Twisted daemon that listens for time-series data

  • whisper

    a simple database library for storing time-series data (similar in design to RRD)

  • graphite-web

    a Django webapp that renders graphs on-demand using Cairo

Configure graphite

Start the data collection daemon carbon-cache

Configure Apache VirtualHost

edit /etc/httpd/conf/httpd.conf

Test insert data to graphite

run test source code

View graphite data

goto your graphite site

Delete graphite data

Some wonderful Graphite dashboards



JMX monitoring

Posted by 4Aiur on 2012/01/09 in Default |

# JMX monitoring


Configuration jmx agent with authentication

JMX dynamically allocated random port, and it will bind the port at internal address. If you connecting jmx through firewall or your servers on Amazon EC2, maybe can’t connect to the jmx agent, So need to do some prepare.

add jmx agent parameter in your java startup script

configuration jmx authentication

build JMXAgent.class to jmx-agent.jar

Install jmxtrans on your alert server

Configuration jmxtrans

Running Jmx Transformer

View jmxtrans log

Alert script thresholds config

Alert script

Add script into crontab


Suppressing paramiko log

Posted by 4Aiur on 2011/12/26 in Python with Comments closed |

Suppressing paramiko log

Backup paramiko source file.

Modify paramiko/

Set logger name “suppress” in your code.

Tags: , ,

Zenoss Core setup guide

Posted by 4Aiur on 2011/12/16 in SysAdmin with Comments closed |

# Zenoss Core setup guide

Zenoss Core is a powerful monitoring system, and it is a OpenSource software.

Install Zenoss Core
Install ZenPacks
Setup snmp and snmpd config
Add user command
Add a single device
Add custom Device Class
Custom new class properties
Setup Processes
Custom Zenoss reports

Install Zenoss Core

Before you install:

1) Run the Yellowdog Updater, Modified (YUM), which you will use to install Zenoss. To run YUM, enter this command:

2) Download the Zenoss installation files.

3) If you have just installed MySQL, then use the following command to add MySQL into the startup sequence:

4) Enter the following command to display current run levels:

5) If the system responds with something similar to:

then enter the following command to adjust run levels:

6) Restart MySQL and set the password.

    Do not add a space between the single quotes in the following commands.

    Initially, the MySQL password must be blank so that Zenoss can correctly create the database. After you have installed and started Zenoss, you can change this password.

Install the Software

Follow these steps to install Zenoss for Red Hat Enterprise Linux 5 or CentOS 5.

1) Enter one of the following commands to install the Zenoss RPM.

2) If MySQL is running on a different server, or has a different root user password, edit the /opt/zenoss/bin/ zenoss_init_pre file and adjust the MYSQLHOST, MYSQLROOTUSER, and MYSQLROOTPASSWD values.

3) Enter this command to start Zenoss.

    This step may take several minutes.

Install ZenPacks

Setup snmp and snmpd config

add snmp.conf to zenoss server /etc/snmp/snmp.conf. snmp.conf example:

add snmpd.conf to client /etc/snmp/snmpd.conf. snmpd.conf example:

Add user command for debug snmp setting

  1. Go to http://yourhost:8080/zport/dmd/dataRootManage
  2. Click “Add User Command”
  3. Input value

Add a single device

  • Go to http://yourhost:8080/zport/dmd/itinfrastructure
  • Click “Add a Single Device”
  • Input items
  • Click “Zenoss Server”, and Click left “Configuration Properties” to edit the server’s properties
    • zSnmpVer: v3
    • zSnmpSecurityName: yourname
    • zSnmpAuthPassword: yourlonglonglonglongpassword
    • zSnmpAuthType: MD5
  • Click “Commands –> snmpwalkV3” verify server and client snmp configuration
  • Click “Actions –> Model Device”

Add custom Device Class

Custom new class properties


using zenoss portal

using zenoss manage and zendmd

1) Login to Zenoss as “admin” and go to the URL http://yourhost:8080/zport/dmd/Devices/manage
2) Click left “your new class name”, and click top “Properties”
3) To add a new property, enter a name, type and value for the new property and click the “Add” button.
Name: zCollectorPlugins
Type: lines


  • zenoss.snmp.NewDeviceMap
  • zenoss.snmp.DeviceMap
  • zenoss.snmp.InterfaceMap
  • zenoss.snmp.RouteMap
  • zenoss.snmp.IpServiceMap
  • zenoss.snmp.HRFileSystemMap
  • zenoss.snmp.HRSWInstalledMap
  • zenoss.snmp.HRSWRunMap
  • zenoss.snmp.CpuMap

Name: zDeviceTemplates
Type: lines


  • b_fping
  • Device
  • FileSystem

Name: zIcon
Type: string
Value: /zport/dmd/img/icons/server.png
Name: zSnmpAuthType
Type: string
Value: MD5
Name: zSnmpVer
Type: string
Value: v3

4) Login zendmd, change default snmp auth password

Add Custom Schema

Setup Processes

Zenoss API

Zenoss have jsonapi and xmlrpc interface, you can using it’s API to integrate your management system.
jsonapi code demo:

xmlrpc code demo:

Custom Zenoss Reports

Column syntax

buildin command:

python command:

custom python script:

Goto http://yourhost:8080/zport/dmd/Devices/manage first.


Input script name getMemUtil(), and input content like this:

Send report email

Add it into crontab


Tags: , ,


Posted by 4Aiur on 2011/06/10 in SysAdmin with Comments closed |





添加ipmi module






Posted by 4Aiur on 2011/04/06 in Default with Comments closed |



Downloading update from…
Download failed.: Operation timed out after 300 seconds with 1340586 bytes received
Installation Failed





Downloading update from…
Unpacking the update…
Verifying the unpacked files…
Installing the latest version…
Upgrading database…
WordPress updated successfully
Go to Dashboard




Posted by 4Aiur on 2011/03/16 in SysAdmin with Comments closed |

# Cacti配置流程



  1. 添加监控设备

    1. 首先需要在被监控的设备上安装与配置snmp agent,Linux平台请参考Linux安装与配置Snmpd,OpenSolaris参考OpenSolaris net-snmp install script,windows安装配置snmp agent方法

      检查是否存在SNMP Service,需要将此服务启动。我的电脑-管理-服务-SNMP Ssrvice.
      单击属性-安全,添加发送身份验证陷阱。添加在cacti中的SNMP Community,在下面添加监控端的IP地址

    2. 添加设备
      登陆Cacti后点击面板左侧的devices后点击右侧面板的Add,之后填写Description, Hostname, Host Template(Linux与Solaris使用ucd/net SNMP Host,Windows使用windows2000/xp Host), 其他部分可以使用自己的值来填写”SNMP Community”或者保持不变。配置完成后点击Create增加此设备。 在创建完毕后出现的页面中点下Query Verbose 来测试下snmp数据抓取是否正常。
      Cacti Data Query Debug

    3. 添加图像
      点击页面中的”Create Graphs for this Host”
    4. 设置图像数
      点击面板左侧的”Graph Trees” –> “Add”,输入name后”Create” –> “Save”
    5. 把设备添加到心的图像树中
      Cacti Place on a Tree
      “Place on a Tree” –> “Go” –> “Continue”,到这里设备的配置已经完成,可以点击导航栏的graphs查看新增加设备的各种监控图像,下面是我Cacti监控数据的两个截图
      Linux Traffic
      Linux Load Average
  2. 权限配置

    1. 增加新用户
      “User Management” –> “Add”,填写相应项”User Name”, “Full Name”, “Password”, “Enabled Determines if user is able to login.”这里选中”Enabled”
      权限规则”Realm Permissions”处选中”View Graphs”, “Export Data”即可
      Cacti Tree Permission
    2. 权限设置
      Tree Permissions中”Default Policy”使用”Deny”,并增加新增的图像树如下图,之后”Save”
      把”Graph Permissions (By Graph)”, “Graph Permissions (By Device)”, “Graph Permissions (By Graph Template)”后面的”Policy”修改为”Allow”,之后”Save”。

Tags: ,


Posted by 4Aiur on 2011/03/16 in Linux with Comments closed |



Script on CentOS

Script on Unbuntu

Tags: ,

Copyright © 2010-2019 4Aiur All rights reserved.
This site is using the Desk Mess Mirrored theme, v2.5, from