参考
在NSClient\nsc.ini中[NRPE]下的配置项取消注释[NRPE]port=5666command_timeout=60;允许参数allow_arguments=1allow_nasty_meta_chars=0use_ssl=1allowed_hosts=192.168.1.0/24socket_timeout=30;# 手动添加performance_data=1把[NRPE Client Handlers]改成[NRPE Handlers],并添加测试脚本或命令[NRPE Handlers];check_other=-H 192.168.0.1 -p 5666 -c remote_command -a argumentsmy_ping_check=scripts\check_ping.bat $ARG1$my_udp_check=scripts\check_udp.bat $ARG1$;#监测内存check_mem=inject checkMem MaxWarn=80% MaxCrit=90% ShowAll=long type=physical监控服务器上可以用check_nrpe的来添加监控命令,可以在命令行中先测试,然后再通过centreon添加,或直接手动添加。#./check_nrpe -H 192.168.1.196 -p 5666 -c my_udp_check -a 445check_udp.bat的文件内容如下:@echo offrem nrpe方式检测 udp 端口SET UDP_PORT=%1netstat -an | find ":%UDP_PORT%" |find "UDP" > NULIF ERRORLEVEL 1 GOTO errIF ERRORLEVEL 0 GOTO okGOTO unknown :errecho CRITICAL: port %UDP_PORT% not listeningexit /B 1 :unknownecho UNKNOWN: Something went wrongexit /B 3 :okecho OK: port %UDP_PORT% workingexit /B 0