LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 06-02-2010, 09:03 AM   #1
edwardcode
Member
 
Registered: Apr 2010
Posts: 161

Rep: Reputation: 17
CHECK_NRPE: Error receiving data from daemon.


I have set up Nagios, Nagios Plugins, and nrpe. I have the nrpe running through xinetd.

When I run /usr/local/nagios/libexec/check_nrpe -H <my_ipaddress> and I get the error

CHECK_NRPE: Error receiving data from daemon

I have no idea what is wrong with this, is there any one that can help me out here?
 
Old 06-02-2010, 01:10 PM   #2
edwardcode
Member
 
Registered: Apr 2010
Posts: 161

Original Poster
Rep: Reputation: 17
Is there any one that can help me?
 
Old 06-02-2010, 01:13 PM   #3
EricTRA
LQ Guru
 
Registered: May 2009
Location: Gibraltar, Gibraltar
Distribution: Fedora 20 with Awesome WM
Posts: 6,805
Blog Entries: 1

Rep: Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297
Hello,

Is the NRPE daemon running and configured correctly on the remote host? No firewalling or SELinux enabled?

Kind regards,

Eric
 
Old 06-02-2010, 01:15 PM   #4
edwardcode
Member
 
Registered: Apr 2010
Posts: 161

Original Poster
Rep: Reputation: 17
I have opened up the firewall to allow port 5666 and I have set SElinux to permissive. I have the xinetd running and nrpe in in that, so yes i do have nrpe running.
 
Old 06-02-2010, 01:17 PM   #5
MensaWater
LQ Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, CoreOS, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 7,831
Blog Entries: 15

Rep: Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669
1) Make sure the /usr/local/nagios directory, sub-directories and files are owned by user "nagios".
2) Make sure you've configured xinetd to run the nrpe process as nagios user rather than root.
3) Make sure your nrpe.cfg has a line that is allowing the the Nagios server access e.g.:
allowed_hosts=x.x.x.x
Where x.x.x.x is the IP of the Nagios server.

Also check /var/log/messages to see if nrpe put anything there that might tell you what the problem is.
 
Old 06-02-2010, 01:21 PM   #6
EricTRA
LQ Guru
 
Registered: May 2009
Location: Gibraltar, Gibraltar
Distribution: Fedora 20 with Awesome WM
Posts: 6,805
Blog Entries: 1

Rep: Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297
Hi,

How did you configure the NRPE daemon? To listen to a specific IP (that of the Nagios server)? Did you run the test succesfully on the remote server as explained in the installation guide? Check logs for any indication (in Debian nrpe logs in /var/log/messages on receiving commands). I'm not at work right now and don't have access so cannot compare things. Post your NRPE config if you want me to have a look at it. I can compare to mine in the morning (that's in about 9.5 hours).

Kind regards,

Eric
 
Old 06-02-2010, 01:28 PM   #7
edwardcode
Member
 
Registered: Apr 2010
Posts: 161

Original Poster
Rep: Reputation: 17
1) Yes /usr/local/nagios is owned by nagios

2) How to I make sure that it is running with nagios and not root?

3)It says in the config file "if you are using xined then this will be ingored" but i did it any ways and it did not change any thing.

below is the message log

0(sec)
Jun 2 14:04:27 localhost setroubleshoot: SELinux is preventing the status.cgi (httpd_t) from executing ./status.cgi. For complete SELinux messages. run sealert -l 047e5e30-e4c1-4e28-a159-365ea33ba156
Jun 2 14:05:50 localhost xinetd[14875]: START: nrpe pid=19526 from=10.0.2.15
Jun 2 14:05:50 localhost nrpe[19526]: Unknown option specified in config file '/usr/local/nagios/etc/nrpe.cfg' - Line 12
Jun 2 14:05:50 localhost nrpe[19526]: No variable value specified in config file '/usr/local/nagios/etc/nrpe.cfg' - Line 14
Jun 2 14:05:50 localhost nrpe[19526]: Config file '/usr/local/nagios/etc/nrpe.cfg' contained errors, aborting...
Jun 2 14:05:50 localhost xinetd[14875]: EXIT: nrpe status=2 pid=19526 duration=0(sec)
Jun 2 14:06:54 localhost nrpe[19538]: Unknown option specified in config file '/usr/local/nagios/etc/nrpe.cfg' - Line 12
Jun 2 14:06:54 localhost nrpe[19538]: No variable value specified in config file '/usr/local/nagios/etc/nrpe.cfg' - Line 14
Jun 2 14:06:54 localhost nrpe[19538]: Config file '/usr/local/nagios/etc/nrpe.cfg' contained errors, aborting...
Jun 2 14:06:54 localhost xinetd[14875]: START: nrpe pid=19538 from=10.0.2.15
Jun 2 14:06:54 localhost xinetd[14875]: EXIT: nrpe status=2 pid=19538 duration=0(sec)
Jun 2 14:07:58 localhost nrpe[19557]: Unknown option specified in config file '/usr/local/nagios/etc/nrpe.cfg' - Line 12
Jun 2 14:07:58 localhost nrpe[19557]: No variable value specified in config file '/usr/local/nagios/etc/nrpe.cfg' - Line 14
Jun 2 14:07:58 localhost nrpe[19557]: Config file '/usr/local/nagios/etc/nrpe.cfg' contained errors, aborting...
Jun 2 14:07:58 localhost xinetd[14875]: START: nrpe pid=19557 from=10.0.2.15
Jun 2 14:07:58 localhost xinetd[14875]: EXIT: nrpe status=2 pid=19557 duration=0(sec)
Jun 2 14:09:02 localhost nrpe[19577]: Unknown option specified in config file '/usr/local/nagios/etc/nrpe.cfg' - Line 12
Jun 2 14:09:02 localhost nrpe[19577]: No variable value specified in config file '/usr/local/nagios/etc/nrpe.cfg' - Line 14
Jun 2 14:09:02 localhost nrpe[19577]: Config file '/usr/local/nagios/etc/nrpe.cfg' contained errors, aborting...
Jun 2 14:09:02 localhost xinetd[14875]: START: nrpe pid=19577 from=10.0.2.15
Jun 2 14:09:02 localhost xinetd[14875]: EXIT: nrpe status=2 pid=19577 duration=0(sec)
Jun 2 14:09:15 localhost nrpe[19588]: Unknown option specified in config file '/usr/local/nagios/etc/nrpe.cfg' - Line 12
Jun 2 14:09:15 localhost nrpe[19588]: No variable value specified in config file '/usr/local/nagios/etc/nrpe.cfg' - Line 14
Jun 2 14:09:15 localhost nrpe[19588]: Config file '/usr/local/nagios/etc/nrpe.cfg' contained errors, aborting...
Jun 2 14:09:15 localhost xinetd[14875]: START: nrpe pid=19588 from=10.0.2.15
Jun 2 14:09:15 localhost xinetd[14875]: EXIT: nrpe status=2 pid=19588 duration=0(sec)
Jun 2 14:14:43 localhost setroubleshoot: SELinux is preventing ping (ping_t) "read write" to /usr/local/nagios/var/spool/checkresults/checksZnrUV (usr_t). For complete SELinux messages. run sealert -l d9d92562-4323-45af-b8e5-128f8bb998b8
Jun 2 14:15:50 localhost xinetd[14875]: START: nrpe pid=19711 from=10.0.2.15
Jun 2 14:15:50 localhost nrpe[19711]: Unknown option specified in config file '/usr/local/nagios/etc/nrpe.cfg' - Line 12
Jun 2 14:15:50 localhost nrpe[19711]: No variable value specified in config file '/usr/local/nagios/etc/nrpe.cfg' - Line 14
Jun 2 14:15:50 localhost nrpe[19711]: Config file '/usr/local/nagios/etc/nrpe.cfg' contained errors, aborting...
Jun 2 14:15:50 localhost xinetd[14875]: EXIT: nrpe status=2 pid=19711 duration=0(sec)
Jun 2 14:16:54 localhost nrpe[19723]: Unknown option specified in config file '/usr/local/nagios/etc/nrpe.cfg' - Line 12
Jun 2 14:16:54 localhost nrpe[19723]: No variable value specified in config file '/usr/local/nagios/etc/nrpe.cfg' - Line 14
Jun 2 14:16:54 localhost nrpe[19723]: Config file '/usr/local/nagios/etc/nrpe.cfg' contained errors, aborting...
Jun 2 14:16:54 localhost xinetd[14875]: START: nrpe pid=19723 from=10.0.2.15
Jun 2 14:16:54 localhost xinetd[14875]: EXIT: nrpe status=2 pid=19723 duration=0(sec)
Jun 2 14:17:06 localhost xinetd[14875]: Exiting...
Jun 2 14:17:07 localhost xinetd[19741]: xinetd Version 2.3.14 started with libwrap loadavg labeled-networking options compiled in.
Jun 2 14:17:07 localhost xinetd[19741]: Started working: 1 available service
Jun 2 14:17:12 localhost nagios: Caught SIGTERM, shutting down...
Jun 2 14:17:12 localhost nagios: Successfully shutdown... (PID=14853)
Jun 2 14:17:13 localhost nagios: Nagios 3.2.1 starting... (PID=19796)
Jun 2 14:17:13 localhost nagios: Local time is Wed Jun 02 14:17:13 EDT 2010
Jun 2 14:17:13 localhost nagios: LOG VERSION: 2.0
Jun 2 14:17:13 localhost nagios: Finished daemonizing... (New PID=19797)
Jun 2 14:17:49 localhost nrpe[19811]: Unknown option specified in config file '/usr/local/nagios/etc/nrpe.cfg' - Line 12
Jun 2 14:17:49 localhost nrpe[19811]: No variable value specified in config file '/usr/local/nagios/etc/nrpe.cfg' - Line 14
Jun 2 14:17:49 localhost nrpe[19811]: Config file '/usr/local/nagios/etc/nrpe.cfg' contained errors, aborting...
Jun 2 14:17:49 localhost xinetd[19741]: START: nrpe pid=19811 from=10.0.2.15
Jun 2 14:17:49 localhost xinetd[19741]: EXIT: nrpe status=2 pid=19811 duration=0(sec)
Jun 2 14:17:58 localhost xinetd[19741]: START: nrpe pid=19816 from=10.0.2.15
Jun 2 14:17:58 localhost nrpe[19816]: Unknown option specified in config file '/usr/local/nagios/etc/nrpe.cfg' - Line 12
Jun 2 14:17:58 localhost nrpe[19816]: No variable value specified in config file '/usr/local/nagios/etc/nrpe.cfg' - Line 14
Jun 2 14:17:58 localhost nrpe[19816]: Config file '/usr/local/nagios/etc/nrpe.cfg' contained errors, aborting...
Jun 2 14:17:58 localhost xinetd[19741]: EXIT: nrpe status=2 pid=19816 duration=0(sec)
Jun 2 14:19:02 localhost xinetd[19741]: START: nrpe pid=19843 from=10.0.2.15
Jun 2 14:19:02 localhost nrpe[19843]: Unknown option specified in config file '/usr/local/nagios/etc/nrpe.cfg' - Line 12
Jun 2 14:19:02 localhost nrpe[19843]: No variable value specified in config file '/usr/local/nagios/etc/nrpe.cfg' - Line 14
Jun 2 14:19:02 localhost nrpe[19843]: Config file '/usr/local/nagios/etc/nrpe.cfg' contained errors, aborting...
Jun 2 14:19:02 localhost xinetd[19741]: EXIT: nrpe status=2 pid=19843 duration=0(sec)
Jun 2 14:19:15 localhost xinetd[19741]: START: nrpe pid=19854 from=10.0.2.15
Jun 2 14:19:15 localhost nrpe[19854]: Unknown option specified in config file '/usr/local/nagios/etc/nrpe.cfg' - Line 12
Jun 2 14:19:15 localhost nrpe[19854]: No variable value specified in config file '/usr/local/nagios/etc/nrpe.cfg' - Line 14
Jun 2 14:19:15 localhost nrpe[19854]: Config file '/usr/local/nagios/etc/nrpe.cfg' contained errors, aborting...
Jun 2 14:19:15 localhost xinetd[19741]: EXIT: nrpe status=2 pid=19854 duration=0(sec)
Jun 2 14:19:53 localhost setroubleshoot: SELinux is preventing ping (ping_t) "read write" to /usr/local/nagios/var/spool/checkresults/checkdu3guV (usr_t). For complete SELinux messages. run sealert -l 6c9b693f-15bd-4bdd-8197-f4bea61bfea3


i know i have the SELinux on permissive so i do not knwo why it is preventing some stuff
 
Old 06-02-2010, 01:32 PM   #8
EricTRA
LQ Guru
 
Registered: May 2009
Location: Gibraltar, Gibraltar
Distribution: Fedora 20 with Awesome WM
Posts: 6,805
Blog Entries: 1

Rep: Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297
Hi,

It looks to me that SELinux isn't the only problem you have. I'm not familiar with SELinux, so someone else will have to help out with that (or just disable it temporary to see if that helps). But as showing in the log you have some misconfiguration in your NRPE configuration file. Can you post the config file (masking private info where necessary of course).

Kind regards,

Eric

PS: You can run the
Code:
run sealert -l 6c9b693f-15bd-4bdd-8197-f4bea61bfea3
command as stated in the log to find out more detailed information why SELinux is preventing stuff. Can you post that relevant output also?

Last edited by EricTRA; 06-02-2010 at 01:34 PM.
 
Old 06-02-2010, 01:36 PM   #9
EricTRA
LQ Guru
 
Registered: May 2009
Location: Gibraltar, Gibraltar
Distribution: Fedora 20 with Awesome WM
Posts: 6,805
Blog Entries: 1

Rep: Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297
Oh and please for readability put your 'code' between code tags (#) in the icon bar of the editor. Thank you.

Kind regards,

Eric

Last edited by EricTRA; 06-02-2010 at 01:37 PM.
 
Old 06-02-2010, 01:39 PM   #10
edwardcode
Member
 
Registered: Apr 2010
Posts: 161

Original Poster
Rep: Reputation: 17
Yes I have figured it out. I had like 6 lines that were wrong back to back and i just removed them and it started to work.

Thanks for you help what really helped me was reminding me about the logs. Some times when you spend to much time figureing out one thing you for get the basics. lol

Last edited by edwardcode; 06-02-2010 at 01:59 PM.
 
Old 06-02-2010, 01:48 PM   #11
MensaWater
LQ Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, CoreOS, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 7,831
Blog Entries: 15

Rep: Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669
Some things in nrpe.cfg are ignored when you use xinetd and as you found they're generally noted in nrpe.cfg itself if that is the case.

In your /etc/xinetd.d/nrpe file is where you set the user. Also it has the host that is allowed:

Code:
# default: on
# description: NRPE
service nrpe
{
   flags           = REUSE
   socket_type     = stream
   wait            = no
   user            = nagios
   server          = /usr/local/nagios/bin/nrpe
   server_args     = -c /usr/local/nagios/etc/nrpe.cfg -i
   log_on_failure  += USERID
   disable         = no
   only_from       = x.x.x.x
Where x.x.x.x is the IP of your Nagios server.
 
Old 06-02-2010, 01:49 PM   #12
EricTRA
LQ Guru
 
Registered: May 2009
Location: Gibraltar, Gibraltar
Distribution: Fedora 20 with Awesome WM
Posts: 6,805
Blog Entries: 1

Rep: Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297
Hello,

You'll need to read a bit on how to define the commands that can be executed through NRPE.
Code:
13 /usr/local/nagios/libexec/check_nrpe -H localhost -c check_users
14 /usr/local/nagios/libexec/check_nrpe -H localhost -c check_load
15 /usr/local/nagios/libexec/check_nrpe -H localhost -c check_hda1
16 /usr/local/nagios/libexec/check_nrpe -H localhost -c check_total_procs
17 /usr/local/nagios/libexec/check_nrpe -H localhost -c check_zombie_procs
The above I assume is what you're trying to execute. Delete those lines! Nagios and NRPE doesn't work that way.

When you 'tell' Nagios to run a command named 'check_users' agains a host connecting using the NRPE daemon, the first thing the daemon does, is see if that command exists in his config file (read at the bottom of your config file the examples)
Code:
command[check_users]=
Above is how NRPE 'looks' at command requests received from Nagios. Next NRPE runs the command after the '=' and the output gets reported back to Nagios. Following the command examples (comment them out by removing the # at the beginning of the line) you can format your commands. Of course the scripts you're calling will have to exist and have correct permissions set. But that's the next step

Kind regards,

Eric
 
Old 06-03-2010, 12:16 AM   #13
EricTRA
LQ Guru
 
Registered: May 2009
Location: Gibraltar, Gibraltar
Distribution: Fedora 20 with Awesome WM
Posts: 6,805
Blog Entries: 1

Rep: Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297
Quote:
Originally Posted by edwardcode View Post
Yes I have figured it out. I had like 6 lines that were wrong back to back and i just removed them and it started to work.

Thanks for you help what really helped me was reminding me about the logs. Some times when you spend to much time figureing out one thing you for get the basics. lol
Hi,

Glad you sorted that out One request: please don't just delete or change the content of a post you made if the information might be valuable to other users who are facing the same problems.

If you consider this particular question/problem solved then please mark it as such using the Thread Tools.

Kind regards,

Eric
 
Old 06-03-2010, 05:56 AM   #14
edwardcode
Member
 
Registered: Apr 2010
Posts: 161

Original Poster
Rep: Reputation: 17
ok I will do that. I am kind of new to all of this forum thing. Off of the subject how do you put your code in an other box?
 
Old 06-03-2010, 07:00 AM   #15
MensaWater
LQ Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, CoreOS, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 7,831
Blog Entries: 15

Rep: Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669
When you start to post a reply (not quick reply) there are icons across the top of the box that can be used to put tags around selected text. The one that looks like a little comic strip balloon with text is "quote" and the one next to it that looks like a pound/number sign is "code".

You highlight the text you want in a box then click the code button. It will prepend the highlighted text with "CODE" inside square brackets [] and end it with "/CODE" inside square brackets. When you post it will show up as a code box. The quote button works the same way.

Of course you can always manually type the tags rather than clicking the buttons.

Last edited by MensaWater; 06-03-2010 at 09:48 AM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Nagios: CHECK_NRPE: Error - Could not complete SSL handshake jonaskellens Linux - Newbie 8 08-23-2014 01:56 PM
Not receiving UDP data duttaa Linux - Networking 4 08-19-2009 01:51 AM
Not receiving data from serial modem. ejoe Linux - Hardware 18 04-01-2007 12:35 PM
modem stops receiving data positron Linux - Newbie 3 07-21-2004 03:32 AM
Receiving all data from socket Ohmu Programming 6 03-08-2004 01:58 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 07:31 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration