LinuxQuestions.org
Register a domain and help support LQ
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 02-09-2007, 11:54 AM   #31
Mangenius
Member
 
Registered: Jan 2007
Posts: 30

Original Poster
Rep: Reputation: 15

Thank you very much for getting back to me.

First: Yes, I installed the nagios plugin package, in addition to the NRPE plugin package, on the NRPE host. NRPE host has check_ping installed.

Second: Yes, that makes sense. I guess that's where the script comes in, to ping the 2nd NRPE host from the 1st NRPE host, which would report back to the Nagios host. The only reason I'm trying to have the first NRPE host do a check_ping of itself, on orders from the Nagios host, is for testing purposes. If this works, then I can move on to the real purpose, which is pinging to the 2nd NRPE host from the 1st NRPE host. But maybe the test (running check_nrpe from the Nagios host and telling the 1st NRPE host to run check_ping on itself) doesn't work because it's not designed for it, I dunno.

Third: That's interesting because I see plugins like check_procs in nrpe.cfg that have been prewritten for hardcoding and passing in arguments. But I suppose hardcoding it would save me some trouble.


Fourth: Oh, yea, I'm doing all nrpe.cfg stuff on the NRPE host. Thank you.

Regarding the pinging of "2.2.2.2", the NRPE host, I can ping to it from the Nagios host, no problem. It takes a little longer to check_NRPE or check_ping the NRPE host from the Nagios host, however. The RTA is well over 5ms, by the way. The default timeout for most plugins is 10 seconds; so, I just appended -t 300, meaning timeout after 300 seconds. In this fashion, I can run check_NRPE from the Nagios host for the NRPE host and I won't get that timeout after 10 seconds deal; 300 seconds should be enough for the plugin to do its job.


I'll try hardcoding the check_ping variables on the NRPE host and play around it like that. Maybe I can try using some other plugins, like check_procs, and see if I get anything.

The two things that befuddle me are, in theory, the nagios host should be able to instruct the NRPE host to ping itself and return its findings back to the NRPE host, via the check_nrpe plugin, and I don't quite understand how services.cfg and nrpe.cfg do not have correlation.

In a default NRPE.cfg file, it shows the following:
command[check_procs]=/usr/local/nagios/libexec/check_procs -w $ARG1$ -c $ARG2$ -s $ARG3$

In checkcommands.cfg, it looks like this:
command_name check_procs
command_line $USER1$/check_procs -w $ARG1$ -c $ARG2$ -s $ARG3$

It's the same thing, right? So, the only way to pass in arguments would be executing the plugin from the command prompt, or services.cfg does the job for you, in the form of a script, right?
 
Old 02-09-2007, 12:49 PM   #32
MensaWater
Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 6,028
Blog Entries: 5

Rep: Reputation: 791Reputation: 791Reputation: 791Reputation: 791Reputation: 791Reputation: 791Reputation: 791
OK it may be NRPE has the $ARG1$ etc... built in but not the $HOSTADDRESS$. That would be similar to the difference between positional parameters and defined parameters in shell:

e.g. If you had a shell script named testvars that said:
echo $HOST $1 $2 $3

Then typed:
testvars 5 7 9

It would just echo 5 7 9 because you hadn't defined HOST anywhere. The $1, $2, $3 are shell built in for positional parameters but HOST is something you would have had to set somewhere (e.g. HOST=myhost) usually within the script.

So it may be you can pass the arguments from the Nagios host to the NRPE host by encapsulating them in quotes. You'd then use the $ARG1$ for your hostname rather than $HOSTADDRESS$.
 
Old 02-09-2007, 04:20 PM   #33
Mangenius
Member
 
Registered: Jan 2007
Posts: 30

Original Poster
Rep: Reputation: 15
I gave up trying to send check_ping. Maybe it is NOT designed to accept host addresses, because ./check_nrpe -H (IP) -c check_ping etc...has a history of reporting that the warning argument for check_ping (NOT check_nrpe) must contain a percentage or number and the first parameter in check_ping is the host IP. I dunno if that's right, but I think it fits the situation. So I moved onto using check_procs. Then I had problems with that. I typed ./check_nrpe -H (NRPE host) -c check_procs and it said NRPE: check_procs is not defined. I went into the NRPE host and check_procs is right there in the same folder as the other plugins. So I said screw this and now I'm just sending check_nrpe. I'm not sending commands for it to execute on the host. I can't imagine having problems with check_nrpe.

I typed ./check_nrpe (NRPE host IP) and it returned NRPE v2.6. Nagios is also returning NRPE v2.6. Thank the lord. Now I gotta pass a command and somehow get this thing to work. I guess I'll try check_procs again.

Update: It's weird. I'll type ./check_nrpe -H (IP of nrpe host) -c check_ping (at the command prompt) and it'll report that warning threshold must be percentage or number. And then I'll go ahead and type ./check_nrpe -H (IP of nrpe host) -c check_procs and it'll say "NRPE: Command 'check_procs' not defined". I think the Nagios host is fine. What I'm thinking is that there's something corrupt on the NRPE host, explicitly related to the NRPE plugin. I might have to reinstall the nrpe plugin on the nrpe host. the other thing that I haven't thought of 'til now is the plugin version. I think the Nagios host and the nrpe host have two different versions of the plugin package. So, I might have to reinstall the plugin package on the NRPE host that matches the version on the plugin package on the Nagios host.

Last edited by Mangenius; 02-09-2007 at 06:21 PM.
 
Old 02-12-2007, 10:54 AM   #34
MensaWater
Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 6,028
Blog Entries: 5

Rep: Reputation: 791Reputation: 791Reputation: 791Reputation: 791Reputation: 791Reputation: 791Reputation: 791
The fact that the check_nrpe host is reporting the host NRPE version correctly suggests to me that the NRPE is probably OK.

The "-c check_ping" you're sending would be telling it to find a command defined as "check_ping" in the nrpe.cfg. Did you modify this entry so it has the values you want hard coded?

If above still is an issue you might want to try commands that are part of the NRPE plugin first to see if they succeed. If so then the issue is with the way you've configured the check_ping command on the NRPE host rather than with the installation itself.
 
Old 02-12-2007, 12:14 PM   #35
Mangenius
Member
 
Registered: Jan 2007
Posts: 30

Original Poster
Rep: Reputation: 15
Well, it seems my coworker got it working while I was away. I don't quite understand it but this is what he did:

First, he just went ahead and administered the original goal, which was to monitor a host that was outside the direct range of the Nagios host, by using the NRPE host as the proxy.

Nagios Host:
-------------
He made a new file (let's call it outside_range.cfg) containing all the services, host, hostgroups, and checkcommands related information within that one file. And I'll only list the relevent information.

define host{
host_name target_host
alias t_h
address [IP of host outside range goes here]
use generic-host
check_command check_target_host
}

define hostgroup{
hostgroup_name target_host_group
alias target_host_group_computers
contact_groups owner
members target_host
}

define command{
command_name check_target_host
command_line $USER1$/check_nrpe -H [the IP of the NRPE host] -c check_target_host
}

define service{
use generic-service
host_name target_host
service_description target_host_ping
check_command check_target_host
}


NRPE host
-----------
Here, he only edited the nrpe.cfg file.

He set don't_blame_nrpe to 0.

command[check_target_host]=/usr/local/nagios/libexec/check_ping -H [IP of target_host] -w 100.0,20% -c 500.0,60% -p 5 -t 300


So now it all works. There might be some other information I'm missing; I've yet to ask him specifically how he did it, as I just observed the changes made and made the following conclusions.
 
Old 02-12-2007, 01:04 PM   #36
MensaWater
Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 6,028
Blog Entries: 5

Rep: Reputation: 791Reputation: 791Reputation: 791Reputation: 791Reputation: 791Reputation: 791Reputation: 791
Essentially he did what I suggested. He created a setup where he wasn't trying to pass any environment variables into NRPE.
 
Old 02-12-2007, 01:21 PM   #37
Mangenius
Member
 
Registered: Jan 2007
Posts: 30

Original Poster
Rep: Reputation: 15
Exactly. I wanted to try and pass arguments into NRPE, but it wouldn't budge, ya know? For now, it's a mystery why it complains about passing in arguments, and my only hunch is a discrepency between plugin package versions -- the NRPE host contains a newer plugin package than the Nagios host. He doesn't know what's the problem is, either. If I would've hardcoded it like you said, I'm sure we would've gotten it working. Those scripts will come in mighty handy, I know it!

This has been a long thread and I couldn't have troubleshooted this problem without your help. I came out of this with more knowledge than I had going in, thanks to you. Thank you for your patience and the time you devoted for me. I sincerely appreciate it. If I ever have more problems, I know who to bug lol.

All the best,

Jeff
 
  


Reply

Tags
monitoring, nagios, nrpe


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
squid proxy server configuration & distribution of internet without proxy gaurav_gupta082 Linux From Scratch 2 07-31-2010 12:25 PM
Nagios - nrpe plugin configuration nitin-saxena Linux - Software 1 10-27-2006 02:50 PM
Proxy configuration tsaravan Linux - Newbie 1 08-04-2005 07:28 AM
Nagios NRPE twantrd Linux - Software 1 10-20-2004 09:24 AM
Proxy configuration milon Linux - Newbie 1 09-26-2004 10:24 AM


All times are GMT -5. The time now is 02:42 PM.

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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration