月度归档:2014年11月

Nagios nrpe and sudo: “NRPE: Unable to read output”

On CentOS 5 (and RedHat EL as well), you can encounter the following behaviour when configuring an nrpe plugin with sudo:

[andrea@feyd ~]$ /usr/lib/nagios/plugins/check_nrpe -H 1.2.3.4 -c check_md_raid
NRPE: Unable to read output


Given that check_md_raid is defined as follows, in nrpe.conf:

command[check_md_raid]=sudo /usr/local/bin/nagios_check_md_raid

And given (for completeness) its relative /etc/sudoers line as follows:

nagios ALL=(ALL) NOPASSWD:/usr/local/bin/nagios_check_md_raid

Then the problem is in the requiretty options in /etc/sudoers, enabled by default on CentOS. Simply comment it as follows:

#Defaults requiretty

After that the plugin should work as expected:

[andrea@feyd ~]$ /usr/lib/nagios/plugins/check_nrpe -H 1.2.3.4 -c check_md_raid
RAID OK: All arrays OK [1 array checked]

MTR

What is MTR?

mtr combines the functionality of the ‘traceroute’ and ‘ping’ programs in a single network diagnostic tool.

As mtr starts, it investigates the network connection between the host mtr runs on and a user-specified destination host. After it determines the address of each network hop between the machines, it sends a sequence ICMP ECHO requests to each one to determine the quality of the link to each machine. As it does this, it prints running statistics about each machine. For a preview take a look at the screenshots. 继续阅读

monitor Dell Powerconnect 62xx with cacti

1.Powerconnect 6224的snmp配置

console#show snmp

console#configure

console(config)#snmp-server community public ro ipaddress 192.168.10.247          (这里的192.168.10.247为cacti服务器地址)

  console(config)#snmp-server contact virtualnet

  console(config)#snmp-server location DELL_6224

  到此,交换机上的配置已经完全,然后在cacti服务器上进行测试

  snmpwalk -On -c public -v 2c 10.10.10.2        (这里的10.10.10.2为交换机地址,如果snmp正常的话,应该能看到很多信息) 继续阅读

基于LVS的互联网应用架设攻略

可扩展、高可用服务网络设计方案实现技术细节。

网络环境

1、 硬件:服务器、网络附属存储(NAS)和交换机。3个服务器用来做web,2个服务器
来做流媒体,1个服务器做LVS-DR,2个mysql服务器,一个邮件服务器,2个交换机,一个NETAPP NAS。
2、 运行环境:流媒体windows,其他的都是linux。
3、 逻辑结构:除数据库服务器和NETAPP存储外,其他的服务器都使用2个网络地址,一个公网地址和一个私有网络地址。设置为公网ip的网络接口连接在一个交换机,设置为私有网络ip的网络接另外一个交换机,处于安全和网络带宽考虑,网络存储设备和数据库只使用私有网络地址。网络拓扑图如下所示:

基本原理

传统模式下,用户的访问请求通过DNS服务器解析后,把服务请求转发给web服务器,取得数据后返回给用户。这种模式有2个麻烦:同时访问的用户增加到某个程度后,服务器不能提供所需的正常访问;遇到故障,所有的访问请求都将失败。要解决这样一个难题,LVS是上上之选。当我们采用lvs方案之后,更改dns服务器的记录,这样用户的访问将首先到达LVS控制器所在的服务器,LVS把请求按照某种算法转发给后面真正的服务器。那么数据的返还是怎样的一个过程呢?在采用DR方式的集群形式下,真实服务器直接把数据返还给用户而不再经过LVS控制器。访问数据的流向在上图中用带箭头的虚线标识出来了,这样设计使得结构更简单一些,lvs控制器的压力也小很多。 继续阅读

在Linux下构造高性能、高可用、高可伸缩性的服务集群

简介: 随着Internet技术的迅猛发展,网络技术、性能的不断提高,高可伸缩性、高可用性、可管理性、价格有效性的网络服务技术将成为网络服务技术的主导。各种平台下的技术方案应运而生。本文试图以一篇完整的理论+实践性的文字来介绍如何在优秀的开源操作系统Linux下创建低成本、高性能、高可用的服务集群系统。文中所使用的系统和软件包均为最新版本。希望通过对本文的阅读能使你对如何创建Linux下的集群系统有所帮助。 继续阅读

HOW TO:如何在 Windows 中配置 IPSec 隧道

您可以在隧道模式中使用“IP 安全”(IPSec) 来封装“Internet 协议”(IP) 数据包,而且可以选择将它们加密。在 Windows Server 2003 中使用 IPSec 隧道模式(有时称为“纯 IPSec 隧道”)的主要原因是为了能够与那些不支持“第 2 层隧道协议”(L2TP)/IPSec 或 PPTP 虚拟专用网络 (VPN) 隧道技术的非 Microsoft 路由器或网关进行互操作。
Windows Server 2003 在隧道的两个终结点都有静态 IP 地址的情况下支持 IPSec 隧道。这主要适用于网关到网关的情形。不过,它也可以在网关或路由器与服务器之间的专用网络安全方案中使用。(例如,一个 Windows Server 2003 路由器,它从其外部接口将通信流路由到一台基于 Windows Server 2003 的内部计算机,该计算机通过建立一条到为外部客户端提供服务的内部服务器的 IPSec 隧道来保护内部路径的安全)。

不支持将 Windows Server 2003 IPSec 隧道用于客户端远程访问 VPN,因为目前“Internet 工程任务组 (IETF) IPSec 请求注释 (RFC)”没有在“Internet 密钥交换”(IKE) 协议中为客户端到网关的连接提供远程访问解决方案。IETF RFC 2661“第 2 层隧道协议”(L2TP) 是由 Cisco、Microsoft 和其他公司为提供客户端远程访问 VPN 连接而专门开发的。在 Windows Server 2003 中,使用自动生成的 IPSec 策略来保护客户端远程访问 VPN 连接,此策略在 L2TP 隧道类型被选中时使用 IPSec 传输模式(不是隧道模式)。

Windows Server 2003 IPSec 隧道也不支持协议和端口特定的隧道。虽然 Microsoft 管理控制台 (MMC) IPSec 策略管理单元十分通用,并且允许您将任何类型的筛选器与隧道关联,但您还是要确保在为隧道规则指定筛选器时只使用地址信息。

继续阅读

Moving (Resetting) the sysadmin database to a new dbspace in IBM Informix Dynamic Server (IDS)

Question
How do you move the sysadmin database to a new dbspace?

Answer

The sysadmin database is created in the root dbspace during database server initialization. This database is required for the Scheduler API and Remote Administration feature.

Use the SQL Administration API command RESET SYSADMIN to move the sysadmin database to a different dbspace. This command drops the sysadmin database from the root dbspace and recreates it in the specified dbspace. 继续阅读

Maatkit–Mysql的高级管理工具集

Maatkit是Mysql的一个高级管理工具集。 官方网站:http://www.maatkit.org/

参考:
http://www.bigheaddba.net/article/ytag/maatkit
http://code.google.com/p/maatkit/

#1安装一系列依赖软件

Perl

perl-DBI.x86_64 : A database access API for perl

perl-DBD-MySQL.x86_64 : A MySQL interface for perl

perl-TermReadKey

wget http://packages.sw.be/perl-TermReadKey/perl-TermReadKey-2.30-3.el5.rf.x86_64.rpm

rpm -ivh perl-TermReadKey-2.30-3.el5.rf.x86_64.rpm 继续阅读

在 Linux 上设置多处驻留

Linux 上设置多处驻留

您可在同一台计算机上设置多个独立的数据库服务器环境。

完成以下任务可设置多处驻留:

继续阅读

rootdbs空间不足引起的备份失败

症状1:

Informix Dynamic Server 2000 Version 9.21.UC2 for LINUX

2011-02-15 09:49:55 17296 17294 /home/informix/bin/onbar_d -b -l
2011-02-15 09:49:55 17296 17294 Begin backup logical log 147643.
2011-02-15 09:49:55 17296 17294 Successfully connected to Storage Manager.
2011-02-15 09:49:55 17296 17294 SQL -271 Could not insert new row into the table.
2011-02-15 09:49:55 17296 17294 ISAM -131 ISAM error: no free disk space
逻辑备份出现问题
2011-02-17 09:14:37 11293 11291 /home/informix/bin/onbar_d -b -l
2011-02-17 09:14:38 11293 11291 Begin backup logical log 149938.
2011-02-17 09:14:38 11293 11291 Successfully connected to Storage Manager.
2011-02-17 09:14:38 11293 11291 The logical logs are full. ON-Bar may encounter errors writing to the sysutils database.
2011-02-17 09:14:38 11293 11291 SQL -691 Missing key in referenced table for referential constraint (informix.r102_11).
2011-02-17 09:14:38 11293 11291 ISAM -111 ISAM error: no record found.
2011-02-17 09:14:38 11293 11291 SQL -691 Missing key in referenced table for referential constraint (informix.r103_16).
2011-02-17 09:14:38 11293 11291 ISAM -111 ISAM error: no record found.
2011-02-17 09:14:38 11293 11291 The logical logs are full. ON-Bar may encounter errors writing to the sysutils database.
2011-02-17 09:14:38 11293 11291 SQL -691 Missing key in referenced table for referential constraint (informix.r102_11).
2011-02-17 09:14:38 11293 11291 ISAM -111 ISAM error: no record found.
2011-02-17 09:14:38 11293 11291 /home/informix/bin/onbar_d complete, returning 148 (0x94)

经onstat -d 查询,rootdbs空间不足,而rootdbs中有被人创建了其它库表索引(估计语句中没有指定dbspace导致),清理这些索引以增加剩余空间恢复正常备份或者为rootdbs添加chunk亦可 继续阅读