Page 1 of 1

System Logging Daemon : NRPE: Unable to read output

Posted: Thu Jan 10, 2013 6:06 am
by bojha
Hi All,

We have installed Nagios Xi Version--- Nagios XI 2011R1.9
and one linux host group and we assign one service System logging daemon in the group level so that every host coming under this group is using the service.

below is the definition

Service Definition
define service {
service_description System Logging Daemon
use linux
hostgroup_name Linux
check_command check_nrpe!check_init_service!-a 'rsyslog'!!!!!!
register 1
}

our aim is to keep all the linux servers in a single group and assign the service in a group level but we have different version of servers running. Since the service is trying to execute the rsyslog command in the remote host . and some of the servers are RHEL 5.x it is not supporting this version instead looking for syslog.

Just for experiment i changed the command argument from rsyslog to syslog in the nagios then i observed
system logging daemon for all the servers with version RHEL 5.x starts working but for RHEL 6.x through the nrpe unable to read and vice verse .

what i am trying to know is , is there any way through which we can use both the command(rsyslog and syslog) in the same command definition and will execute the appropriate command with respect to the version(RHEL 5/6).

or do we need to create a separate host group for different version and will use one different command for that ?


Please suggest us what approach we need to follow.


Thanks in advance,

Bijay Ojha

Re: System Logging Daemon : NRPE: Unable to read output

Posted: Thu Jan 10, 2013 10:44 am
by abrist
You would have to write a custom plugin, or edit the one you are currently using. It will need logic to identify what version of RHEL the system is running and then check the proper logger. Or you could use a different hostgroup and check.

Hostgroup/different check method is easier and faster to implement, but editing the plugin to detect and support both loggers is cleaner.

Re: System Logging Daemon : NRPE: Unable to read output

Posted: Wed Jan 23, 2013 4:20 am
by bojha
Thanks for your replay,

Finally we resolved that issues bye using the macro concept by which we give an free variable to the host definition and from our custom plugin we read that version and executable command and assigned to the variable then from this plugin we call the check_nrpe plugin with the specified variable(command) which is giving the expected result.


Thanks,

Bijay

Re: System Logging Daemon : NRPE: Unable to read output

Posted: Wed Jan 23, 2013 10:16 am
by slansing
Excellent, thanks for letting us know that this got resolved, and thanks for the explanation of your solution!