nagios监控问题

[复制链接]
查看11 | 回复5 | 2021-1-27 06:45:09 | 显示全部楼层 |阅读模式

错误日志如下
[1422172185]SERVICENOTIFICATION:nagiosadmin;client-1;check_disk;UNKNOWN;notify-service-by-email;Incorrectcommandlineargumentssupplied
[1422173305]SERVICENOTIFICATION:nagiosadmin;client-1;check_load;UNKNOWN;notify-service-by-email;Incorrectcommandlineargumentssupplied
[1422173355]SERVICENOTIFICATION:nagiosadmin;client-1;check_sda1;UNKNOWN;notify-service-by-email;Incorrectcommandlineargumentssupplied
[1422173365]SERVICENOTIFICATION:nagiosadmin;client-1;check_users;UNKNOWN;notify-service-by-email;Incorrectcommandlineargumentssupplied
[1422173395]SERVICENOTIFICATION:nagiosadmin;client-1;check_total_procs;UNKNOWN;notify-service-by-email;Incorrectcommandlineargumentssupplied
[1422173445]SERVICENOTIFICATION:nagiosadmin;client-1;check_zombie_procs;UNKNOWN;notify-service-by-email;Incorrectcommandlineargumentssupplied
其中client-1设置如下
客户端的nrpe.cfg设置,nrpe服务启动正常
allowed_hosts=192.168.100.1#只改了这里其他没有动,都是默认
command[check_users]=/usr/local/nagios/libexec/check_users-w5-c10
command[check_load]=/usr/local/nagios/libexec/check_load-w15,10,5-c30,25,20
command[check_sda1]=/usr/local/nagios/libexec/check_disk-w20%-c10%-p/dev/sda1
command[check_zombie_procs]=/usr/local/nagios/libexec/check_procs-w5-c10-sZ
command[check_total_procs]=/usr/local/nagios/libexec/check_procs-w150-c200
command[check_disk]=/usr/local/nagios/libexec/check_disk-w15%-c7%-p
服务端设置commands.cfg设置
definecommand{
command_namecheck_nrpe
command_line$USER1$/check_nrpe–H"$HOSTADDRESS$"-c$ARG1$
}
自己创建的配置文件,而且在nagios.cfg中添加了配置文件的路径
[root@nagiosnagios]#vim/etc/nagios/objects/client.cfg
definehost{
uselinux-server
host_nameclient-1
aliasclient-1
address192.168.100.2
}
defineservice{
uselocal-service
host_nameclient-1
service_descriptioncheck_users
check_commandcheck_nrpe!check_users
}
defineservice{
uselocal-service
host_nameclient-1
service_descriptioncheck_load
check_commandcheck_nrpe!check_load
}
defineservice{
uselocal-service
host_nameclient-1
service_descriptioncheck_sda1
check_commandcheck_nrpe!check_sda1
}
defineservice{
uselocal-service
host_nameclient-1
service_descriptioncheck_zombie_procs
check_commandcheck_nrpe!check_zombie_procs
}
defineservice{
uselocal-service
host_nameclient-1
service_descriptioncheck_total_procs
check_commandcheck_nrpe!check_total_procs
}
defineservice{
uselocal-service
host_nameclient-1
service_descriptioncheck_disk
check_commandcheck_nrpe!check_disk
}

分 -->
回复

使用道具 举报

千问 | 2021-1-27 06:45:09 | 显示全部楼层
补充本机通过nrpe插件可以,看到远端的数据返回
[root@localhost~]#/usr/local/nagios/libexec/check_nrpe-H192.168.100.2-ccheck_load
OK-loadaverage:0.00,0.00,0.00|load1=0.000;15.000;30.000;0;load5=0.000;10.000;25.000;0;load15=0.000;5.000;20.000;0;
回复

使用道具 举报

千问 | 2021-1-27 06:45:09 | 显示全部楼层
顶帖,等大神回复
回复

使用道具 举报

千问 | 2021-1-27 06:45:09 | 显示全部楼层
definecommand{
command_namecheck_nrpe
command_line$USER1$/check_nrpe–H"$HOSTADDRESS$"-c$ARG1$
}
-----
不需要双引号,应该为:
$HOSTADDRESS$
回复

使用道具 举报

千问 | 2021-1-27 06:45:09 | 显示全部楼层
你好我想问你的问题怎么解决的!
回复

使用道具 举报

千问 | 2021-1-27 06:45:09 | 显示全部楼层
#增加到末尾行
definecommand{
command_namecheck_nrpe
command_line$USER1$/check_nrpe-H"$HOSTADDRESS$"-c"$ARG1$"
}
尾行问题解决。。。。。
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

主题

0

回帖

4882万

积分

论坛元老

Rank: 8Rank: 8

积分
48824836
热门排行