NRDP
Re: NRDP
Do you see anything in the Apache error logs on the Nagios system when you send to it?
Can you post the command you are using to send the NRDP data from the client?
Did you enable the accept passive checks in the nagios.cfg file?
Can you post the command you are using to send the NRDP data from the client?
Did you enable the accept passive checks in the nagios.cfg file?
Be sure to check out our Knowledgebase for helpful articles and solutions!
Re: NRDP
Hello,
Thanks for the reply,
@Eloyd
I am not even getting a "Got host checkresult for 'NOTAREALHOST'" Error in the nagios log,.
@Tgriep
- Passive checks are enabled on the box.
- I do not know where to find the apache error log. I googled it and it should be in /var/log/apache2/ but did not find.
- My NRDP is installed correctly and successfully tested when going to http://nagiosxi//nrdp and entering the token.
My NRDP Command is the below:
Best Regards,
Peter
Thanks for the reply,
@Eloyd
I am not even getting a "Got host checkresult for 'NOTAREALHOST'" Error in the nagios log,.
@Tgriep
- Passive checks are enabled on the box.
- I do not know where to find the apache error log. I googled it and it should be in /var/log/apache2/ but did not find.
- My NRDP is installed correctly and successfully tested when going to http://nagiosxi//nrdp and entering the token.
My NRDP Command is the below:
Code: Select all
/home/nagiosscripts/send_nrdp.sh -u http://172.25.25.28/nrdp/ -t df23m7jadI34 -H "172.25.25.28" -s "DB_STATUS" -S 2 -o "DB status is DOWN"Peter
Re: NRDP
Try /var/log/httpd instead.peter19x wrote: @Tgriep
- I do not know where to find the apache error log. I googled it and it should be in /var/log/apache2/ but did not find.
Eric Loyd • http://everwatch.global • 844.240.EVER • @EricLoyd
I'm a Nagios Fanatic! • Join our public Nagios Discord Server!
Re: NRDP
Another place to look for any errors is on the server that is running the send_nrpd.sh script.
It should create XML files in the /tmp folder and if it cannot connect to the remote server, it should log it there.
The file should look similar to this.
/tmp/nrdp.XXXXXX
It should create XML files in the /tmp folder and if it cannot connect to the remote server, it should log it there.
The file should look similar to this.
/tmp/nrdp.XXXXXX
Be sure to check out our Knowledgebase for helpful articles and solutions!
Re: NRDP
Hello All,
Thank you for the reply,
I have found 2 files is /var/log/httpd: access_log and error_log.
When I tried to send my passive check from 172.25.25.11 I get the following in:
1) access_log:
2) error_log:
Any Idea What might cause this error?
Best Regards,
Peter
Thank you for the reply,
I have found 2 files is /var/log/httpd: access_log and error_log.
When I tried to send my passive check from 172.25.25.11 I get the following in:
1) access_log:
Code: Select all
172.25.25.11 - - [23/Jun/2016:13:04:14 +0100] "POST /nrdp// HTTP/1.1" 200 170 "-" "curl/7.22.0 (x86_64-unknown-linux-gnu) libcurl/7.22.0 OpenSSL/1.0.0e zlib/1.2.5 c-ares/1.7.5 libidn/1.22 libssh2/1.2.9"Code: Select all
[Thu Jun 23 13:04:14 2016] [error] [client 172.25.25.11] PHP Warning: date(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'Europe/London' for 'BST/1.0/DST' instead in /usr/local/nrdp/server/plugins/nagioscorepassivecheck/nagioscorepassivecheck.inc.php on line 105
[Thu Jun 23 13:04:14 2016] [error] [client 172.25.25.11] PHP Warning: chgrp(): Operation not permitted in /usr/local/nrdp/server/plugins/nagioscorepassivecheck/nagioscorepassivecheck.inc.php on line 119Best Regards,
Peter
Re: NRDP
I see two things wrong.
1) you need to edit /etc/php.ini and set your proper timezone (search for "date.timezone" without the quotes).
2) it seems like you may have a misconfigured nagios group for the nagios command file. See the following.
To help figure out number 2, can you post the output of this commands on your core machine:
I don't have the same code you do, so I'm not sure which chgrp is the problem, but it's likely that it's having a problem sending the output of the command to the nagios.cmd file. Knowing the output of the above commands will help me say for sure, but I'm guessing that's the problem.
1) you need to edit /etc/php.ini and set your proper timezone (search for "date.timezone" without the quotes).
2) it seems like you may have a misconfigured nagios group for the nagios command file. See the following.
To help figure out number 2, can you post the output of this commands on your core machine:
Code: Select all
head -130 /usr/local/nrdp/server/plugins/nagioscorepassivecheck/nagioscorepassivecheck.inc.php | tail -20
grep command /usr/local/nrdp/server/config.inc.php
Eric Loyd • http://everwatch.global • 844.240.EVER • @EricLoyd
I'm a Nagios Fanatic! • Join our public Nagios Discord Server!
Re: NRDP
Hello @Eloyd.
Thanks for the reply.
Below are the output of the two commands you requested.
Best Regards,
Peter
Thanks for the reply.
Below are the output of the two commands you requested.
Code: Select all
[root@GSIP_MGNT_A httpd]# head -130 /usr/local/nrdp/server/plugins/nagioscorepassivecheck/nagioscorepassivecheck.inc.php | tail -20
fprintf($fh,"exited_ok=1\n");
fprintf($fh,"return_code=%d\n",$state);
fprintf($fh,"output=%s\\n\n",$output);
// close the file
fclose($fh);
// change ownership and perms
chgrp($tmpname,$cfg["nagios_command_group"]);
chmod($tmpname,0770);
// create an ok-to-go, so Nagios Core picks it up
$fh=fopen($tmpname.".ok","w+");
fclose($fh);
$total_checks++;
}
output_api_header();Code: Select all
[root@GSIP_MGNT_A httpd]# grep command /usr/local/nrdp/server/config.inc.php
// the name of the system group that has write permissions to the external command file
// this group is also used to set file permissions when writing bulk commands or passive check results
$cfg["nagios_command_group"]="nagcmd";
// full path to Nagios external command file
$cfg["command_file"]="/usr/local/nagios/var/rw/nagios.cmd";Peter
Re: NRDP
Hello,
I found out some other useful information.
The error :
The line 119:
$tmpname = /usr/local/nagios/var/spool/checkresults
$cfg["nagios_command_group"] = nagcmd
Now I went to /usr/local/nagios/var/spool/checkresults
And I found out everytime I send a passive check a file is create in this directory as below :
somehow the apache user is the owner of the file so the chgrp command will not work because the script is running as nagios user.
Any idea how to get around that?
Best Regards,
Peter
I found out some other useful information.
The error :
Code: Select all
PHP Warning: chgrp(): Operation not permitted in /usr/local/nrdp/server/plugins/nagioscorepassivecheck/nagioscorepassivecheck.inc.php on line 119Code: Select all
chgrp($tmpname,$cfg["nagios_command_group"]);$cfg["nagios_command_group"] = nagcmd
Now I went to /usr/local/nagios/var/spool/checkresults
And I found out everytime I send a passive check a file is create in this directory as below :
Code: Select all
-rw-r--r--. 1 apache apache 0 Jun 24 12:27 ctyy9e7.okAny idea how to get around that?
Best Regards,
Peter
Re: NRDP
Peter,
You hit the nail on the head while I was driving in to the office.
You need to make it so your web server can write to your Nagios file. This is most easily accomplished by adding the "nagcmd" group to the "apache" user via this command:
You can verify it worked by typing the first line below. You should see something similar to the second line:
(Edit: comma, not space, between group names when using usermod command)
You hit the nail on the head while I was driving in to the office.
You need to make it so your web server can write to your Nagios file. This is most easily accomplished by adding the "nagcmd" group to the "apache" user via this command:
Code: Select all
usermod apache -a -G nagcmd,nagios
Code: Select all
# groups apache
apache : apache nagios nagcmd
Last edited by eloyd on Fri Jun 24, 2016 9:34 am, edited 2 times in total.
Eric Loyd • http://everwatch.global • 844.240.EVER • @EricLoyd
I'm a Nagios Fanatic! • Join our public Nagios Discord Server!