2022-11-09 308
1.安装NSClient++
安装如下图所示:
2.配置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中显示如下:
以上所述是小编给大家介绍的Nagios监控Windows Server 2008配置方法,希望对大家有所帮助,如果大家有任何疑问请给我留言,小编会及时回复大家的。在此也非常感谢大家对77isp云服务器技术网的支持! 如果你觉得本文对你有帮助,欢迎转载,烦请注明出处,谢谢!原文链接:https://77isp.com/post/12655.html
=========================================
https://77isp.com/ 为 “云服务器技术网” 唯一官方服务平台,请勿相信其他任何渠道。
数据库技术 2022-03-28
网站技术 2023-01-07
网站技术 2022-11-26
网站技术 2022-11-17
Windows相关 2022-02-23
网站技术 2023-01-14
Windows相关 2022-02-16
Windows相关 2022-02-16
Linux相关 2022-02-27
数据库技术 2022-02-20
小游客游戏攻略网游戏攻略网 2024年07月26日
抠敌 2023年10月23日
嚼餐 2023年10月23日
男忌 2023年10月22日
瓮仆 2023年10月22日
扫码二维码
获取最新动态