Posts for: #AI

IDC预测:防泄密产品将会消失

3月中旬的时候,sowhat给我发了一段IDC的预测:

Data loss prevention (DLP) will disappear into messaging, Web, and identity management security suites. It will only remain an independent product for large enterprise customers. In this area, DLP will consolidate enterprise oversight for all communications and content. Logically, enterprise DLP will move away from point product solutions. Because customers complain about expensive, labor-intensive deployments, wizards will increasingly automate policy creation to make deployment easier and avoid false positives and negatives. Over time, DLP will incorporate enterprise rights management (ERM) and encryption for data at rest, data in motion, and data in use management of mobile devices, as well as PCs.

[阅读全文]

libfetion短信通知与nagios整合

由于安装了nagios,就比较希望服务器出现状况的时候,我能够及时收到报警信息——飞信这时就是最好的选择了。

1、激活手机上的飞信

移动飞信下载地址:http://www.fetion.com.cn/,激活后,记住密码。

2、下载编译sendsms小程序

参见BLOG:http://blog.solrex.cn/articles/diy-free-weather-forecast-sms.html

sendsms实际上用了libfetion的库:http://libfetion.cn/Linux_demoapp_download.html

感谢这两位开发者。

在编译sendsms的时候遇到了问题,提示“__stack_chk_fail_local”,在libfetion论坛上也有人问起:

http://www.libfetion.cn/bbs/viewthread.php?tid=120&extra=page%3D1

解决方法很简单,将Makefile里CPP = g++后面加上-fstack-protector即可。

使用时发现,如果用手机号码,对方可能会收不到信息(sendsms作者代码中说可能是libfetion的bug),改用fetion号码就好了。

顺便提一句,本来我是想用“飞信机器人”的:http://www.it-adv.net/。

可是在debian上一运行就出现:/lib/tls/i686/cmov/libc.so.6: version `GLIBC_2.4’ not found,放弃了。

3、配置nagios调用

编译好的sendsms我放到了/usr/local/fetion下面,同时在该目录下使用一个脚本sms.sh:

#!/bin/sh

/usr/local/fetion/sendsms -f 442103729 -p mypassword “$1”

在/usr/local/nagios/etc/objects/commands.cfg中新增:

#host notify by sms

define command {

command_name    notify-host-by-sms

command_line    /usr/local/fetion/sms.sh “Host $HOSTSTATE$ alert for $HOSTNAME$! on ‘$DATETIME$’">/dev/null 2>&1

}

#service notify by sms

define command {

command_name    notify-service-by-sms

command_line    /usr/local/fetion/sms.sh “’$HOSTADDRESS$’ $HOSTALIAS$/$SERVICEDESC$ is $SERVICESTATE$">/dev/null 2>&1

}

在/usr/local/nagios/etc/objects/contacts.cfg中将service_notification_commands和host_notification_commands都新增sms提醒项目:

service_notification_commands   notify-service-by-email,notify-service-by-sms

host_notification_commands      notify-host-by-email,notify-host-by-sms

测试:/usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg

[阅读全文]

nagios监控系统安装(1)

nagios http://www.nagios.org

完整的nagios中包含几个组成部分:

1、nagios软件本身,必须安装;

2、plugins,必须安装,是nagios用来监测远程主机运行状况的一系列小程序,安装后默认在/usr/local/nagios/libexec下;

3、npre,非必需,如果希望对机器的磁盘、进程、负载等状况进行监测并报警,那么就需要在该机器上安装;

4、ndoutils,非必需,将nagios的数据保存到mysql数据库中。

一篇不错的文章在:http://www.linuxtone.org/viewthread.php?tid=514,我学习了他的方法。

Nagios官网文档中有在Ubuntu下的安装指南,Debian基本相同:http://nagios.sourceforge.net/docs/3_0/quickstart-ubuntu.html。

我准备采用的应用程序路径都是默认的,如:

/usr/local/nginx

/usr/local/nagios

1、安装前的一些准备

安装部分软件:apt-get install build-essential libgd2-xpm-dev libssl-dev openssl libkrb5-dev

安装好web服务器,我用的是nginx,可以采用apache会更方便。

2、准备用户、用户组

/usr/sbin/useradd -m nagios

/usr/sbin/groupadd nagcmd

/usr/sbin/usermod -a -G nagcmd nagios

/usr/sbin/usermod -a -G nagcmd www-data

3、安装nagios

到http://www.nagios.org/download/download.php下载最新的Nagios和Nagios plugins。

解压后,进入nagios目录:

./configure –with-command-group=nagcmd

make all

make install

make install-init

make install-config

make install-commandmode

进入nagios plugins目录:

./configure –with-nagios-user=nagios –with-nagios-group=nagios

make

make install

4、配置nginx支持perl fcgi

nginx要支持perl fcgi,可以采用脚本perl-fcgi.pl如下:

#!/usr/bin/perl

use FCGI;

#perl -MCPAN -e ‘install FCGI’

[阅读全文]

nagios监控系统安装(2)

6、设置监控报警

需要调整的文件包括:

/usr/local/nagios/etc/objects/contacts.cfg

/usr/local/nagios/etc/objects/commands.cfg

a./usr/local/nagios/etc/objects/contacts.cfg

这里面是联系人、分组的信息,简单配置contact项目如下:

define contact{

        contact_name                    nagiosadmin

        use                             generic-contact

        service_notification_period     24x7

        host_notification_period        24x7

        service_notification_options    w,u,c,r

        host_notification_options       d,u,r

        alias                           Nagios Admin

        service_notification_commands   notify-service-by-email,notify-service-by-sms

        host_notification_commands      notify-host-by-email,notify-host-by-sms

        email                           [email protected]       ; «***** CHANGE THIS TO YOUR EMAIL ADDRESS ******

        }

b./usr/local/nagios/etc/objects/commands.cfg

这里配置了各种plugins的用法、命令等,可以好好看看这份文件,在其中做的事情包括了,定义发sms和通过邮件发报警信息,其中sms信息的细节建议参见《libfetion短信通知与nagios整合》:

#host notify by sms

define command {

command_name    notify-host-by-sms

command_line    /usr/local/fetion/sms.sh “Host $HOSTSTATE$ alert for $HOSTNAME$! on ‘$DATETIME$’">/dev/null 2>&1

}

#service notify by sms

define command {

command_name    notify-service-by-sms

command_line    /usr/local/fetion/sms.sh “$HOSTADDRESS$ $HOSTALIAS$/$SERVICEDESC$ is $SERVICESTATE$">/dev/null 2>&1

[阅读全文]

cacti监控系统安装

现在托管的服务器数量在增加,前段时间,已经不断出现各种由于系统管理水平不够,导致的服务器当机、系统不稳定等事件。

因此最近决定安装cacti和nagios这两套开源服务器监控的软件系统,对我们的服务器系统进行监控和报警。

cacti http://www.cacti.net/

这里是精简的安装指南:

http://www.cacti.net/downloads/docs/html/unix_configure_cacti.html

我在debian的安装过程如下:

1、安装辅助软件

apt-get install rrdtool snmp ttf-dejavu libmysql++-dev

2、配置web服务器和安装php

可以参照文章:http://hi.baidu.com/wulujia/blog/item/c6aba7efbb95ef11fcfa3c67.html

3、导入mysql数据库

mysqladmin -u root -p create cacti

mysql -uroot -p cacti <cacti.sql

mysql -uroot -p

mysql>grant all privileges on cacti.* to m1@localhost identified by ‘password’;

mysql> flush privileges;

4、编辑include/config.php文件,填入相关数据库信息,类似如下:

$database_type = “mysql”;

$database_default = “cacti”;

$database_hostname = “localhost”;

$database_username = “cactiuser”;

$database_password = “cacti”;

5、设置目录权限

chmod 777 rra/ log/

6、在/etc/crontab下新建一行,内容如下:

*/5 *   * * *   root    /usr/local/php-fcgi/bin/php /home/web/cacti/poller.php > /dev/null 2>&1

[阅读全文]