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

Tags:

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

Tags:

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

Alternatively:

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

example-client.py source code

View graphite data

goto your graphite site

Delete graphite data

Some wonderful Graphite dashboards

Tags:

1

JMX monitoring

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

# JMX monitoring

dataflow

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

References

Suppressing paramiko log

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

Suppressing paramiko log

Backup paramiko source file.

Modify paramiko/util.py.

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.

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

Note:
    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.

Note:
    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”
    Add_a_Single_Device-1
  • Input items
    Add_a_Single_Device-2
  • 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

Add_Device_Class

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

Value:

  • 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

Value:

  • 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.

Custom_Python_Script

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

Send report email

Add it into crontab

References:

Tags: , ,

CentOS安装与使用ipmitool

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

CentOS安装与使用ipmitool

ipmitoool可以方便的查看设备硬件状态,建议设备在安装好系统后安装一下ipmitool

安装方法:

安装程序包

添加ipmi module

查看module是否成功添加

查看系统事件日志命令

清理系统事件日志命令

Tags:

手动升级wordpress的方法

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

手动升级wordpress的方法

进入到wordpress的后台管理发现有新版本更新时,使用系统自带的自动更新,总是出现300秒超时导致升级失败。

Downloading update from http://wordpress.org/wordpress-3.1.1.zip…
Download failed.: Operation timed out after 300 seconds with 1340586 bytes received
Installation Failed

使用terminal登陆到系统使用wget测试下载速度,发现服务器下载wordpress包的速度其慢无比,每秒只有3KB左右的速度。

解决方法:

首先进入webserver的跟目录,然后手工下载wordpress的安装包,之后修改/etc/hosts的内容把wordpress.org的地址指到本地。

之后再使用wordpress的自动升级,就可以成功了^_^。

Downloading update from http://wordpress.org/wordpress-3.1.1.zip…
Unpacking the update…
Verifying the unpacked files…
Installing the latest version…
Upgrading database…
WordPress updated successfully
Go to Dashboard

升级成功后再把/etc/hosts再修改回来。

Tags:

Cacti配置流程

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

# Cacti配置流程

Cacti是一个简单直观的监控工具,后台使用rrdtool记录监控数据,虽然功能较少,但是图形显示效果比较好看、直观、配置也比较方便,当需要有复杂的监控需求时,可以使用zabbix或者nagios来做。

这里主要讲的是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”
      选中所有复选框后点击”Create”,完成生成图像的设置
    4. 设置图像数
      点击面板左侧的”Graph Trees” –> “Add”,输入name后”Create” –> “Save”
    5. 把设备添加到心的图像树中
      在”Devices”中选中刚加入的设备选择
      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”即可
      点击”Create”后进行图像的权限设置。
      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”。
      到这里Cacti的配置已经完成”Logout”后使用新加的用户登陆即可查看设备的监控信息。

Tags: ,

Linux安装与配置Snmpd

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

Linux安装与配置Snmpd

下面是两个主流的Linux,CentOS与Ubuntu的snmpd安装与自动配置脚本

Script on CentOS

Script on Unbuntu

Tags: ,

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

.