1、下载并安装windows插件 http://sourceforge.net/projects/nscplus/NSCP-0.4.1.73-x64.msi
2、windows端配置 nsclient.ini文件
[/modules]
;CheckWMI = 1 #注释掉该行
[/settings/default]
allowed hosts = *
;password =
port = 12489 #该行为手工添加
3、服务器端配置commands.cfg
define command{
command_name check_nt
command_line $USER1$/check_nt -H $HOSTADDRESS$ -p 12489 -v $ARG1$ $ARG2$
}
命令行参数可参考: /usr/lib/nagios/plugins/check_nt -h
4、配置hosts.cfg
define host {
host_name aaa
alias aaa
address 192.168.1.190
contact_groups ITServices
check_command check-host-alive
max_check_attempts 5
notification_interval 10
notification_period 24x7
notification_options d,u,r
}
5、配置services.cfg
#host ---aaa
define service{
host_name aaa
service_description check-host-alive
check_command check-host-alive
check_period 24x7
max_check_attempts 5
normal_check_interval 3
retry_check_interval 2
contact_groups ITServices
notification_interval 10
notification_period 24x7
notification_options w,u,c,r
}
define service{
host_name aaa
service_description CPU Load
check_command check_nt!CPULOAD!-l 5,80,90
check_period 24x7
max_check_attempts 5
normal_check_interval 3
retry_check_interval 2
contact_groups ITServices
notification_interval 10
notification_period 24x7
notification_options w,u,c,r
}
define service{
host_name aaa
service_description Memory Usage
check_command check_nt!MEMUSE!-w 80 -c 90
check_period 24x7
max_check_attempts 5
normal_check_interval 3
retry_check_interval 2
contact_groups ITServices
notification_interval 10
notification_period 24x7
notification_options w,u,c,r
}
define service{
host_name aaa
service_description OnlineTime
check_command check_nt!UPTIME
check_period 24x7
max_check_attempts 5
normal_check_interval 3
retry_check_interval 2
contact_groups ITServices
notification_interval 10
notification_period 24x7
notification_options w,u,c,r
}
define service{
host_name aaa
service_description C:\ Drive Space
check_command check_nt!USEDDISKSPACE!-l c -w 80 -c 90
check_period 24x7
max_check_attempts 5
normal_check_interval 3
retry_check_interval 2
contact_groups ITServices
notification_interval 10
notification_period 24x7
notification_options w,u,c,r
}
define service{
host_name aaa
service_description D:\ Drive Space
check_command check_nt!USEDDISKSPACE!-l d -w 80 -c 90
check_period 24x7
max_check_attempts 5
normal_check_interval 3
retry_check_interval 2
contact_groups ITServices
notification_interval 10
notification_period 24x7
notification_options w,u,c,r
}
define service{
host_name aaa
service_description W3SVC
check_command check_nt!SERVICESTATE!-d SHOWALL -l W3SVC
check_period 24x7
max_check_attempts 5
normal_check_interval 3
retry_check_interval 2
contact_groups ITServices
notification_interval 10
notification_period 24x7
notification_options w,u,c,r
}
define service{
host_name aaa
service_description Explorer
retry_check_interval 2
contact_groups ITServices
notification_interval 10
notification_period 24x7
notification_options w,u,c,r
}
define service{
host_name aaa
service_description C:\ Drive Space
check_command check_nt!USEDDISKSPACE!-l c -w 80 -c 90
check_period 24x7
max_check_attempts 5
normal_check_interval 3
retry_check_interval 2
contact_groups ITServices
notification_interval 10
notification_period 24x7
notification_options w,u,c,r
}
define service{
host_name aaa
service_description D:\ Drive Space
check_command check_nt!USEDDISKSPACE!-l d -w 80 -c 90
check_period 24x7
max_check_attempts 5
normal_check_interval 3
retry_check_interval 2
contact_groups ITServices
notification_interval 10
notification_period 24x7
notification_options w,u,c,r
}
define service{
host_name aaa
service_description W3SVC
check_command check_nt!SERVICESTATE!-d SHOWALL -l W3SVC
check_period 24x7
max_check_attempts 5
normal_check_interval 3
retry_check_interval 2
contact_groups ITServices
notification_interval 10
notification_period 24x7
notification_options w,u,c,r
}
define service{
host_name aaa
service_description Explorer
check_command check_nt!PROCSTATE!-d SHOWALL -l Explorer.exe
check_period 24x7
max_check_attempts 5
normal_check_interval 3
retry_check_interval 2
contact_groups ITServices
notification_interval 10
notification_period 24x7
notification_options w,u,c,r
}
5、重启nagios和httpd服务
6、遇见的错误:
windows下nsclient.log里有“source\nscp\trunk\include\check_nt/server/protocol.hpp:65: Rejected connection from:”,检查nsclient.ini与commands.cfg 接口是否一致
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· SQL Server 2025 AI相关能力初探
· Linux系列:如何用 C#调用 C方法造成内存泄露
· AI与.NET技术实操系列(二):开始使用ML.NET
· 记一次.NET内存居高不下排查解决与启示
· 探究高空视频全景AR技术的实现原理
· 阿里最新开源QwQ-32B,效果媲美deepseek-r1满血版,部署成本又又又降低了!
· 单线程的Redis速度为什么快?
· SQL Server 2025 AI相关能力初探
· AI编程工具终极对决:字节Trae VS Cursor,谁才是开发者新宠?
· 展开说说关于C#中ORM框架的用法!
2016-09-20 Visual C++ for Linux Development
2016-09-20 微软为Visual Studio开发助手拓展C++支持
2016-09-20 在Linux中使用VS Code编译调试C++项目
2016-09-20 Linux常见设备及相应/dev/xxx文件名、Mount Point、挂载点、Mount命令、fstab、挂载分区
2012-09-20 ORACLE OEM