Log Server Mointoring

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
gdolidze
Posts: 154
Joined: Tue Apr 07, 2015 10:07 am

Re: Log Server Mointoring

Post by gdolidze »

[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
jolson
Attack Rabbit
Posts: 2560
Joined: Thu Feb 12, 2015 12:40 pm

Re: Log Server Mointoring

Post by jolson »

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=0
Good stuff - so it's working!

Feel 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 1
From XI:

Code: 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_5
Twits Blog
Show me a man who lives alone and has a perpetually clean kitchen, and 8 times out of 9 I'll show you a man with detestable spiritual qualities.
gdolidze
Posts: 154
Joined: Tue Apr 07, 2015 10:07 am

Re: Log Server Mointoring

Post by gdolidze »

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
jolson
Attack Rabbit
Posts: 2560
Joined: Thu Feb 12, 2015 12:40 pm

Re: Log Server Mointoring

Post by jolson »

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.
Twits Blog
Show me a man who lives alone and has a perpetually clean kitchen, and 8 times out of 9 I'll show you a man with detestable spiritual qualities.
gdolidze
Posts: 154
Joined: Tue Apr 07, 2015 10:07 am

Re: Log Server Mointoring

Post by gdolidze »

Unable to open '/var/log/messages': Permission denied

even with giving other rw still get same issue.
jolson
Attack Rabbit
Posts: 2560
Joined: Thu Feb 12, 2015 12:40 pm

Re: Log Server Mointoring

Post by jolson »

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!
Twits Blog
Show me a man who lives alone and has a perpetually clean kitchen, and 8 times out of 9 I'll show you a man with detestable spiritual qualities.
gdolidze
Posts: 154
Joined: Tue Apr 07, 2015 10:07 am

Re: Log Server Mointoring

Post by gdolidze »

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.
jolson
Attack Rabbit
Posts: 2560
Joined: Thu Feb 12, 2015 12:40 pm

Re: Log Server Mointoring

Post by jolson »

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:
2015-05-14 13_48_26-Nagios XI - Nagios Core Config Manager.png
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.
Twits Blog
Show me a man who lives alone and has a perpetually clean kitchen, and 8 times out of 9 I'll show you a man with detestable spiritual qualities.
gdolidze
Posts: 154
Joined: Tue Apr 07, 2015 10:07 am

Re: Log Server Mointoring

Post by gdolidze »

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.
jolson
Attack Rabbit
Posts: 2560
Joined: Thu Feb 12, 2015 12:40 pm

Re: Log Server Mointoring

Post by jolson »

No problem - glad I could help out. My apologies for the confusion. Let me know if you have any further questions. Thanks!
Twits Blog
Show me a man who lives alone and has a perpetually clean kitchen, and 8 times out of 9 I'll show you a man with detestable spiritual qualities.
Locked