check_nrpe Unable to read output

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
akepley
Posts: 138
Joined: Wed Sep 11, 2013 1:09 pm

Re: check_nrpe Unable to read output

Post by akepley »

We wget the linux-nrpe-agent.tar.gz from assets.nagios.com, untar the contents, then run the fullinstall script.

Code: Select all

total 4568
-rwxr-xr-x. 1 root   root   348473 Jun 11 14:09 check_apt
-rwx------. 1 root   root     6897 Jun 11 14:09 check_asterisk.pl
-rwx------. 1 root   root     1978 Jun 11 14:09 check_asterisk_sip_peers.sh
-rwxr-xr-x. 1 root   root     2265 Jun 11 14:09 check_breeze
-rwxr-xr-x. 1 root   root    92693 Jun 11 14:09 check_by_ssh
lrwxrwxrwx. 1 root   root        9 Jun 11 14:09 check_clamd -> check_tcp
-rwxr-xr-x. 1 root   root    50913 Jun 11 14:09 check_cluster
-rwx------. 1 root   root     5355 Jun 11 14:09 check_cpu_stats.sh
-r-sr-xr-x. 1 root   root    90377 Jun 11 14:09 check_dhcp
-rwxr-xr-x. 1 root   root    87813 Jun 11 14:09 check_dig
-rwxr-xr-x. 1 root   root   390610 Jun 11 14:09 check_disk
-rwxr-xr-x. 1 root   root     8163 Jun 11 14:09 check_disk_smb
-rwxr-xr-x. 1 root   root    96238 Jun 11 14:09 check_dns
-rwxr-xr-x. 1 root   root    46292 Jun 11 14:09 check_dummy
-rwxr-xr-x. 1 root   root     3143 Jun 11 14:09 check_file_age
-rwxr-xr-x. 1 root   root     6395 Jun 11 14:09 check_flexlm
lrwxrwxrwx. 1 root   root        9 Jun 11 14:09 check_ftp -> check_tcp
-rwxr-xr-x. 1 root   root   470345 Jun 11 14:09 check_http
-r-sr-xr-x. 1 root   root    97821 Jun 11 14:09 check_icmp
-rwxr-xr-x. 1 root   root    59348 Jun 11 14:09 check_ide_smart
-rwxr-xr-x. 1 root   root    15310 Jun 11 14:09 check_ifoperstatus
-rwxr-xr-x. 1 root   root    12853 Jun 11 14:09 check_ifstatus
lrwxrwxrwx. 1 root   root        9 Jun 11 14:09 check_imap -> check_tcp
-rws------. 1 root   nagios    748 Jun 11 14:09 check_init_service
-rwxr-xr-x. 1 root   root     7429 Jun 11 14:09 check_ircd
lrwxrwxrwx. 1 root   root        9 Jun 11 14:09 check_jabber -> check_tcp
-rwxr-xr-x. 1 root   root    73546 Jun 11 14:09 check_load
-rwxr-xr-x. 1 root   root     6062 Jun 11 14:09 check_log
-rwxr-xr-x. 1 root   root    20367 Jun 11 14:09 check_mailq
-rwxr-xr-x. 1 root   root    60002 Jun 11 14:09 check_mrtg
-rwxr-xr-x. 1 root   root    58867 Jun 11 14:09 check_mrtgtraf
-rwxr-xr-x. 1 root   root    72487 Jun 11 14:09 check_nagios
-rwx------. 1 root   root    25602 Jun 11 14:09 check_netstat.pl
lrwxrwxrwx. 1 root   root        9 Jun 11 14:09 check_nntp -> check_tcp
lrwxrwxrwx. 1 root   root        9 Jun 11 14:09 check_nntps -> check_tcp
-rwxrwxr-x. 1 nagios nagios  76784 Jun 11 14:09 check_nrpe
-rwxr-xr-x. 1 root   root    93847 Jun 11 14:09 check_nt
-rwxr-xr-x. 1 root   root    96867 Jun 11 14:09 check_ntp
-rwxr-xr-x. 1 root   root    87083 Jun 11 14:09 check_ntp_peer
-rwxr-xr-x. 1 root   root    83869 Jun 11 14:09 check_ntp_time
-rwxr-xr-x. 1 root   root   125742 Jun 11 14:09 check_nwstat
-rwx------. 1 root   root     3259 Jun 11 14:09 check_open_files.pl
-rwxr-xr-x. 1 root   root     8366 Jun 11 14:09 check_oracle
-rwxr-xr-x. 1 root   root    75771 Jun 11 14:09 check_overcr
-rwxr-xr-x. 1 root   root    99698 Jun 11 14:09 check_ping
lrwxrwxrwx. 1 root   root        9 Jun 11 14:09 check_pop -> check_tcp
-rwxr-xr-x. 1 root   root   368776 Jun 11 14:09 check_procs
-rwxr-xr-x. 1 root   root    71166 Jun 11 14:09 check_real
-rwxr-xr-x. 1 root   root     9707 Jun 11 14:09 check_rpc
-rwxr-xr-x. 1 root   root     1176 Jun 11 14:09 check_sensors
-rwx------. 1 root   root     2174 Jun 11 14:09 check_services
lrwxrwxrwx. 1 root   root        9 Jun 11 14:09 check_simap -> check_tcp
-rwx------. 1 root   root     7599 Jun 11 14:09 check_sip
-rwxr-xr-x. 1 root   root   410507 Jun 11 14:09 check_smtp
lrwxrwxrwx. 1 root   root        9 Jun 11 14:09 check_spop -> check_tcp
-rwxr-xr-x. 1 root   root    69126 Jun 11 14:09 check_ssh
lrwxrwxrwx. 1 root   root        9 Jun 11 14:09 check_ssmtp -> check_tcp
-rwxr-xr-x. 1 root   root    74828 Jun 11 14:09 check_swap
-rwxr-xr-x. 1 root   root   124573 Jun 11 14:09 check_tcp
-rwxr-xr-x. 1 root   root    71272 Jun 11 14:09 check_time
lrwxrwxrwx. 1 root   root        9 Jun 11 14:09 check_udp -> check_tcp
-rwxr-xr-x. 1 root   root    84198 Jun 11 14:09 check_ups
-rwxr-xr-x. 1 root   root    68867 Jun 11 14:09 check_users
-rwxr-xr-x. 1 root   root     3019 Jun 11 14:09 check_wave
-rwx------. 1 root   root      710 Jun 11 14:09 check_yum
-rwx------. 1 root   root     3060 Jun 11 14:09 custom_check_mem
-rwx------. 1 root   root      915 Jun 11 14:09 custom_check_procs
-rwx------. 1 root   root     4176 Jun 11 14:09 nagisk.pl
-rwxr-xr-x. 1 root   root    75043 Jun 11 14:09 negate
-rwx------. 1 root   root    60249 Jun 11 14:09 send_nsca
-rwxr-xr-x. 1 root   root    68298 Jun 11 14:09 urlize
-rwxr-xr-x. 1 root   root     2035 Jun 11 14:09 utils.pm
-rwxr-xr-x. 1 root   root      862 Jun 11 14:09 utils.sh

Code: Select all

total 20
drwxrwxr-x. 2 nagios nagios 4096 Jun 11 14:09 bin
drwxrwxr-x. 3 nagios nagios 4096 Jun 11 14:09 etc
drwxrwxr-x. 2 nagios nagios 4096 Jun 11 14:09 libexec
drwx------. 3 root   root   4096 Jun 11 14:09 share
drwx------. 3 nagios nagios 4096 Jun 11 14:09 var
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: check_nrpe Unable to read output

Post by abrist »

-rwx------. 1 root root 3060 Jun 11 14:09 custom_check_mem
The plugin is currently owned by "root", not "nagios". Lets fix that:

Code: Select all

chown nagios:nagios custom_check_mem
chmod g+xr custom_check_mem
Now try to run it as user "nagios" from the cli again.
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
akepley
Posts: 138
Joined: Wed Sep 11, 2013 1:09 pm

Re: check_nrpe Unable to read output

Post by akepley »

I guess the question becomes why would this system suddenly make root the owner of most of the libexec files and why would sudo nagios access using /etc/sudoers to the file not work?

Would changing the group only to Nagios and chmod g+rx work?
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: check_nrpe Unable to read output

Post by abrist »

akepley wrote:I guess the question becomes why would this system suddenly make root the owner of most of the libexec files
Not sure on this one. It is usually pebcak, but could be another issue. What was done to this server right before the problems started?
akepley wrote:why would sudo nagios access using /etc/sudoers to the file not work?
You would either need to run the chack with "sudo", or set the suid bit on the plugin.
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
akepley
Posts: 138
Joined: Wed Sep 11, 2013 1:09 pm

Re: check_nrpe Unable to read output

Post by akepley »

They are brand new virtual servers using RHEL 6.5. As far as I know, there is nothing different about them compared to the other 50 servers we have setup Nagios on other than they are VMWare VMs. Anyway, this appears to solve the issue. Thanks for the help!
Locked