Page 1 of 1
Service Status: (No output returned from plugin)
Posted: Fri Aug 02, 2013 9:19 am
by logan428
I am getting this error from a service in NagiosXI to monitor a remote host logfile usng the plugin check_logfiles with nrpe. When I define the same service using localhost(NagiosXI server) and without nrpe, the monitoring is fine.
The plugin is installed on both the NagiosXI server and the remote host and is in directory /usr/local/nagios/libexec. The plugin tested OK on both servers when run from command line without using nrpe.
Below is my command and service definition on NagiosXI to monitor the remote host logfile. I am using v2012r2.2 and both of my servers are rhel 6.4:
Commands Definition:
Command Name = check_logfiles
Command Line = $USER1$/check_logfiles $ARG1$
Command Type = check_command
Service Management Definition:
Config Name = test2
Description= test_logfile2
check_command = check_nrpe
*Command View = $USER1$/check_nrpe -H $HOSTADDRESS$ -c $ARG1$
Arg1 = check_logfiles --config=/app/nagiosxi/config/logfiles/alerts/alerts1.cfg
Manage Host = fqdn of my remote host
Template = generic-service
Check Interval = 1
Check Period = 24x7
Notification Period = 24x7
Any assistance would be appreciated. I am trying to evaluate NagiosXI for potential purchase and use with my company. Thanks
Re: Service Status: (No output returned from plugin)
Posted: Fri Aug 02, 2013 10:22 am
by scottwilkerson
On remote system you will need to add the following to the nrpe.cfg
Code: Select all
command[check_logfiles]=/usr/local/nagios/libexec/check_logfiles $ARG1$
And then restart the nrpe daemon
On the XI server change $ARG1$ for the service to
Code: Select all
check_logfiles -a '--config=/app/nagiosxi/config/logfiles/alerts/alerts1.cfg'
Re: Service Status: (No output returned from plugin)
Posted: Fri Aug 02, 2013 1:41 pm
by logan428
I already have the command definition in nrpe.cfg, and ffter restarting xinetd and modifying the $ARG1$ in the Service Config to
check_logfiles -a '--config=/app/nagiosxi/config/logfiles/alerts/alerts1.cfg' ...
I now get the error below:
UNKNOWN - can not load configuration file --config=/app/nagiosxi/config/logfiles/alerts/alerts1.cfg
*is the -a option a nrpe or check_logfiles option?
*Are the single quotes to be included in the definition?
*my check command value is still nrpe, correct?
Thanks
Re: Service Status: (No output returned from plugin)
Posted: Fri Aug 02, 2013 1:58 pm
by yancy
*is the -a option a nrpe or check_logfiles option?
the -a options is nrpe command argument. When NRPE executes the command everything after -a is added as an argument on the command line.
If you're running from the command line, it would be
Code: Select all
check_logfiles '--config=/app/nagiosxi/config/logfiles/alerts/alerts1.cfg'
can you test that from the command line? Can you post the contents of alerts1.cfg as that seems where the issue is.
*Are the single quotes to be included in the definition?
Yes, the single quotes ensure any spaces in the argument are used as spaces in the check command argument (not spaces in nrpe command)
*my check command value is still nrpe, correct?
Not sure what you're asking exactly...
Re: Service Status: (No output returned from plugin)
Posted: Fri Aug 02, 2013 2:02 pm
by yancy
The issue is the your dcdiag is not showing info about fsmo.
can you run the following
and post the output
-Yancy
Re: Service Status: (No output returned from plugin)
Posted: Fri Aug 02, 2013 2:19 pm
by logan428
yancy wrote:The issue is the your dcdiag is not showing info about fsmo.
can you run the following
and post the output
-Yancy
Where is this command. I am usinng RHEL 6.4 servers. Do I run this from my NagiosXI server or the remote host?
Re: Service Status: (No output returned from plugin)
Posted: Fri Aug 02, 2013 2:39 pm
by logan428
yancy wrote:*is the -a option a nrpe or check_logfiles option?
the -a options is nrpe command argument. When NRPE executes the command everything after -a is added as an argument on the command line.
Reason I asked is on your first post, looked like a check_logfiles option. If this is a nrpe option, where should I put this option in the Nagios XI Service GUI?
The nrpe command view looks like this:
$USER1$/check_nrpe -H $HOSTADDRESS$ -c $ARG1$
The $ARG$ is being used for check_logfiles. Can you tell me exactly what should be in the Service definition:
Check Command = ? (currently check_nrpe)
$ARG1$ = ? (currently check_logfiles -a '--config=/app/nagiosxi/config/logfiles/alerts/alerts1.cfg')
I also tried without the -a and did not work
If you're running from the command line, it would be
Code: Select all
check_logfiles '--config=/app/nagiosxi/config/logfiles/alerts/alerts1.cfg'
can you test that from the command line? Can you post the contents of alerts1.cfg as that seems where the issue is.
I run check_logfiles from command line and got the response I expected:
/usr/local/nagios/libexec/check_logfiles --config=/app/nagiosxi/config/logfiles/alerts/alerts1.cfg
OK - no errors or warnings|VPN_lines=0 VPN_warnings=0 VPN_criticals=0 VPN_unknowns=0
* I have also tested with errors on the logfile and check_logfiles detected it.
Contents of alerts1.cfg:
$scriptpath = '/usr/local/nagios/libexec:/usr/local/nagios/bin';
@searches = (
{
tag => 'VPN',
logfile => '/var/em/emalerts.log',
#rotation => 'HPUX',
criticalpatterns => [
'.*LINK_DOWN',
'.*error',
'.*problem'
],
warningpatterns => [
'.*Not Available',
],
#options => 'protocol,count'
#options => 'script',
#script => 'send_nsca',
#scriptparams => '-H $CL_NSCA_HOST_ADDRESS$ -p $CL_NSCA_PORT$ -to $CL_NSCA_TO_SEC$ -c $CL_NSCA_CONFIG_FILE$',
#scriptstdin => '$CL_HOSTNAME$\t$CL_SERVICEDESC$\t CL_SERVICESTATEID$\t$CL_SERVICEOUTPUT$\n',
},
);
*Are the single quotes to be included in the definition?
Yes, the single quotes ensure any spaces in the argument are used as spaces in the check command argument (not spaces in nrpe command)
*my check command value is still nrpe, correct?
Not sure what you're asking exactly...
This is in the NagiosXI Service definiiton...see posts aboove
Re: Service Status: (No output returned from plugin)
Posted: Sat Aug 03, 2013 8:23 am
by scottwilkerson
I am a bit confused what I you are trying to do.
disregarding Nagios for a minute, what are you trying to check with check_logfile? Have you been able to execute the command you want with this plugin on the windows server? If so what does the Windows command look like?
Re: Service Status: (No output returned from plugin)
Posted: Mon Aug 12, 2013 10:10 am
by logan428
Firstly, I am running this on RHEL 6.4 and would like to monitor logfiles using the plugin check_logfiles. As I stated in my previous posts, It works with NagiosXI when monitoring logfile on local server(XI server) but not when using with NRPE to monitor logile on remote hosts.
Here is the command line and output:
[root@app-lab01 libexec]# /usr/local/nagios/libexec/check_logfiles --config /app/nagiosxi/config/logfiles/emalerts/emalerts1.cfg
OK - no errors or warnings|VPN_lines=0 VPN_warnings=0 VPN_criticals=0 VPN_unknowns=0
Re: Service Status: (No output returned from plugin)
Posted: Mon Aug 12, 2013 11:28 am
by sreinhardt
Is that command being run via cli on the remote system or the nagios system? Along the same lines, is the /app/nagiosxi/config/logfiles/emalerts/emalerts1.cfg on the remote system and accessible via the nagios user?