Log Server Mointoring
Re: Log Server Mointoring
[root@nagios ~]# /usr/local/nagios/libexec/check_nrpe -H 67.111.179.155 -c check_log_3 -n
CHECK_NRPE: Error receiving data from daemon.
[root@nagios ~]# /usr/local/nagios/libexec/check_nrpe -H 67.111.179.155 -c check_log_3
OK: Found 0 lines (limit=1/1): No matches found.|lines=0
CHECK_NRPE: Error receiving data from daemon.
[root@nagios ~]# /usr/local/nagios/libexec/check_nrpe -H 67.111.179.155 -c check_log_3
OK: Found 0 lines (limit=1/1): No matches found.|lines=0
Re: Log Server Mointoring
Code: Select all
[root@nagios ~]# /usr/local/nagios/libexec/check_nrpe -H 67.111.179.155 -c check_log_3
OK: Found 0 lines (limit=1/1): No matches found.|lines=0Feel free to change the client machines nrpe.cfg as you see fit - currently it's scanning for the string "someline". You can change this to whatever you'd like.
You could also add several different ones, and issue multiple calls to them. For example:
Client NRPE.cfg:
Code: Select all
command[check_log_3]=/usr/local/nagios/libexec/check_log3.pl -l /var/log/messages -p error -c 1
command[check_log_4]=/usr/local/nagios/libexec/check_log3.pl -l /var/log/httpd/error_log -p 502 -c 1
command[check_log_5]=/usr/local/nagios/libexec/check_log3.pl -l /var/log/cron -p 'cron failure' -c 1Code: Select all
/usr/local/nagios/libexec/check_nrpe -H x.x.x.x -c check_log_3
/usr/local/nagios/libexec/check_nrpe -H x.x.x.x -c check_log_4
/usr/local/nagios/libexec/check_nrpe -H x.x.x.x -c check_log_5Re: Log Server Mointoring
Ok we know that its working now but how come i get this on the XI web
(No output on stdout) stderr: sudo: no tty present and no askpass program specified
(No output on stdout) stderr: sudo: no tty present and no askpass program specified
Re: Log Server Mointoring
Try removing sudo from the XI web interface command - it doesn't appear to be necessary from the command line. After removing the sudo command, report your results back.
Re: Log Server Mointoring
Unable to open '/var/log/messages': Permission denied
even with giving other rw still get same issue.
even with giving other rw still get same issue.
Re: Log Server Mointoring
Can you post a screenshot of what you have configured on the XI GUI please? I would like to see what we're working with so that I can better assist you. Thanks!
Re: Log Server Mointoring
you mean all the service or just the log one?
You do not have the required permissions to view the files attached to this post.
Re: Log Server Mointoring
Forget about that command definition - you can delete it if you want. It would only be useful for checking the contents of your local (XI) machine, not running remote NRPE checks.
What we need to do is define a service that runs a command exactly as we typed it. So, that command being:
/usr/local/nagios/libexec/check_nrpe -H 67.111.179.155 -c check_log_3
Our new service might look something like: Finish filling out all of the appropriate 'service' definitions, and you should be good to go.
What we need to do is define a service that runs a command exactly as we typed it. So, that command being:
/usr/local/nagios/libexec/check_nrpe -H 67.111.179.155 -c check_log_3
Our new service might look something like: Finish filling out all of the appropriate 'service' definitions, and you should be good to go.
You do not have the required permissions to view the files attached to this post.
Re: Log Server Mointoring
OK: Found 0 lines (limit=1/1): No matches found.
Great it works. The issue was I was using the wrong command.
Thank you for you help I appreciate.
I can going to try this on the other server now.
Great it works. The issue was I was using the wrong command.
Thank you for you help I appreciate.
I can going to try this on the other server now.
Re: Log Server Mointoring
No problem - glad I could help out. My apologies for the confusion. Let me know if you have any further questions. Thanks!