Do you encounter the following issues during the Ubuntu 14.04 System Exploration deployment of the Nagios NRDP plugin?
Test the http:ip/nrdp/Submission results page, always report the following error:
<result><status>-1</status><message>bad COMMAND file</message></result>< Result><status>-1</status><message>bad CHECK RESULTS dir</message></result>
The "Bad COMMAND FILE" "RESULTS DIR" developer defined the two running error message, semantic solution deviation is very large, got two days still no clue, but only in reading plug-in source, respectively found the source of the location, Now write the function of the call to the source of the error message as two test scripts
test_file_exists.php <?php $result =file_exists ("/var/lib/nagios3/spool/checkresults", "C"); Print $result. " \n\r ";?> test_tempnam.php <?php $tmpname =tempnam ("/var/lib/nagios3/spool/checkresults "," C "); print $ Tmpname. " \n\r ";?>
In the Nagios www-data user identity execution, will return different results, plug-ins do not work the normal reason for this, please self-verification,!
Sudo-u nagios test_tempnam.php sudo-u nagios test_file_exists.phpsudo-u www-data test_tempnam.php sudo- U www-data test_file_exists.php
Finally, a temporary workaround is given to change the running user of the Apache service
Vim/etc/apache2/envvarsexport Apache_run_user=nagiosexport Apache_run_group=nagios
Last Test everything OK
Host detection Send results
Python send_nrdp.py–url=http://10.2.0.191/server/–token= "[Email protected]&d" –host=localhost–state=0–output= "OK OK"
Service Detection Send Results
Python send_nrdp.py–url=http://10.2.0.191/server/–token= "[Email protected]&d" –host=localhost–service=check_ disk_passive–state=0–output= "OK OK"
Summary of issues encountered during the deployment of Nagios NRDP plug-ins