Linux - SoftwareThis 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.
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Introduction to Linux - A Hands on Guide
This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.
For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.
Click Here to receive this Complete Guide absolutely free.
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 "22.214.171.124", 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_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?
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
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$.
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.
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.
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.
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.
address [IP of host outside range goes here]
command_line $USER1$/check_nrpe -H [the IP of the NRPE host] -c check_target_host
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.