客户端在Windows系统中以服务方式运行,将下载的源代码放在任何目录,例如:c:\nsclient。打开命令行,执行安装服务脚本,如下:
pNSClient.exe /install
在命令行执行net start nsclient启动Nagios Agent服务。
Nagios服务端通过check_nt程序检查客户端主机状态,先将软件包的LinuxBin目录中check_nt程序复制到/usr/lib/nagios/plugins。
然后在checkcommands.cfg添加检查命令,如下:
command[check_nt_disk]=$USER1$/check_nt -H $HOSTADDRESS$ -p 1248 -v USEDDISKSPACE -l $ARG1$ -w $ARG2$ -c $ARG3$ command[check_nt_cpuload]=$USER1$/check_nt -H $HOSTADDRESS$ -p 1248 -v CPULOAD -l $ARG1$ command[check_nt_uptime]=$USER1$/check_nt -H $HOSTADDRESS$ -p 1248 -v UPTIME command[check_nt_clientversion]=$USER1$/check_nt -H $HOSTADDRESS$ -p 1248 -v CLIENTVERSION command[check_nt_process]=$USER1$/check_nt -H $HOSTADDRESS$ -p 1248 -v PROCSTATE -l $ARG1$ command[check_nt_service]=$USER1$/check_nt -H $HOSTADDRESS$ -p 1248 -v SERVICESTATE -l $ARG1$ command[check_nt_memuse]=$USER1$/check_nt -H $HOSTADDRESS$ -p 1248 -v MEMUSE -w $ARG1$ -c $ARG2$ command[check_nt_fileage]=$USER1$/check_nt -H $HOSTADDRESS$ -p 1248 -v FILEAGE 杔 $ARG1$ -w $ARG2$ -c $ARG3$
在service.cfg中添加:
define service{
use generic-windows
host_name psh2s001
service_description CPULOAD
check_command check_nt_cpuload!10,80,95,60,80,95,1440,80,95
}
define service{
use generic-windows
host_name psh2s001
service_description memory_usage
check_command check_nt_memuse!60!70
}
define service{
use generic-windows
host_name psh2s001
service_description check partition D
check_command check_nt_disk!D!70!80
}
define service{
use generic-windows
host_name psh2s001
service_description check partition E
check_command check_nt_disk!E!70!80
}
define service{
use generic-windows
host_name psh2s001
service_description check sylvestrix process status
check_command check_nt_process!pb8080workers.exe
}
define service{
use productive-linux
host_name psh2s001
service_description sylvestrix productive port
check_command check_tcp!8080
}
Comments
There are currently no comments
New Comment