功能 监控dfs使用比例 监控datanode 运行情况 监控tasktracker 运行情况 一、将附件py文件放到nagios的插件目录
我CentOS5.5 64bit机器的目录是“/usr/lib64/nagios/plugins”
二、添加命令vi /etc/nagios/objects/commands.cfg
define command {
command_name check_dfs
command_line Python $USER1$/check_Hadoop_dfs.py -w $ARG1$ -c $ARG2$
}
define command {
command_name check_datanode
command_line python $USER1$/check_hadoop_datanode.py -w $ARG1$ -c $ARG2$
}
define command {
command_name check_tasktracker
command_line python $USER1$/check_hadoop_tasktracker.py -w $ARG1$ -c $ARG2$
}
vi /etc/nagios/objects/localhost.cfg
define service{
use local-service ; Name of service template to use
host_name CNC-BJ-5-3N1
service_description Hadoop DFS Space
check_command check_dfs!30!20
}
define service{
use local-service ; Name of service template to use
host_name CNC-BJ-5-3N1
service_description Hadoop Datanode
check_command check_datanode!18!15
}
define service{
use local-service ; Name of service template to use
host_name CNC-BJ-5-3N1
service_description Hadoop Tasktracker
check_command check_tasktracker!18!15
}
具体下载目录在 /2012年资料/1月/9日/用Python编写Nagios Hadoop监控脚本/
-- end --