Install NRPE 3.2.1 on CentOS 7 server
Install NRPE 3.2.1 on CentOS 7 server
Hi,
We would like to install NRPE 3.2.1 on CentOS 7 server, but with below conditions
1. NRPE should run with out running under xinetd
2. NRPE and Plugin files should install from rpm package, but not from the tar file (nrpe-3.2.1.tar.gz)
Kindly advice on installation procedure ?
We would like to install NRPE 3.2.1 on CentOS 7 server, but with below conditions
1. NRPE should run with out running under xinetd
2. NRPE and Plugin files should install from rpm package, but not from the tar file (nrpe-3.2.1.tar.gz)
Kindly advice on installation procedure ?
Re: Install NRPE 3.2.1 on CentOS 7 server
Hi @bsivavani,
Unfortunately, Nagios does not have rpm packages for NRPE 3.2.1.
This means that you will have to create your own; to do that, please follow the steps in this link...How_to_create_an_RPM_package
As for the plugin files, please run the following command...yum install nagios-plugins-all -y
Lastly, your question:
Please follow this kb article...How To Install NRPE v3 From Source
Please follow the instructions above and let me know if that solves your issue.
Unfortunately, Nagios does not have rpm packages for NRPE 3.2.1.
This means that you will have to create your own; to do that, please follow the steps in this link...How_to_create_an_RPM_package
As for the plugin files, please run the following command...yum install nagios-plugins-all -y
Lastly, your question:
NRPE should run without running under xinetd
Please follow this kb article...How To Install NRPE v3 From Source
Please follow the instructions above and let me know if that solves your issue.
Re: Install NRPE 3.2.1 on CentOS 7 server
Hi,
Thanks for the update.
I have installed NRPE 3.2.0 using below rpm file
http://dl.fedoraproject.org/pub/epel/7/ ... noarch.rpm
And installed nagios plugin files using YUM
yum install nagios-plugins-all -y
But while testing the cpu usage from Nagios server, we are receiving below error
[nagios@nagiosserver ~]$ /usr/local/nagios/libexec/check_nrpe -H Remoteserver -c check_cpu_stats1 -a "-Iw 20 -Ic 10"
NRPE: Unable to read output
[nagios@nagiosserver ~]$
Attached nrpe.cfg file.
Kindly advice ?
Thanks for the update.
I have installed NRPE 3.2.0 using below rpm file
http://dl.fedoraproject.org/pub/epel/7/ ... noarch.rpm
And installed nagios plugin files using YUM
yum install nagios-plugins-all -y
But while testing the cpu usage from Nagios server, we are receiving below error
[nagios@nagiosserver ~]$ /usr/local/nagios/libexec/check_nrpe -H Remoteserver -c check_cpu_stats1 -a "-Iw 20 -Ic 10"
NRPE: Unable to read output
[nagios@nagiosserver ~]$
Attached nrpe.cfg file.
Kindly advice ?
You do not have the required permissions to view the files attached to this post.
Re: Install NRPE 3.2.1 on CentOS 7 server
Let's try seeing if check_nrpe works locally and remotely.
Please run this from the command line and show us the output.
Just to be sure, this is what I see on my XI for this plugin.
Does the command work if you run it on your machine? Can you show us the output?
Please run this from the command line and show us the output.
Code: Select all
/usr/local/nagios/libexec/check_nrpe -H <XI IP>
Code: Select all
/usr/local/nagios/libexec/check_nrpe -H <remoteHostIP>
Code: Select all
./check_cpu_stats.sh --help
check_cpu_stats.sh Revision 1.3.1 - CPU Utilization check script for Nagios
Usage: check_cpu_utilization.sh -w <warning value in % for iowait>
-w Warning level for cpu iowait
-h Show this page
Usage: check_cpu_stats.sh
Usage: check_cpu_stats.sh --help
Usage: check_cpu_stats.sh -w <warning>
Code: Select all
./check_cpu_stats.sh -w 60
CPU STATISTICS OK: user=1.32% system=0.71% iowait=0.10% idle=97.86% | user=1.32% system=0.0% iowait=0.0%;60;100 idle=97.86%
Does the command work if you run it on your machine? Can you show us the output?
Code: Select all
/usr/local/nagios/libexec/check_cpu_stats -lw 20 -lc 10
Re: Install NRPE 3.2.1 on CentOS 7 server
Hi,
We are able to install nrpe using rpm and run the plugin remotely.
We are seeing nrpe is failed when we check the status from systemctl
[root@s93tl3101 nagios]# systemctl status nrpe
● nrpe.service - Nagios Remote Program Executor
Loaded: loaded (/usr/lib/systemd/system/nrpe.service; enabled; vendor preset: disabled)
Active: failed (Result: exit-code) since Wed 2017-11-22 12:03:29 CET; 3min 20s ago
Docs: http://www.nagios.org/documentation
Process: 5407 ExecStart=/usr/sbin/nrpe -c /etc/nagios/nrpe.cfg -d $NRPE_SSL_OPT (code=exited, status=0/SUCCESS)
Main PID: 5408 (code=exited, status=2)
Nov 22 12:03:29 s93tl3101 systemd[1]: Starting Nagios Remote Program Executor...
Nov 22 12:03:29 s93tl3101 systemd[1]: Started Nagios Remote Program Executor.
Nov 22 12:03:29 s93tl3101 systemd[1]: nrpe.service: main process exited, code=exited, status=2/INVALIDARGUMENT
Nov 22 12:03:29 s93tl3101 systemd[1]: Unit nrpe.service entered failed state.
Nov 22 12:03:29 s93tl3101 systemd[1]: nrpe.service failed.
[root@s93tl3101 nagios]#
But when we check for nrpe using ps command it is running.
[root@s93tl3101 nagios]# ps -ef | grep nrpe
nrpe 6102 1 0 12:06 ? 00:00:00 /usr/sbin/nrpe -c /etc/nagios/nrpe.cfg -d
root 9872 9068 0 13:15 pts/0 00:00:00 grep --color=auto nrpe
[root@s93tl3101 nagios]#
Kindly advice ?
We are able to install nrpe using rpm and run the plugin remotely.
We are seeing nrpe is failed when we check the status from systemctl
[root@s93tl3101 nagios]# systemctl status nrpe
● nrpe.service - Nagios Remote Program Executor
Loaded: loaded (/usr/lib/systemd/system/nrpe.service; enabled; vendor preset: disabled)
Active: failed (Result: exit-code) since Wed 2017-11-22 12:03:29 CET; 3min 20s ago
Docs: http://www.nagios.org/documentation
Process: 5407 ExecStart=/usr/sbin/nrpe -c /etc/nagios/nrpe.cfg -d $NRPE_SSL_OPT (code=exited, status=0/SUCCESS)
Main PID: 5408 (code=exited, status=2)
Nov 22 12:03:29 s93tl3101 systemd[1]: Starting Nagios Remote Program Executor...
Nov 22 12:03:29 s93tl3101 systemd[1]: Started Nagios Remote Program Executor.
Nov 22 12:03:29 s93tl3101 systemd[1]: nrpe.service: main process exited, code=exited, status=2/INVALIDARGUMENT
Nov 22 12:03:29 s93tl3101 systemd[1]: Unit nrpe.service entered failed state.
Nov 22 12:03:29 s93tl3101 systemd[1]: nrpe.service failed.
[root@s93tl3101 nagios]#
But when we check for nrpe using ps command it is running.
[root@s93tl3101 nagios]# ps -ef | grep nrpe
nrpe 6102 1 0 12:06 ? 00:00:00 /usr/sbin/nrpe -c /etc/nagios/nrpe.cfg -d
root 9872 9068 0 13:15 pts/0 00:00:00 grep --color=auto nrpe
[root@s93tl3101 nagios]#
Kindly advice ?
Re: Install NRPE 3.2.1 on CentOS 7 server
Can you show us the "/etc/systemd/system/multi-user.target.wants/nrpe.service" and "/usr/local/nagios/etc/nrpe.cfg" file? This should help us identify why nrpe service is failing to start (status=2/INVALIDARGUMENT).
Be sure to check out our Knowledgebase for helpful articles and solutions!
Re: Install NRPE 3.2.1 on CentOS 7 server
Please find requested output
[root@s930l3087 plugins]# ls -l /etc/systemd/system/multi-user.target.wants/nrpe.service
lrwxrwxrwx 1 root root 36 Nov 21 07:31 /etc/systemd/system/multi-user.target.wants/nrpe.service -> /usr/lib/systemd/system/nrpe.service
[root@s930l3087 plugins]#
[root@s930l3087 plugins]# cat /usr/lib/systemd/system/nrpe.service
[Unit]
Description=Nagios Remote Program Executor
Documentation=http://www.nagios.org/documentation
Conflicts=nrpe.socket
Requires=network.target
[Install]
WantedBy=multi-user.target
[Service]
Type=forking
User=nrpe
Group=nrpe
EnvironmentFile=/etc/sysconfig/nrpe
ExecStart=/usr/sbin/nrpe -c /etc/nagios/nrpe.cfg -d $NRPE_SSL_OPT
[root@s930l3087 plugins]#
[root@s930l3087 plugins]# ls -l /etc/systemd/system/multi-user.target.wants/nrpe.service
lrwxrwxrwx 1 root root 36 Nov 21 07:31 /etc/systemd/system/multi-user.target.wants/nrpe.service -> /usr/lib/systemd/system/nrpe.service
[root@s930l3087 plugins]#
[root@s930l3087 plugins]# cat /usr/lib/systemd/system/nrpe.service
[Unit]
Description=Nagios Remote Program Executor
Documentation=http://www.nagios.org/documentation
Conflicts=nrpe.socket
Requires=network.target
[Install]
WantedBy=multi-user.target
[Service]
Type=forking
User=nrpe
Group=nrpe
EnvironmentFile=/etc/sysconfig/nrpe
ExecStart=/usr/sbin/nrpe -c /etc/nagios/nrpe.cfg -d $NRPE_SSL_OPT
[root@s930l3087 plugins]#
You do not have the required permissions to view the files attached to this post.
Re: Install NRPE 3.2.1 on CentOS 7 server
It seems like that the problem is caused by the $NRPE_SSL_OPT variable. Also, I see some "non-default" paths... Is this the entire "nrpe.service" file?
You can try modifying the nrpe.service file as the example below to see if this is going to resolve the issue. Make a backup of the original "nrpe.service" file first!
Note: In the nrpe.cfg, I also have:
Hope this helps.
You can try modifying the nrpe.service file as the example below to see if this is going to resolve the issue. Make a backup of the original "nrpe.service" file first!
Code: Select all
# cat /usr/lib/systemd/system/nrpe.service
[Unit]
Description=Nagios Remote Plugin Executor
Documentation=http://www.nagios.org/documentation
After=var-run.mount nss-lookup.target network.target local-fs.target time-sync.target
Before=getty@tty1.service plymouth-quit.service xdm.service
Conflicts=nrpe.socket
[Install]
WantedBy=multi-user.target
[Service]
Type=simple
Restart=on-abort
PIDFile=/usr/local/nagios/var/nrpe.pid
RuntimeDirectory=nrpe
RuntimeDirectoryMode=0755
ExecStart=/usr/local/nagios/bin/nrpe -c /usr/local/nagios/etc/nrpe.cfg -f
ExecReload=/bin/kill -HUP $MAINPID
ExecStopPost=/bin/rm -f /usr/local/nagios/var/nrpe.pid
TimeoutStopSec=60
User=nagios
Group=nagios
PrivateTmp=true
OOMScoreAdjust=-500
Code: Select all
pid_file=/usr/local/nagios/var/nrpe.pid
Code: Select all
# systemctl status nrpe.service
● nrpe.service - Nagios Remote Plugin Executor
Loaded: loaded (/usr/lib/systemd/system/nrpe.service; enabled; vendor preset: disabled)
Active: active (running) since Mon 2017-11-27 10:29:43 CST; 7s ago
Docs: http://www.nagios.org/documentation
Process: 54176 ExecStopPost=/bin/rm -f /usr/local/nagios/var/nrpe.pid (code=exited, status=0/SUCCESS)
Main PID: 54180 (nrpe)
CGroup: /system.slice/nrpe.service
└─54180 /usr/local/nagios/bin/nrpe -c /usr/local/nagios/etc/nrpe.cfg -f
Be sure to check out our Knowledgebase for helpful articles and solutions!
Re: Install NRPE 3.2.1 on CentOS 7 server
I tried using the suggested code, but receiving below error while checking the status
[root@s93tl3101 system]# systemctl status nrpe
● nrpe.service - Nagios Remote Plugin Executor
Loaded: loaded (/usr/lib/systemd/system/nrpe.service; enabled; vendor preset: disabled)
Active: inactive (dead) since Mon 2017-12-04 12:39:42 CET; 1s ago
Docs: http://www.nagios.org/documentation
Process: 19248 ExecStart=/usr/sbin/nrpe -c /etc/nagios/nrpe.cfg -d (code=exited, status=0/SUCCESS)
Main PID: 19248 (code=exited, status=0/SUCCESS)
Dec 04 12:39:42 s93tl3101 systemd[1]: Started Nagios Remote Plugin Executor.
Dec 04 12:39:42 s93tl3101 systemd[1]: Starting Nagios Remote Plugin Executor...
Dec 04 12:39:42 s93tl3101 nrpe[19249]: Starting up daemon
Dec 04 12:39:42 s93tl3101 nrpe[19249]: Cannot write to pidfile '/etc/nagios/nrpe.pid' - check your privileges.
[root@s93tl3101 system]#
[root@s93tl3101 system]# systemctl status nrpe
● nrpe.service - Nagios Remote Plugin Executor
Loaded: loaded (/usr/lib/systemd/system/nrpe.service; enabled; vendor preset: disabled)
Active: inactive (dead) since Mon 2017-12-04 12:39:42 CET; 1s ago
Docs: http://www.nagios.org/documentation
Process: 19248 ExecStart=/usr/sbin/nrpe -c /etc/nagios/nrpe.cfg -d (code=exited, status=0/SUCCESS)
Main PID: 19248 (code=exited, status=0/SUCCESS)
Dec 04 12:39:42 s93tl3101 systemd[1]: Started Nagios Remote Plugin Executor.
Dec 04 12:39:42 s93tl3101 systemd[1]: Starting Nagios Remote Plugin Executor...
Dec 04 12:39:42 s93tl3101 nrpe[19249]: Starting up daemon
Dec 04 12:39:42 s93tl3101 nrpe[19249]: Cannot write to pidfile '/etc/nagios/nrpe.pid' - check your privileges.
[root@s93tl3101 system]#
Re: Install NRPE 3.2.1 on CentOS 7 server
Non default paths are because of we installed NRPE using rpm's.