nagios监控服务器

简介:
 此平台是基于apache2.2.1+php5.3.0+nagios3.1.2+fetion2009等软件的组合搭建而出,这些软件的版本是现阶段最新的。本人经过一段时间的搭建与测试,各个功能都能够成功实现,现源于开源软件,本人却不敢独享,现把搭建与配置过程介绍如下:
一、服务器端的设置
1、下载需求软件:
nagios主程序:
nagios插件程序:
apache程序:
php程序:
libACE程序:
fetion机器人程序:
2、软件的安装
(1) apache的安装
[root@localhost httpd-2.2.11]#  ./configure --prefix=/usr/local/apache --enable-so 
[root@localhost httpd-2.2.11]#  make && make install
(2) php的安装
[root@localhost php-5.2.10]#  ./configure --prefix=/usr/local/php    \ 
>    --with-apxs2=/usr/local/apache/bin/apxs 
[root@localhost php-5.2.10]#  make  && make install 
[root@localhost php-5.2.10]#  cp php.ini-dist /usr/local/lib/php.ini 
[root@localhost php-5.2.10]#  vi /usr/local/apache/conf/httpd.conf
    为了配置文件的工整,在配置文件的相关地方加入如下配置:
LoadModule php5_module modules/libphp5.so (如果有,不用加)
AddType application/x-httpd-php .php .html 
找到DirectoryIndex index.html 
改为: DirectoryIndex index.php index.html 
在最后加入nagios的访问目录:
ScriptAlias /nagios/cgi-bin /usr/local/nagios/sbin 
<Directory "/usr/local/nagios/sbin"> 
AuthType Basic 
Options ExecCGI 
AllowOverride None 
Order allow,deny 
Allow from all 
</Directory> 
Alias /nagios /usr/local/nagios/share 
<Directory "/usr/local/nagios/share"> 
AuthType Basic 
Options None 
AllowOverride None 
Order allow,deny 
Allow from all 
</Directory> 
请输入内容
(3) nagios的安装
    为了支持Nagios安装完后status map,trend等完全显示,需要gd库的支持,首先看一下gd与gd-devel有没有安装
InBlock.gif[root@localhost php-5.2.10]# rpm -qa|grep gd 
InBlock.gifgdb-6.5-37.el5 
InBlock.giflibgdiplus-1.2.5-1.el5.centos 
InBlock.gifgd-2.0.33-9.4.el5_1.1 
InBlock.gifgdbm-1.8.0-26.2.1 
InBlock.gifsysklogd-1.4.1-44.el5 
InBlock.giflibgdiplus-devel-1.2.5-1.el5.centos 
InBlock.gifgd-devel-2.0.33-9.4.el5_1.1
    如果没有,请拿出光盘安装上,或者用yum -y install gd*安装也可
InBlock.gif[root@localhost nagios-3.1.2]# useradd nagios 
InBlock.gif[root@localhost nagios-3.1.2]#
./configure --prefix=/usr/local/nagios \ 
InBlock.gif> --with
-gd-lib=/usr/lib --with-gd-inc=/usr/include --with-nagios-user=nagios \ 
InBlock.gif> --with-nagios-group=nagios

InBlock.gif[root@localhost nagios-3.1.2]#make all 
InBlock.gif[root@localhost nagios-3.1.2]#make install 
InBlock.gif[root@localhost nagios-3.1.2]#make install-init
InBlock.gif[root@localhost nagios-3.1.2]#make install-commandmode
InBlock.gif[root@localhost nagios-3.1.2]#make install-config
(4) nagios-plugin的安装
InBlock.gif[root@localhost nagios-plugins-1.4.13]#  ./configure --prefix=/usr/local/nagios 
InBlock.gif[root@localhost nagios-plugins-1.4.13]# make && make install
(5) 飞信机器人的安装
    在安装飞信之前需要在/usr/lib目录下加上libACE库文件,以便使飞信能够正常使用
InBlock.gif[root@localhost src]#tar zxvf library_linux.tar.gz
InBlock.gif[root@localhost src]#mv libACE* libcrypto.so.0.9.8 libssl.so.0.9.8  /usr/lib
    好了,现在来正式安装飞信
InBlock.gif[root@localhost src]#tar zxvf fetion20090406003-linux.tar.gz 
InBlock.gif[root@localhost src]#mv install /usr/local/fetion 
InBlock.gif[root@localhost src]#chmod -R 755 /usr/local/fetion 
InBlock.gif[root@localhost src]#chown -R nagios:nagios /usr/local/fetion
    测试飞信能否成功发送短信(发送对象需是自己飞信好友):
InBlock.gif[root@localhost src]#  /usr/local/fetion/fetion --mobile=137*** --pwd=*** \ 
InBlock.gif> --to=136*** --msg-utf8="test"
    如果136***能成功收到137***的短信就是正常的哟,如果不能成功看日志。
3、nagios的配置
    首先讲一下,我建有host(主机),hostgroup(主机组),contact(联系人),contactgroup(联系人组),分别讲一下它们的相关情况:
host包含:TH-02,VH-178,VH-132,MH-110,MH-13
hostgroup包含:TG(别名:testgroup) , VG(别名:virtualgroup),MG(别名:maintaingroup);TG包括主机:TH-02,VG包括主机:VH-132,VH-178,MG包括主机:MH-110,MH-13
contact包含:WSP,HW,ZY
contactgroup包含:testers,virtualers,maintainers;testers包含用户:WSP,virtualers包含用户:WSP和HW,maintainers包含用户:ZY
    为了直观起见,请看下图,
200907281248768617718.jpg
    好了,有了大致模块以后,现在我们正式开始配置nagios吧
(1) host的编辑与添加
    为了灵活使用,我们直接进入/usr/local/nagios/etc/objects目录下面,
InBlock.gif[root@localhost src]#cd /usr/local/nagios/etc/objects/
InBlock.gif[root@localhost objects]# vi hosts.cfg
########################################################################## 
InBlock.gif### Define whole host for all the machines
InBlock.gif
InBlock.gif
InBlock.gif# Define testgroup host for the testers machine
InBlock.gif
InBlock.gifdefine host{ 
InBlock.gif                host_name                             TH-02 
InBlock.gif                alias                                   testhost02 
InBlock.gif                max_check_attempts                 5 
InBlock.gif                contact_groups                    testers 
InBlock.gif                address                             60.191.*.* 
InBlock.gif                } 

InBlock.gif
InBlock.gif
InBlock.gif# Define virtualgroup host for the virtualers machine
InBlock.gif
InBlock.gifdefine host{ 
InBlock.gif  host_name    VH-178 
InBlock.gif  alias      Virutalhost178 
InBlock.gif  max_check_attempts     5    
InBlock.gif  contact_groups    virtualers 
InBlock.gif  address      *.*.*.178 
InBlock.gif  } 
InBlock.gif
InBlock.gifdefine host{ 
InBlock.gif  host_name    VH-132 
InBlock.gif  alias      Virtualhost132 
InBlock.gif  max_check_attempts  5 
InBlock.gif  contact_groups    virtualers 
InBlock.gif  address      *.*.*.132 
InBlock.gif  } 
InBlock.gif
InBlock.gif# Define maintaingroup host for the maintainers machine 
InBlock.gif
InBlock.gifdefine host{ 
InBlock.gif  host_name    MH-110 
InBlock.gif  alias      maintainhost110 
InBlock.gif  max_check_attempts  5 
InBlock.gif  contact_groups    maintainers 
InBlock.gif  address      *.*.*.110 
InBlock.gif  } 
InBlock.gif
InBlock.gifdefine host{ 
InBlock.gif  host_name    MH-13 
InBlock.gif  alias      maintainhost13 
InBlock.gif  max_check_attempts  5 
InBlock.gif  contact_groups    maintainers 
InBlock.gif  address      *.*.*.13 
InBlock.gif  } 
InBlock.gif

InBlock.gif
InBlock.gif############################################################################## 
InBlock.gif### Define all hostgroup for the whole machine 
InBlock.gif
InBlock.gif
InBlock.gif# Define testgroup 
InBlock.gif
InBlock.gifdefine hostgroup{ 
InBlock.gif                hostgroup_name         TG 
InBlock.gif                alias                     testgroup 
InBlock.gif                members                 TH-02 
InBlock.gif                } 

InBlock.gif
InBlock.gif# Define virtualgroup
InBlock.gif
InBlock.gifdefine hostgroup{ 
InBlock.gif  hostgroup_name  VG 
InBlock.gif  alias    virtualgroup 
InBlock.gif  members    VH-178,VH-132 
InBlock.gif  } 

InBlock.gif
InBlock.gif# Define maintaingroup 
InBlock.gif
InBlock.gifdefine hostgroup{ 
InBlock.gif  hostgroup_name  MG 
InBlock.gif  alias    maintaingroup 
InBlock.gif  members    MH-110,MH-13 
InBlock.gif  } 

InBlock.gif
InBlock.gif############################################################################# 
InBlock.gif### SERVICE DEFINITIONS 
InBlock.gif
InBlock.gif
InBlock.gif# Define a service to "ping" the whole machine
InBlock.gif
InBlock.gifdefine service{ 
InBlock.gif                host_name            TH-02,VH-178,VH-132,MH-110 
InBlock.gif                service_description             PING 
InBlock.gif                is_volatile                             0    
InBlock.gif                check_period                         24x7 
InBlock.gif                max_check_attempts                 1    
InBlock.gif                normal_check_interval             1    
InBlock.gif                retry_check_interval                 1    
InBlock.gif                notification_options                 w,u,c,r    
InBlock.gif                notification_interval             1    
InBlock.gif                notification_period                 24x7    
InBlock.gif                check_command   check_ping!100.0,20%!500.0,60%
                  }

InBlock.gif# Define a service to "HTTP" the whole machine 
InBlock.gif
InBlock.gifdefine service{ 
InBlock.gif                host_name         H-02,VH-178,VH-132,MH-13,MH-110
                 service_description             HTTP 
InBlock.gif                is_volatile                             0 
InBlock.gif                check_period                         24x7 
InBlock.gif                max_check_attempts                 1 
InBlock.gif                normal_check_interval             1 
InBlock.gif                retry_check_interval                 1 
InBlock.gif                notification_options                 w,u,c,r 
InBlock.gif                notification_interval             1 
InBlock.gif                notification_period                 24x7 
InBlock.gif                check_command                   check_http 
InBlock.gif                notifications_enabled                0 
InBlock.gif                } 
    service 可以根据自己的需要加的,我这里只对HTTP与PING来作阐述的。
(2) contacts.cfg的编辑
InBlock.gif############################################################################### 
InBlock.gif# CONTACTS.CFG - SAMPLE CONTACT/CONTACTGROUP DEFINITIONS 
InBlock.gif
InBlock.gif# Last Modified: 05-31-2007 
InBlock.gif
InBlock.gif# NOTES: This config file provides you with some example contact and contact 
InBlock.gif#                group definitions that you can reference in host and service 
InBlock.gif#                definitions. 
InBlock.gif#                
InBlock.gif#                You don't need to keep these definitions in a separate file from your 
InBlock.gif#                other object definitions.    This has been done just to make things 
InBlock.gif#                easier to understand. 
InBlock.gif

InBlock.gif############################################################################### 
InBlock.gif
InBlock.gif
InBlock.gif
InBlock.gif############################################################################### 
InBlock.gif############################################################################### 
InBlock.gif
InBlock.gif# CONTACTS 
InBlock.gif

InBlock.gif############################################################################### 
InBlock.gif############################################################################### 
InBlock.gif### Define contact information for all the contacter 
InBlock.gif
InBlock.gif
InBlock.gif# Define contact information for WSP
InBlock.gif
InBlock.gifdefine contact{ 
InBlock.gif                contact_name         WSP 
InBlock.gif                use                generic-contact    
InBlock.gif                alias                  WY-wsp 
InBlock.gif                service_notification_commands    notify-service-by-email,service-notify-by-fei
InBlock.gif                host_notification_commands        notify-host-by-email,host-notify-by-fei 
InBlock.gif                email                                         
wsp@wy.cn
InBlock.gif                pager                                          150*** 
InBlock.gif                } 

InBlock.gif
InBlock.gif# Define contact information for HW

InBlock.gifdefine contact{ 
InBlock.gif                contact_name           HW 
InBlock.gif                use                generic-contact    
InBlock.gif                alias                    WY-hw 
InBlock.gif                service_notification_commands   notify-service-by-email,service-notify-by-fei 
InBlock.gif                host_notification_commands      notify-host-by-email,host-notify-by-fei 
InBlock.gif                email                                         
hewei@wy.cn
InBlock.gif                pager                                           135*** 
InBlock.gif                } 

InBlock.gif
InBlock.gif# Define contact information for ZY

InBlock.gifdefine contact{ 
InBlock.gif                contact_name                 ZY 
InBlock.gif                 use                     generic-contact    
InBlock.gif                alias                           WY-zy 
InBlock.gif                service_notification_commands   notify-service-by-email,service-notify-by-fei 
InBlock.gif                host_notification_commands       notify-host-by-email,host-notify-by-fei 
InBlock.gif                email                                         zy@wy.cn 
InBlock.gif                pager                                           150*** 
InBlock.gif                } 

InBlock.gif
InBlock.gif
InBlock.gif############################################################################### 
InBlock.gif############################################################################### 
InBlock.gif
InBlock.gif# CONTACT GROUPS 
InBlock.gif

InBlock.gif############################################################################### 
InBlock.gif############################################################################### 
InBlock.gif### Define contact group for all ther whole contacter 
InBlock.gif
InBlock.gif# Define testers contact group 
InBlock.gif
InBlock.gifdefine contactgroup{ 
InBlock.gif                contactgroup_name              testers 
InBlock.gif                alias                            testhost contacters 
InBlock.gif                members                             WSP 
InBlock.gif                } 
InBlock.gif

InBlock.gif# Define virtualers contact group 
InBlock.gif
InBlock.gifdefine contactgroup{ 
InBlock.gif                contactgroup_name             virtualers 
InBlock.gif                alias                            virtualhost contacters 
InBlock.gif                members                            WSP,HW 
InBlock.gif                } 

InBlock.gif
InBlock.gif
InBlock.gif# Define maintainers contact group 
InBlock.gif
InBlock.gifdefine contactgroup{ 
InBlock.gif                contactgroup_name             maintainers 
InBlock.gif                alias                            maintainhost contacters 
InBlock.gif                members                                ZY 
InBlock.gif                } 

InBlock.gif
(3) commands.cfg的编辑
    为了支持飞信发短信的功能需要在此文件中添加飞信命令,以促使信息的发送,代码如下:
InBlock.gif# 'notify-host-by-fei' command definition

InBlock.gif define command { 
InBlock.gif             command_name            host-notify-by-fei ; 
InBlock.gif             command_line            /usr/local/fetion/fetion --mobile=137*** --pwd=*** --to=$CONTACTPAGER$ --msg-utf8="Host $HOSTSTATE$ alert for $HOSTNAME$! on '$LONGDATETIME$'" $CONTACTPAGER$ 
InBlock.gif             } 

InBlock.gif
InBlock.gif# 'notify-service-by-fei' command definition

InBlock.gifdefine command { 
InBlock.gif             command_name         service-notify-by-fei 
InBlock.gif             command_line         /usr/local/fetion/fetion --mobile=137*** --pwd=*** --to=$CONTACTPAGER$ --msg-utf8="$HOSTADDRESS$ $HOSTALIAS$/$SERVICEDESC$ is $SERVICESTATE$ on $LONGDATETIME$" $CONTACTPAGER$ 
InBlock.gif             }
(4) 编辑nagios.cfg
InBlock.gif为了不监控本机,现把localhost注释掉,找到此行,并且加以注释: 
InBlock.gif# cfg_file=/usr/local/nagios/etc/objects/localhost.cfg 
InBlock.gif为了使刚才编辑的文件生效,需加入一行: 
InBlock.gifcfg_file=/usr/local/nagios/etc/objects/hosts.cfg
(5) 编辑cgi.cfg
    为了保证权限能正常访问nagios的web页面,需把这些行的值改掉:
InBlock.gifauthorized_for_system_information=* 
InBlock.gifauthorized_for_configuration_information=* 
InBlock.gifauthorized_for_system_commands=nagios 
InBlock.gifauthorized_for_all_services=* 
InBlock.gifauthorized_for_all_hosts=* 
InBlock.gifauthorized_for_all_service_commands=* 
InBlock.gifauthorized_for_all_host_commands=* 
InBlock.gif*号在此表示所有用户,也可以改成相关用户,不过必须逐一添加。
    服务器端的配置基本上大致如此了。
4、启动nagios与apache服务
(1) nagios自启动
InBlock.gif[root@localhost objects]# service nagios restart 
InBlock.gifRunning configuration check...done. 
InBlock.gifStopping nagios: done. 
InBlock.gifStarting nagios: done. 
InBlock.gif[root@localhost objects]#chkconfig nagios on 
InBlock.gif[root@localhost objects]#
chkconfig --list|grep nagios 
InBlock.gifnagios     0:关闭   1:关闭   2:启用   3:启用   4:启用   5:启用   6:关闭 
(2) apache的启动
InBlock.gif[root@localhost ~]# export PATH=$PATH:/usr/local/apache/bin 
InBlock.gif[root@localhost ~]# apachectl -k start 
InBlock.gifhttpd (pid 3108) already running
注:为了让apache可以自启动,可以加入到/etc/rc.local之中。
5、测试与浏览
    在启动nagios服务之前,我们可以先测试一下是否配置有没有错误,或者你启动的时候出现错误也可以用下述命令进行测试
InBlock.gif[root@localhost ~]# /usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg    
InBlock.gifNagios 3.1.2 
InBlock.gifCopyright (c) 2009 Nagios Core Development Team and Community Contributors 
InBlock.gifCopyright (c) 1999-2009 Ethan Galstad 
InBlock.gifLast Modified: 06-23-2009 
InBlock.gifLicense: GPL 
InBlock.gifWebsite: http://www.nagios.org 
InBlock.gifReading configuration data... 
InBlock.gif     Read main config file okay... 
InBlock.gifProcessing object config file '/usr/local/nagios/etc/objects/commands.cfg'... 
InBlock.gifProcessing object config file '/usr/local/nagios/etc/objects/contacts.cfg'... 
InBlock.gifProcessing object config file '/usr/local/nagios/etc/objects/timeperiods.cfg'... 
InBlock.gifProcessing object config file '/usr/local/nagios/etc/objects/templates.cfg'... 
InBlock.gifProcessing object config file '/usr/local/nagios/etc/objects/hosts.cfg'... 
InBlock.gif     Read object config files okay... 
InBlock.gifRunning pre-flight check on configuration data... 
InBlock.gifChecking services... 
InBlock.gif                Checked 9 services. 
InBlock.gifChecking hosts... 
InBlock.gif                Checked 5 hosts. 
InBlock.gifChecking host groups... 
InBlock.gif                Checked 3 host groups. 
InBlock.gifChecking service groups... 
InBlock.gif                Checked 0 service groups. 
InBlock.gifChecking contacts... 
InBlock.gif                Checked 3 contacts. 
InBlock.gifChecking contact groups... 
InBlock.gif                Checked 3 contact groups. 
InBlock.gifChecking service escalations... 
InBlock.gif                Checked 0 service escalations. 
InBlock.gifChecking service dependencies... 
InBlock.gif                Checked 0 service dependencies. 
InBlock.gifChecking host escalations... 
InBlock.gif                Checked 0 host escalations. 
InBlock.gifChecking host dependencies... 
InBlock.gif                Checked 0 host dependencies. 
InBlock.gifChecking commands... 
InBlock.gif                Checked 26 commands. 
InBlock.gifChecking time periods... 
InBlock.gif                Checked 5 time periods. 
InBlock.gifChecking for circular paths between hosts... 
InBlock.gifChecking for circular host and service dependencies... 
InBlock.gifChecking global event handlers... 
InBlock.gifChecking obsessive compulsive processor commands... 
InBlock.gifChecking misc settings... 
InBlock.gifTotal Warnings: 0 
InBlock.gifTotal Errors:     0 
    呵呵,没有错误,可能您在配置之前或多或少会出现问题的,根据相关错误提示,逐一排查,相信您定会成功的。
    现在我们打开nagios的web页面,输入: http://***.com/nagios样例
    先看map页面,大致页面如下
200907281248771539984.jpg
    再看hosts相关链接页面:
200907281248771589437.jpg
    最后,我们再看一下hostgroups页面:
200907281248771655953.jpg
二、客户端的配置:
1、需求软件的下载:
nagios插件程序:
nrpe软件:
2、软件的安装
(1) nagios插件的安装:
    首先在安装前建立nagios用户,命令如下:
InBlock.gif[root@yibaner src]# useradd nagios -s /sbin/nologin -M 
InBlock.gif[root@yibaner src]# tar zxvf nagios-plugins-1.4.13.tar.gz 
InBlock.gif[root@yibaner src]# cd nagios-plugins-1.4.13 
InBlock.gif[root@yibaner nagios-plugins-1.4.13]# ./configure --prefix=/usr/local/nagios 
InBlock.gif[root@yibaner nagios-plugins-1.4.13]# make && make install 
InBlock.gif[root@yibaner nagios-plugins-1.4.13]# chown -R nagios.nagios /usr/local/nagios/
(2) nrpe的程序的安装:
InBlock.gif[root@yibaner src]# tar zxvf nrpe-2.12.tar.gz 
InBlock.gif[root@yibaner nrpe-2.12]# cd nrpe-2.12 
InBlock.gif[root@yibaner nrpe-2.12]# ./configure 
InBlock.gif[root@yibaner nrpe-2.12]# make all 
InBlock.gif[root@yibaner nrpe-2.12]# make install-plugin 
InBlock.gif[root@yibaner nrpe-2.12]# make install-daemon 
InBlock.gif[root@yibaner nrpe-2.12]# make install-daemon-config
(3) 修改nrpe.cfg配置文件:
InBlock.gif[root@yibaner nrpe-2.12]# vi /usr/local/nagios/etc/nrpe.cfg 
InBlock.gif将server_address的值修改为本机的IP地址:
InBlock.gifserver_address=*.*.*.110 
InBlock.gif将allowed_hosts的值修改为远程监控服务器的IP地址: 
InBlock.gifallowed_hosts=*.*.*.27
(4) 运行nrpe服务:
InBlock.gif[root@yibaner nrpe-2.12]# /usr/local/nagios/bin/nrpe -c /usr/local/nagios/etc/nrpe.cfg -d
(5) 查看nrpe运行情况:
InBlock.gif[root@yibaner nrpe-2.12]# netstat -nap | grep nrpe 
tcp   0    0    *.*.*.110:5666    0.0.0.0:*   LISTEN     3538/nrpe    
InBlock.gif从上述情况来看,nrpe成功运行,并且占用了5666端口
(6) 设置nrpe自启动:
InBlock.gif[root@yibaner nrpe-2.12]#vi /etc/rc.local 
InBlock.gif在其中加中此行:
InBlock.gif/usr/local/nagios/bin/nrpe -c /usr/local/nagios/etc/nrpe.cfg -d
(7) 在监控服务器端测试被监控服务器是否正常运行
InBlock.gif[root@localhost src]# telnet *.*.*.110 5666

    测试如果一切正常,整个配置过程全部告一段落,只需到监控服务器中设置对被监控服务器的所需服务的监控即可。

注:It appears as though you do not have permission to view information for any of the hosts you requested...
If you believe this is an error, check the HTTP server authentication requirements for accessing this CGI
and check the authorization options in your CGI configuration file.

出现此错误 ,可能是没有编辑 cgi.cfg,  或者 不按照以上写的来编辑cgi.cfg配置文件的话,直接修改里面的一个参数:
use_authentication=1  默认为1,改为0即可
我想增加一个用户,要怎么设置? 前面都是按照上面写的设置的

可以试一下这个命令htpasswd /usr/local/nagios/etc/htpasswd.users <username>

第一步:
/usr/local/apache/bin/htpasswd /usr/local/nagios/etc/htpasswd.users 用户名称
第二步:
在httpd.conf中写成下面这样:
ScriptAlias /nagios/cgi-bin "/usr/local/nagios/sbin"
<Directory "/usr/local/nagios/sbin">
AuthType Basic
Options ExecCGI
AllowOverride None
Order allow,deny
Allow from all
AuthName "Nagios Access"
AuthUserFile /usr/local/nagios/etc/htpasswd.users
Require valid-user
</Directory>
Alias /nagios "/usr/local/nagios/share"
<Directory "/usr/local/nagios/share">
AuthType Basic
Options None
AllowOverride None
Order allow,deny
Allow from all
AuthName "Nagios Access"
AuthUserFile /usr/local/nagios/etc/htpasswd.users
Require valid-user
</Directory>


本文转自 佛哒 51CTO博客,原文链接:http://blog.51cto.com/fodaa/1373403,如需转载请自行联系原作者
相关文章
|
26天前
|
存储 弹性计算 运维
自动化监控和响应ECS系统事件
阿里云提供的ECS系统事件用于记录云资源信息,如实例启停、到期通知等。为实现自动化运维,如故障处理与动态调度,可使用云助手插件`ecs-tool-event`。该插件定时获取并转化ECS事件为日志存储,便于监控与响应,无需额外开发,适用于大规模集群管理。详情及示例可见链接文档。
|
27天前
|
监控 应用服务中间件
Nagios 服务器 Nrpe 配置
Nagios服务器需安装NRPE并定义监控命令于`command.cfg`中。示例配置如下:`check_nrpe -H $HOSTADDRESS$ -c $ARG1$`。客户端配置文件如`192.168.149.128.cfg`可引用NRPE配置的命令,如`check_nrpe!check_load`以监控负载。监控HTTP关键词使用`check_http`命令加参数,如`-I`指定IP,`-u`指定URL,`-s`指定关键词,可在`command.cfg`中定义如`check_http_word`命令,并在主机配置文件中引用。
44 13
|
1月前
|
存储 监控 Linux
监控Linux服务器
详细介绍了如何监控Linux服务器,包括监控CPU、内存、磁盘存储和带宽的使用情况,以及使用各种系统监控工具如vmstat、iostat、sar、top和dstat来分析系统性能,并推荐了一些开源监控系统。
32 0
监控Linux服务器
|
2月前
|
Prometheus 监控 Cloud Native
Web服务器的日志分析与监控
【8月更文第28天】Web服务器日志提供了关于服务器活动的重要信息,包括访问记录、错误报告以及性能数据。有效地分析这些日志可以帮助我们了解用户行为、诊断问题、优化网站性能,并确保服务的高可用性。本文将介绍如何使用日志分析和实时监控工具来监测Web服务器的状态和性能指标,并提供具体的代码示例。
165 0
|
2月前
|
监控 Linux 测试技术
|
5月前
|
弹性计算 监控 安全
【阿里云弹性计算】ECS实例监控与告警系统构建:利用阿里云监控服务保障稳定性
【5月更文挑战第23天】在数字化时代,阿里云弹性计算服务(ECS)为业务连续性提供保障。通过阿里云监控服务,用户可实时监控ECS实例的CPU、内存、磁盘I/O和网络流量等指标。启用监控,创建自定义视图集中显示关键指标,并设置告警规则(如CPU使用率超80%),结合多种通知方式确保及时响应。定期维护和优化告警策略,利用健康诊断工具,能提升服务高可用性和稳定性,确保云服务的卓越性能。
217 1
|
5月前
|
运维 监控 Linux
提升系统稳定性:Linux服务器性能监控与故障排查实践深入理解与实践:持续集成在软件测试中的应用
【5月更文挑战第27天】在互联网服务日益增长的今天,保障Linux服务器的性能和稳定性对于企业运维至关重要。本文将详细探讨Linux服务器性能监控的工具选择、故障排查流程以及优化策略,旨在帮助运维人员快速定位问题并提升系统的整体运行效率。通过实际案例分析,我们将展示如何利用系统资源监控、日志分析和性能调优等手段,有效预防和解决服务器性能瓶颈。
|
26天前
|
Cloud Native Java 编译器
将基于x86架构平台的应用迁移到阿里云倚天实例云服务器参考
随着云计算技术的不断发展,云服务商们不断推出高性能、高可用的云服务器实例,以满足企业日益增长的计算需求。阿里云推出的倚天实例,凭借其基于ARM架构的倚天710处理器,提供了卓越的计算能力和能效比,特别适用于云原生、高性能计算等场景。然而,有的用户需要将传统基于x86平台的应用迁移到倚天实例上,本文将介绍如何将基于x86架构平台的应用迁移到阿里云倚天实例的服务器上,帮助开发者和企业用户顺利完成迁移工作,享受更高效、更经济的云服务。
将基于x86架构平台的应用迁移到阿里云倚天实例云服务器参考
|
24天前
|
编解码 前端开发 安全
通过阿里云的活动购买云服务器时如何选择实例、带宽、云盘
在我们选购阿里云服务器的过程中,不管是新用户还是老用户通常都是通过阿里云的活动去买了,一是价格更加实惠,二是活动中的云服务器配置比较丰富,足可以满足大部分用户的需求,但是面对琳琅满目的云服务器实例、带宽和云盘选项,如何选择更适合自己,成为许多用户比较关注的问题。本文将介绍如何在阿里云的活动中选择合适的云服务器实例、带宽和云盘,以供参考和选择。
通过阿里云的活动购买云服务器时如何选择实例、带宽、云盘
|
22天前
|
弹性计算 运维 安全
阿里云轻量应用服务器和经济型e实例区别及选择参考
目前在阿里云的活动中,轻量应用服务器2核2G3M带宽价格为82元1年,2核2G3M带宽的经济型e实例云服务器价格99元1年,对于云服务器配置和性能要求不是很高的阿里云用户来说,这两款服务器配置和价格都差不多,阿里云轻量应用服务器和ECS云服务器让用户二选一,很多用户不清楚如何选择,本文来说说轻量应用服务器和经济型e实例的区别及选择参考。
阿里云轻量应用服务器和经济型e实例区别及选择参考
下一篇
无影云桌面