Issues with NRPE Monitoring for a Linux Server

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
venturegardengroup
Posts: 62
Joined: Tue Jun 28, 2016 10:11 am

Re: Issues with NRPE Monitoring for a Linux Server

Post by venturegardengroup »

You are correct.... that did the magic, though NRPE was unable to read some outputs. Please see output attached.
You do not have the required permissions to view the files attached to this post.
bwallace
Posts: 1145
Joined: Tue Nov 17, 2015 1:57 pm

Re: Issues with NRPE Monitoring for a Linux Server

Post by bwallace »

Let's check permissions on the remote machine. Log into the remote host server as root, execute the following command and post the output:

ll /usr/local/nagios/libexec
Be sure to check out the Knowledgebase for helpful articles and solutions!
User avatar
tgriep
Madmin
Posts: 9190
Joined: Thu Oct 30, 2014 9:02 am

Re: Issues with NRPE Monitoring for a Linux Server

Post by tgriep »

Take a look at this document for troubleshooting tips.
https://assets.nagios.com/downloads/nag ... utions.pdf

A couple of causes for the Unable to read Output is that the command defined in the nrpe.cfg file on that remote host has an incorrect path to the plugin or that the plugin is missing.
Take a look at that and update the config file or verify that the plugin is installed on the system.
Be sure to check out our Knowledgebase for helpful articles and solutions!
venturegardengroup
Posts: 62
Joined: Tue Jun 28, 2016 10:11 am

Re: Issues with NRPE Monitoring for a Linux Server

Post by venturegardengroup »

Hello see outputs below from the remote server regarding paths:

root@ERP-UAT-APP:/usr/local/nagios/libexec# ls
check_apt check_ftp check_mrtgtraf check_pop check_ups
check_asterisk.pl check_http check_nagios check_procs check_uptime
check_asterisk_sip_peers.sh check_icmp check_netstat.pl check_real check_users
check_breeze check_ide_smart check_nntp check_rpc check_wave
check_by_ssh check_ifoperstatus check_nntps check_sensors check_yum
check_clamd check_ifstatus check_nrpe check_services custom_check_mem
check_cluster check_imap check_nt check_simap custom_check_procs
check_cpu_stats.sh check_init_service check_ntp check_sip nagisk.pl
check_dhcp check_ircd check_ntp_peer check_smtp negate
check_dig check_jabber check_ntp_time check_spop urlize
check_disk check_ldap check_nwstat check_ssh utils.pm
check_disk_smb check_ldaps check_open_files.pl check_ssmtp utils.sh
check_dns check_load check_oracle check_swap
check_dummy check_log check_overcr check_tcp
check_file_age check_mailq check_pgsql check_time
check_flexlm check_mrtg check_ping check_udp
root@ERP-UAT-APP:/usr/local/nagios/libexec# cd ..
root@ERP-UAT-APP:/usr/local/nagios# cd ..
root@ERP-UAT-APP:/usr/local# cd ..
root@ERP-UAT-APP:/usr# cd ..
root@ERP-UAT-APP:/# find / -name nrpe
/home/xpansa/linux-nrpe-agent/subcomponents/nrpe
/home/xpansa/linux-nrpe-agent/subcomponents/nrpe/mods/cfg/nrpe
/home/xpansa/linux-nrpe-agent/subcomponents/nrpe/nrpe-2.15/src/nrpe
/home/xpansa/linux-nrpe-agent/subcomponents/nrpe/nrpe-2.15/package/solaris/pkg/nrpe
/usr/local/nagios/bin/nrpe
/usr/local/nagios/etc/nrpe
/etc/xinetd.d/nrpe
root@ERP-UAT-APP:/#
bwallace
Posts: 1145
Joined: Tue Nov 17, 2015 1:57 pm

Re: Issues with NRPE Monitoring for a Linux Server

Post by bwallace »

'ls' doesn't help - use 'll' please and re-post the output.
ll /usr/local/nagios/libexec

..The out put will be similar to this:
[root@XIcent7 libexec]# ll
total 9964
-rwxrwxr-x. 1 apache nagios 204565 Jun 1 06:52 check_apt
-rwxrwxr-x. 1 apache nagios 6897 Jun 20 12:42 check_asterisk.pl
etc....
Be sure to check out the Knowledgebase for helpful articles and solutions!
venturegardengroup
Posts: 62
Joined: Tue Jun 28, 2016 10:11 am

Re: Issues with NRPE Monitoring for a Linux Server

Post by venturegardengroup »

Please find ll output below:

root@ERP-UAT-APP:/home/xpansa# ll /usr/local/nagios/libexec
total 7924
drwxrwxr-x 2 nagios nagios 4096 Jun 28 14:46 ./
drwxr-xr-x 8 nagios nagios 4096 Jun 28 14:45 ../
-rwxr-xr-x 1 root root 223965 Jun 28 14:45 check_apt*
-rwxr-x--- 1 root root 6897 Jun 28 14:46 check_asterisk.pl*
-rwxr-x--- 1 root root 1978 Jun 28 14:46 check_asterisk_sip_peers.sh*
-rwxr-xr-x 1 root root 2242 Jun 28 14:45 check_breeze*
-rwxr-xr-x 1 root root 230574 Jun 28 14:45 check_by_ssh*
lrwxrwxrwx 1 root root 9 Jun 28 14:45 check_clamd -> check_tcp*
-rwxr-xr-x 1 root root 169214 Jun 28 14:45 check_cluster*
-rwxr-x--- 1 root root 5580 Jun 28 14:46 check_cpu_stats.sh*
-r-sr-xr-x 1 root root 234751 Jun 28 14:45 check_dhcp*
-rwxr-xr-x 1 root root 219760 Jun 28 14:45 check_dig*
-rwxr-xr-x 1 root root 239645 Jun 28 14:45 check_disk*
-rwxr-xr-x 1 root root 9289 Jun 28 14:45 check_disk_smb*
-rwxr-xr-x 1 root root 246636 Jun 28 14:45 check_dns*
-rwxr-xr-x 1 root root 125588 Jun 28 14:45 check_dummy*
-rwxr-xr-x 1 root root 3349 Jun 28 14:45 check_file_age*
-rwxr-xr-x 1 root root 6315 Jun 28 14:45 check_flexlm*
lrwxrwxrwx 1 root root 9 Jun 28 14:45 check_ftp -> check_tcp*
-rwxr-xr-x 1 root root 371388 Jun 28 14:45 check_http*
-r-sr-xr-x 1 root root 245206 Jun 28 14:45 check_icmp*
-rwxr-xr-x 1 root root 178024 Jun 28 14:45 check_ide_smart*
-rwxr-xr-x 1 root root 15123 Jun 28 14:45 check_ifoperstatus*
-rwxr-xr-x 1 root root 12600 Jun 28 14:45 check_ifstatus*
lrwxrwxrwx 1 root root 9 Jun 28 14:45 check_imap -> check_tcp*
-rwsr-x--- 1 root nagios 794 Jun 28 14:46 check_init_service*
-rwxr-xr-x 1 root root 6887 Jun 28 14:45 check_ircd*
lrwxrwxrwx 1 root root 9 Jun 28 14:45 check_jabber -> check_tcp*
-rwxr-xr-x 1 root root 198631 Jun 28 14:45 check_ldap*
lrwxrwxrwx 1 root root 10 Jun 28 14:45 check_ldaps -> check_ldap*
-rwxr-xr-x 1 root root 194949 Jun 28 14:45 check_load*
-rwxr-xr-x 1 root root 5995 Jun 28 14:45 check_log*
-rwxr-xr-x 1 root root 21480 Jun 28 14:45 check_mailq*
-rwxr-xr-x 1 root root 177154 Jun 28 14:45 check_mrtg*
-rwxr-xr-x 1 root root 176439 Jun 28 14:45 check_mrtgtraf*
-rwxr-xr-x 1 root root 195491 Jun 28 14:45 check_nagios*
-rwxr-x--- 1 root root 25602 Jun 28 14:46 check_netstat.pl*
lrwxrwxrwx 1 root root 9 Jun 28 14:45 check_nntp -> check_tcp*
lrwxrwxrwx 1 root root 9 Jun 28 14:45 check_nntps -> check_tcp*
-rwxrwxr-x 1 nagios nagios 91834 Jun 28 14:45 check_nrpe*
-rwxr-xr-x 1 root root 234855 Jun 28 14:45 check_nt*
-rwxr-xr-x 1 root root 240036 Jun 28 14:45 check_ntp*
-rwxr-xr-x 1 root root 226491 Jun 28 14:45 check_ntp_peer*
-rwxr-xr-x 1 root root 218980 Jun 28 14:45 check_ntp_time*
-rwxr-xr-x 1 root root 268812 Jun 28 14:45 check_nwstat*
-rwxr-x--- 1 root root 3259 Jun 28 14:46 check_open_files.pl*
-rwxr-xr-x 1 root root 8781 Jun 28 14:45 check_oracle*
-rwxr-xr-x 1 root root 201278 Jun 28 14:45 check_overcr*
-rwxr-xr-x 1 root root 215874 Jun 28 14:45 check_pgsql*
-rwxr-xr-x 1 root root 239467 Jun 28 14:45 check_ping*
lrwxrwxrwx 1 root root 9 Jun 28 14:45 check_pop -> check_tcp*
-rwxr-xr-x 1 root root 232370 Jun 28 14:45 check_procs*
-rwxr-xr-x 1 root root 200276 Jun 28 14:45 check_real*
-rwxr-xr-x 1 root root 9581 Jun 28 14:45 check_rpc*
-rwxr-xr-x 1 root root 1455 Jun 28 14:45 check_sensors*
-rwxr-x--- 1 root root 2174 Jun 28 14:46 check_services*
lrwxrwxrwx 1 root root 9 Jun 28 14:45 check_simap -> check_tcp*
-rwxr-x--- 1 root root 7599 Jun 28 14:46 check_sip*
-rwxr-xr-x 1 root root 293124 Jun 28 14:45 check_smtp*
lrwxrwxrwx 1 root root 9 Jun 28 14:45 check_spop -> check_tcp*
-rwxr-xr-x 1 root root 196515 Jun 28 14:45 check_ssh*
lrwxrwxrwx 1 root root 9 Jun 28 14:45 check_ssmtp -> check_tcp*
-rwxr-xr-x 1 root root 173458 Jun 28 14:45 check_swap*
-rwxr-xr-x 1 root root 282582 Jun 28 14:45 check_tcp*
-rwxr-xr-x 1 root root 198430 Jun 28 14:45 check_time*
lrwxrwxrwx 1 root root 9 Jun 28 14:45 check_udp -> check_tcp*
-rwxr-xr-x 1 root root 212660 Jun 28 14:45 check_ups*
-rwxr-xr-x 1 root root 164860 Jun 28 14:45 check_uptime*
-rwxr-xr-x 1 root root 163038 Jun 28 14:45 check_users*
-rwxr-xr-x 1 root root 2936 Jun 28 14:45 check_wave*
-rwxr-x--- 1 root root 710 Jun 28 14:46 check_yum*
-rwxr-x--- 1 root root 3435 Jun 28 14:46 custom_check_mem*
-rwxr-x--- 1 root root 915 Jun 28 14:46 custom_check_procs*
-rwxr-x--- 1 root root 4176 Jun 28 14:46 nagisk.pl*
-rwxr-xr-x 1 root root 160457 Jun 28 14:45 negate*
-rwxr-xr-x 1 root root 157077 Jun 28 14:45 urlize*
-rwxr-xr-x 1 root root 1864 Jun 28 14:45 utils.pm*
-rwxr-xr-x 1 root root 2791 Jun 28 14:45 utils.sh*
bwallace
Posts: 1145
Joined: Tue Nov 17, 2015 1:57 pm

Re: Issues with NRPE Monitoring for a Linux Server

Post by bwallace »

Thanks for the 'll' output. The following have incorrect permissions and thats why you were seeing "NRPE unabe to read output"

-rwxr-x--- 1 root root 5580 Jun 28 14:46 check_cpu_stats.sh*
-rwxr-x--- 1 root root 3259 Jun 28 14:46 check_open_files.pl*
-rwxr-x--- 1 root root 3435 Jun 28 14:46 custom_check_mem*

To resolve, run chmod 755 on each of those files and let us know of the outcome.
Ex: (first navigate to /usr/local/nagios/libexec)
chmod 755 check_cpu_stats.sh
Be sure to check out the Knowledgebase for helpful articles and solutions!
venturegardengroup
Posts: 62
Joined: Tue Jun 28, 2016 10:11 am

Re: Issues with NRPE Monitoring for a Linux Server

Post by venturegardengroup »

Great! This did the magic, however the CPU Stats still unable to read output; see attached.

Also how were you able to detect the three lines had issues from the output I sent?

Thanks.
You do not have the required permissions to view the files attached to this post.
User avatar
tgriep
Madmin
Posts: 9190
Joined: Thu Oct 30, 2014 9:02 am

Re: Issues with NRPE Monitoring for a Linux Server

Post by tgriep »

Try running the following on the remote server to fix the CPU Stats permissions and see if this resolves the issue.

Code: Select all

cd /usr/local/nagios/libexec)
chown apache.nagios
chmod 775 check_cpu_stats.sh
To answer your question, the unable to read output usually means either a missing file, wrong configuration settings or a permission problem.
Be sure to check out our Knowledgebase for helpful articles and solutions!
venturegardengroup
Posts: 62
Joined: Tue Jun 28, 2016 10:11 am

Re: Issues with NRPE Monitoring for a Linux Server

Post by venturegardengroup »

I tried the command and got the following following error:

root@ERP-PROD-APP:/usr/local/nagios/libexec# chown apache.nagios
chown: missing operand after ‘apache.nagios’
Locked