Nagios监控Windows Server 2008配置方法
1.安装NSClient++
访问http://nsclient.org/nscp/下载NSClient++,这里我使用的是NSClient++-0.3.9-x64的msi安装包。下载之后直接安装,过程中会提示输入Nagios监控服务器地址和密码。地址填写正确,密码不用设置。Nagios监控服务器事先在监控Linux服务器时候已经搭建好,以后再和大家分享。
安装如下图所示:
2.配置NSClient++
编辑安装目录下的NES.ini文件,打开NSClient++的端口。方法为找到:
[NSClient]
;port=12489
去掉port前的“;”就可以启用12489端口。
我的是安装在服务器的program files下的NSClient++-Win32-0.3.9目录中。在cmd中执行:
cd C:\Program files\NSClient++-Win32-0.3.5
netstat -an | more
查看12489端口是否正常监听在。
因为安装时候需要的模块已经勾选了,所以配置文件中不用再作设置。否则可以通过去掉每个模块前的;来启用该模块。
到这里即完成了Windows Server 2008上的配置。接下来我们设置Nagios监控服务器。
3.Nagios监控服务器设置
vi /usr/local/nagios/etc/nagios.cfg
搜索找到:
# Definitions for monitoring a Windows machine
# cfg_file=/usr/local/nagios/etc/objects/windows.cfg
将第二行的#去掉打开Nagios监控的Windows模块,然后保存。
接着编辑
# vi /usr/local/nagios/etc/objects/windows.cfg
找到并设置监控的服务器:
define host{
use windows-server ; Inherit default values from a template
host_name winserver ; The name we're giving to this host
alias My Windows Server ; A longer name associated with the host
address 192.168.0.2 ; IP address of the host
}
设置被监控主机名和被监控的Windows服务器地址。
接下来搜索各种监控的服务并设置:
# Create a service for monitoring the version of NSCLient++ that is installed
# Change the host_name to match the name of the host you defined above
define service{
use generic-service
host_name winserver
service_description NSClient++ Version
check_command check_nt!CLIENTVERSION
}
监控NSClient版本。
# Create a service for monitoring the uptime of the server
# Change the host_name to match the name of the host you defined above
define service{
use generic-service
host_name winserver
service_description Uptime
check_command check_nt!UPTIME
}
监控服务器在线时间。
# Create a service for monitoring CPU load
# Change the host_name to match the name of the host you defined above
define service{
use generic-service
host_name winserver
service_description CPU Load
check_command check_nt!CPULOAD!-l 20,30,50
}
监控服务器CPU负载。
# Create a service for monitoring memory usage
# Change the host_name to match the name of the host you defined above
define service{
use generic-service
host_name winserver
service_description Memory Usage
check_command check_nt!MEMUSE!-w 80 -c 90
}
监控服务器的内存占用。
# Create a service for monitoring C:\ disk usage
# Change the host_name to match the name of the host you defined above
define service{
use generic-service
host_name winserver
service_description C:\ Drive Space
check_command check_nt!USEDDISKSPACE!-l c -w 80 -c 90
}
监控系统C盘的磁盘占用。
部署好之后在Nagios中显示如下:
相关文章
iis 访问由于凭据无效被拒绝+请求的资源在使用中的解决方法
访问由于凭据无效被拒绝+请求的资源在使用中的解决方法2010-04-04
Windows Server2008 监控服务器性能的教程图解
这篇文章主要介绍了Windows Server2008 监控服务器性能的教程图解,本文图文并茂给大家介绍的非常详细,具有一定的参考借鉴价值,需要的朋友可以参考下2019-08-08
win server 2019服务器的iis配置以及网站的简单发布
这篇文章主要介绍了win server 2019服务器的iis配置以及网站的简单发布,文中通过示例代码介绍的非常详细,对大家的学习或者工作具有一定的参考学习价值,需要的朋友们下面随着小编来一起学习学习吧2020-02-02
Win11安装VMware Workstation Pro,Centos,Xshell,Xftp图文
这篇文章主要介绍了Win11安装VMware Workstation Pro,Centos,Xshell,Xftp(Linux学习需要),本文通过图文并茂的形式给大家介绍的非常详细,对大家的学习或工作具有一定的参考借鉴价值,需要的朋友可以参考下2023-01-01
win2003 jsp运行环境架设心得(jdk+tomcat)
这几天一直研究架设JSP服务器,之前一切都是默认安装,能成功;能看到一只猫,可真正要上线时,要实现多站点就一直404不行;不知道百度跟google将近一天都不行,看了N多网页尝试不行2012-12-12
IIS7 全新管理工具AppCmd.exe的命令使用实例分享
IIS 7 提供了一个新的命令行工具 Appcmd.exe,可以使用该工具来配置和查询 Web 服务器上的对象,并以文本或 XML 格式返回输出2013-04-04
基于Win2008 R2的WSFC实现 SQL Server 2012高可用性组(AlwaysOn Group)
SQL Server 2012高可用性组在实现过程中较之早起的SQL Server故障转移群集来讲,不依赖特别提供共享存储磁盘阵列,每个节点独立存储一份数据库的副本2013-06-06
Windows 2008任务计划执行bat脚本失败返回0x1的解决方法
这篇文章主要介绍了Windows 2008任务计划执行bat脚本失败返回0x1的解决方法,脚本之家小编一般更倾向于使用vbs来实现功能更强大与简单2020-05-05


最新评论