看完这个之后 [root@wcmisdlin02 alexus]# tail -2 /etc/sudoers ## Read drop-in files from /etc/sudoers.d (the # here does not mean a comment) #includedir /etc/sudoers.d [root@wcmisdlin02 alexus]# 我现在有以下几点: [root@wcmisdlin02 ~]# cat /etc/sudoers.d/01_nagios Defaults:nagios !requiretty nagios ALL=(ALL) NOPASSWD: /usr/lib/nagios/plugins/ [root@wcmisdlin02 ~]# 但我得到我的/var/log/messages Sep 21 11:14:32 wcmisdlin02 sudo: nrpe : sorry, you must have a tty to run sudo ; […]
简短的PowerShell脚本进行testing: $test = $args[0] echo "this works" echo "I transferred $test" exit 0 nsclient.ini设置: # If you want to fill this file with all avalible options run the following command: # nscp settings –generate –add-defaults –load-all # If you want to activate a module and bring in all its options use: # nscp settings –activate-module […]
我从nagios交换check_mysql_slavestatus在Ubuntu上使用Nrpe插件。 手工从: root@Bastion-01:/usr/local/nagios/libexec# ./check_mysql_slavestatus -H Slave-ip -P 3306 -u root -p xxxxx -w 10 -c 20 OK: Slave SQL running: Yes Slave IO running: Yes / master: 172.31.20.9 / slave is 0 seconds behind master | delay=0s 同样,它从主数据库工作 root@DB-01:/usr/lib/nagios/plugins# ./check_mysql_slavestatus -H Slave-ip -P 3306 -u root -p xxxxx -w 10 -c 20 OK: Slave SQL […]
我想监视一些我不能允许收入连接的主机。 在使用“Icinga 2客户端”或“by_ssh”的时候,有没有办法实现? 在官方文档中我找不到任何有关这方面的信息: http : //docs.icea.org/icinga2/latest/doc/module/icinga2/chapter/monitoring-remote-systems#icinga2-remote-monitoring-client 我最喜欢的设置将是我的远程主机可以build立到Icinga2服务器的ssh连接,并通过该通道发送数据。 非常感谢你!
试图解决我通过让我们的Nagios安装使用KVM插件check_kvmfind的问题。 我认为我的问题归结为与nagios / nrpe用户的权限问题。 安装nrpe和插件后,我没有任何其他标准插件如check_disk或check_load等问题。基本上,kvm插件使用virsh来检查状态,所以我启用loginnrpe(也尝试过nagios用户,但它出现服务在nrpe用户下运行)并尝试以下操作: [root@vhost3 ~]# su nrpe sh-4.2$ virsh list –all error: failed to connect to the hypervisor error: no valid connection error: Cannot create user runtime directory '/run/user/0/libvirt': Permission denied 但是当然这个命令没有问题,当然在本地尝试的时候插件会执行得很好: [root@vhost3 ~]# virsh list –all Id Name State —————————————————- 2 www running [root@vhost3 ~]# /usr/lib64/nagios/plugins/check_kvm hosts:1 OK:1 WARN:0 CRIT:0 – www:running […]
我试图定义一个外部脚本,它将在Windows上的NSClient ++ 0.4.1中采用可选参数。 遵循我定义的nsclient-full.ini示例代码 mycheck=cmd /C echo C:\mydir\myscript.ps1 %ARGS% | powershell.exe -command – 它只是产生string%ARGS%作为唯一的parameter passing给myscript.ps1 ,不pipe我在通过NRPE调用时指定的是什么(如果有的话,使用Nagios的check_nrpe )。 然后我试图重写定义 mycheck=cmd /C echo C:\mydir\myscript.ps1 $ARG1$ $ARG2$ | powershell.exe -command – ( myscript.ps1将占用两个参数),这有一点帮助。 至less,如果提供了两个参数,我可以通过args[]数组获取它们。 当调用less于两个参数时,麻烦就开始了 – 在这种情况下,string$ARG2和$ARG1$作为parameter passing。 在myscript.ps1的代码中处理这种情况,使整个参数处理例程最好是丑陋的。 有没有一个明智的方式来定义一个外部脚本的可选参数,如果没有指定参数,将不会传递NSClient的variables名称?
我在监视服务器的nrpe.conf中添加了以下行,名为myserver: command[check_mysrv_process]=/usr/lib/nagios/plugins/check_procs -c 1: -C java -a mysrv 在预期的地方工作: myserver> /usr/lib/nagios/plugins/check_procs -c 1: -C java -a mysrv PROCS OK: 1 process with command name 'java', args 'mysrv' 但是,当我运行通过从我的nagios服务器nrpe的检查,我得到一个零输出,无论具有特定模式的进程数量将通常为0或1: mynagiosserver>/opt/nagios/libexec/check_nrpe -H myserver -u -c check_mysrv_process PROCS CRITICAL: 0 processes with command name 'java', args 'mysrv' 更多细节: NRPE版本= 2.12 Nagios插件版本= 1.4.16 操作系统types:SLES 11.3 包含mysrv的特定进程名称很长。 编辑 在做cat /proc/pid […]
我写了一个Nagios检查脚本,它接收一个path作为参数并检查: 如果path被安装 如果可以通过触摸path中的文件进行访问。 如果挂载点目录是空的 [root@hadoop-nn1 mass1]# su – nagios [nagios@hadoop-nn1 ~]$ /usr/lib64/nagios/plugins/check_nfsmount.sh /mass2/hpfiles/ Warning: /mass2/hpfiles/ is mounted but directory is empty! [nagios@hadoop-nn1 ~]$ /usr/lib64/nagios/plugins/check_nfsmount.sh /mass1/hpfiles/ Warning: /mass1/hpfiles/ is MOUNTED properly but not writeable for user nagios [nagios@hadoop-nn1 ~]$ /usr/lib64/nagios/plugins/check_nfsmount.sh /mass1/hp_offline/ Ok: /mass1/hp_offline/ is MOUNTED properly and writeable for user nagios [nagios@hadoop-nn1 ~]$ /etc/nagios/nrpe.cfg的命令如下所示: command[check_nfsmounts]=/usr/lib64/nagios/plugins/check_nfsmounts.sh $ARG1$ […]
我最近开始使用Nagios监视大约25台服务器(主要是虚拟的,有一些独立的)。 其中大部分服务器(包括Nagios主机本身)都运行Ubuntu 14.04 LTS,less数运行12.04 LTS。 因此,我认为我可以利用NRPE并做到这一点。 configurationNRPE对我来说已经certificate是相当复杂的。 例如,对于一个简单的check_disk命令,我不得不通过排除其他每个分区/文件系统来手动指定要检查的分区,如下所示: command[check_disk]=/usr/lib/nagios/plugins/check_disk -w 57% -x /dev -x /run -x /run/lock -x /run/shm -x /run/user -x /sys/fs/cgroup 否则,我的警告和关键阈值立即由sysfs,proc或其他分区引起。 然后我看了一下Nagios主机自己执行的基本服务监视器。 这是列在/usr/local/nagios/etc/localhost.cfg,并包含以下(我很抱歉!我不明白为什么它不会正确格式!) define service{ use local-service ; Name of service template to use host_name localhost service_description PING check_command check_ping!100.0,20%!500.0,60% } define service{ use local-service ; Name of service template to use […]
我已经configuration了运行NRPE 2.15的客户端configuration的服务器端的Nagios Core版本4.1.0rc2。 我已经使用check_nrpe命令正确地通信了两台设备,但是无论出于何种原因,使用check_procs时,Nagios web门户网站未显示正确的值。 这是来自远程主机的nrpe.cfg: command[check_asterisk_proc]=env COLUMNS=500 /usr/local/nagios/libexec/check_procs -C asterisk -c 1: 以下是从CLI运行时输出的check_nrpe命令: /usr/lib/nagios/plugins/check_nrpe -H 192.168.100.7 -c check_asterisk_proc PROCS OK: 1 process with command name 'asterisk' | procs=1;;1:;0; 但是当你看看Nagios门户网站时,你所看到的只是以下的回应: asterisk-proc OK 08-04-2015 21:17:27 0d 0h 15m 45s 1/3 NRPE v2.15 networking门户中的另一个观点: Status Information: NRPE v2.15 抛开它的是,似乎NRPE正在返回它的版本号,但实际上并没有运行check_procs命令。 有什么我失踪?