Page 2 of 2
Re: Monitor File Contents
Posted: Thu Mar 19, 2020 3:44 am
by mccrakem
Hi
I tested what you suggested but I still got the same answer back NRPE Unable to read ouput
Attached more screenshots, I have it configured to run from a CFG file in the /etc/nrpe.d directory
I was setting this up so I did not have to edit the nrpe.cfg file itself as we push the same file all systems
Thanks
Re: Monitor File Contents
Posted: Thu Mar 19, 2020 9:52 am
by lmiltchev
I missed the fact that you had your command already defined in a separate config under the "/etc/nrpe.d" directory. Make sure you command in defined only in one of the files - nrpe.cfg or you custom config in "/etc/nrpe.d".
Change your command from this:
Code: Select all
command[check_file_content]=/usr/lib64/nagios/plugins/check_file_content.pl -f /opt/IBM/app_users/TestFolder/lastbackuptest.txt -i Successful -n 0
to this:
Code: Select all
command[check_file_content]=sudo /usr/lib64/nagios/plugins/check_file_content.pl -f /opt/IBM/app_users/TestFolder/lastbackuptest.txt -i Successful -n 0
Save, exit, and restart NRPE on the client.
Test your check again from the CLI on the Nagios XI server.
Did this help?
Re: Monitor File Contents
Posted: Fri Mar 20, 2020 5:56 am
by mccrakem
Hi
The command you asked me tyo test is the same command as what I already had in the check_file_content.cfg file
From the local server the command works fine, the NRPE: Unable to read output only appears when trying to run the command from the nagios server itself (remotely)
Thanks
Re: Monitor File Contents
Posted: Fri Mar 20, 2020 8:15 am
by lmiltchev
Let's try one more thing before moving this to a support ticket. You showed us that you can run your command locally, on the remote machine successfully as nagios user. Let's try changing these two lines in the nrpe.cfg file from this:
to this:
Code: Select all
nrpe_user=nagios
nrpe_group=nagios
Restart the nrpe daemon, and try your check again. If this doesn't work, you can change the user/group back to nrpe. Feel free to open a support ticket via our support center here:
https://support.nagios.com/tickets/
A remote session may be necessary to further troubleshoot this issue.
Re: Monitor File Contents
Posted: Mon Mar 23, 2020 6:10 am
by mccrakem
Hi
I tested the above but I still got then same results
I have tried to open a support ticket but its asking for my Account number
I have reached out Internally to our procurement team to see if that can provide me this
Once I get that I will open the request
Thanks
Re: Monitor File Contents
Posted: Mon Mar 23, 2020 9:50 am
by lmiltchev
I have reached out Internally to our procurement team to see if that can provide me this
Once I get that I will open the request
Sounds good. Let us if you have any issues with opening the support ticket.