nagios remote monitoring nrpe vs ssh

本文探讨了使用Nagios进行服务器监控时,SSH与NRPE两种远程检查方式的性能差异。作者监控约130台服务器的CPU、磁盘、内存等指标,每30秒执行一次远程检查。讨论了两种方式的资源消耗及配置复杂度,并引用了Nagios官方文档中的观点。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

We use Nagios to monitor quite a few (~130) servers. We monitor CPU, Disk, RAM and a few other things on each server. I've always used SSH to run the remote commands, purely because it requires little to no additional config on the remote server, just install nagios-plugins, create the nagios user and add the SSH key, all of which I've automated into a shell script. I've never actually considered the performance implications of using SSH over NRPE.

I'm not too bothered about the load hit on the Nagios server (It's probably over-speced for what it does, it's never been over 10% CPU), but we run each remote check every 30 seconds and each server has 5 different checks performed. I assume SSH requires more resources for each check but is there a huge difference? (I.E. enough of a difference to warrant the switch to NRPE).

If it's any help, we monitor a mix of physical servers (Normally with 8, 12 or 16 physical cores) and Amazon EC2 medium/large instances.

share | improve this question
 
feedback

3 Answers

up vote 1 down vote accepted

I've always believed the administration advantage of SSH (I use push_check) outweighs any additional load. Modern CPUs are so fast that the cost of encrypting a handful of bytes is pretty minimal, so it comes down to running two processes (SSH and the check script) vs one (check script fired off by NRPE).

For check scripts written in an interpreted language, I would expect the overhead of firing up the interpreter (Perl, Python, Bash) to exceed the CPU cost of starting an SSH session. Given modern CPUs, your machines are more likely to be disk or memory limited rather than CPU limited.

Provided your Nagios machine is coping -- it has to set up 20 SSH connections every second -- I would err on the side of convenience.

Not really an answer to your question, more of an argument that life is too short to worry about it :)

share | improve this answer
 
feedback

NRPE is a nagios plugins, it's easy to install and it'll manage the check ask in the probe configuration file. There is only one bad thing about nrpe, you need to install it on every server you want to monitor, on linux os it's really simple, just yum/apt-get install nrpe, but on windows server you need to install it via .exe, and sometime you'll need to reboot your server.

I think SSH is not the most optimized way to use nagios. NRPE might be much more efficient.

Here on the nagios documentation there is this sentence :

"Using SSH is more secure than the NRPE addon, but it also imposes a larger (CPU) overhead on both the monitoring and remote machines. This can become an issue when you start monitoring hundreds or thousands of machines. Many Nagios admins opt for using using the NRPE addon because of the lower load it imposes."

there is the documentation. I'ts a .pdf

As for me, I use snmp protocol, which is simple to use, and don't need any third party installed on the servers.

share | improve this answer
 
I did look into SNMP but we monitor things like database/app stats which I don't think can be set up to use SNMP. I'm not too concerned about security on monitoring, SSH was chosen purely to avoid extra configuration. Like when we want to add/change a command with SSH we just change the NAGIOS config but with NRPE we'd need to add it to the nrpe.conf on the remote server too. –  sam  Jun 14 '11 at 8:56
 
that's true, nrpe is a little bothersome because you need to add .conf to the remote server. As for SNMP, you'll can do whatever you want (if i'm not wrong), you can create your own prob with perl and via snmp use your probe, it's easier than nrpe because you don't need to change .conf on remote server, and less greedy than SSH. Well after it's just a point of view and what you'll use nagios for. Nrpe is a good compromise between ssh and snmp, for me at least. Have a good day. –  Anarko_Bizounours  Jun 14 '11 at 9:01
Was this post useful to you?      

I've had nothing but issues trying to compile NRPE on various OS's. SSH has worked smoothly and efficiently and is much easier to script out.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值