System Logging Daemon : NRPE: Unable to read output

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
bojha
Posts: 55
Joined: Thu Jul 26, 2012 1:18 am

System Logging Daemon : NRPE: Unable to read output

Post 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
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

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

Post 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.
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
bojha
Posts: 55
Joined: Thu Jul 26, 2012 1:18 am

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

Post 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
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

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

Post by slansing »

Excellent, thanks for letting us know that this got resolved, and thanks for the explanation of your solution!
Locked