Page 1 of 3

integration of nagios core to nagiosxi

Posted: Fri Jul 27, 2012 8:21 am
by lntinfo
Hi i would like to have nagios core alerts in nagiosxi.

how can i move with this.


having 10 nagios slave servers reporting to master..
now i will install fresh instance of nagios xi & those 10 server should report to nagiosxi.

Re: integration of nagios core to nagiosxi

Posted: Fri Jul 27, 2012 8:54 am
by scottwilkerson
Here's an example using NSCA

The major goal of the noncentral server is to distribute the results of all service checks to the central server. The noncentral
Nagios machines must use OCSP and OCHP in order to send the proper updates to the central server.

The default nagios.cfg has these settings.

Code: Select all

obsess_over_services=0
#ocsp_command=somecommand
obsess_over_hosts=0
#ochp_command=somecommand
Change the nagios.cfg settings to those below. The timeout prevents your Nagios server from spending too much time
on one command.

Code: Select all

obsess_over_services=1
ocsp_command=service_check
ocsp_timeout=5
obsess_over_hosts=1
ochp_command=host_check
ochp_timeout=5
You will need to create two scripts in the /usr/local/nagios/libexec/eventhandlers (RPM repository
/usr/lib/nagios/plugins/eventhandlers/) directory.

service_check

Code: Select all

#!/bin/bash
# Service Check
cmd="/usr/local/nagios/bin/send_nsca"
cfg="/usr/local/nagios/etc/send_nsca.cfg"
host=$1
srv=$2
result=$3
output=$4
/bin/echo -e
"$host\t$srv\t$result\t$output\n" | $cmd -h <CENTRAL_NAGIOS_IP> -c $cfg
host_check

Code: Select all

#!/bin/bash
# Host Check
cmd="/usr/local/nagios/bin/send_nsca"
cfg="/usr/local/nagios/etc/send_nsca.cfg"
host=$1
result=$2
output=$3
/bin/echo -e
"$host\t$result\t$output\n" | $cmd -h <CENTRAL_NAGIOS_IP> -c $cfg

Code: Select all

chmod 755 service_check
chmod 755 host_check
chown nagios:nagios *
Create a file called misccommands.cfg in the /usr/local/nagios/etc/objects (RPM repository /etc/nagios/objects)
directory so you can add the new commands.

Code: Select all

define command{
command_name service_check
command_line $USER1$/eventhandlers/service_check $HOSTNAME$ '$SERVICEDESC$' $SERVICESTATEID$ '$SERVICEOUTPUT$'
}
define command{
command_name host_check
command_line $USER1$/eventhandlers/host_check $HOSTNAME$ $SERVICESTATEID$ '$SERVICEOUTPUT$'
}
Be sure to add this line to your nagios.cfg file.

Code: Select all

cfg_file=/usr/local/nagios/etc/objects/misccommands.cfg

Re: integration of nagios core to nagiosxi

Posted: Mon Aug 27, 2012 5:36 am
by ltifst
Hi,

In my organization we have six locations; we have deployed a Nagios XI server at our central location and configured all other location hosts through MPLS link. Also most we have configured 900 hosts and 3500 services. Now I am facing a challenge in this setup whenever our MPLS link goes down other location hosts are showing down state and availability reports are not cleared.

Any one gives me an idea for overcome in this satiation.

Regards,
litfst

Re: integration of nagios core to nagiosxi

Posted: Mon Aug 27, 2012 9:26 am
by scottwilkerson
Have you setup parent child relationships so if the mpls goes down nagios can deduce that the items beyond that are unreachable.

Re: integration of nagios core to nagiosxi

Posted: Mon Aug 27, 2012 9:31 am
by ltifst
Hi,

Yes, I have configured parent child relationships but its showing unreachable during mpls outage we need to monitor other location hosts and if we take month availability reports it should not show unreachable.

Pls. help.

Re: integration of nagios core to nagiosxi

Posted: Tue Aug 28, 2012 9:05 am
by ltifst
any soulution?

Re: integration of nagios core to nagiosxi

Posted: Tue Aug 28, 2012 9:27 am
by mguthrie
To my knowledge the availability report will reflect the unreachable states for the child hosts, which would be accurate in terms of calculating availability. The availability report doesn't currently factor in parent-child relationships for outages.

Re: integration of nagios core to nagiosxi

Posted: Tue Aug 28, 2012 9:29 am
by nscott
Was writing the post and mguthrie beat me to the punch, but to reiterate:

That sounds like expected behavior. It should show unreachable when the MPLS is down. The unreachable part doesn't necessarily mean down and that is reflected in some of the Nagios reports, it lists the percentage time it was unreachable and percentage time it was down.

Re: integration of nagios core to nagiosxi

Posted: Mon Sep 03, 2012 10:10 am
by lntinfo
Hi,

Just I am strart doing POC for Nagios xi and core for distributed monitoring, in xi I have enabled inbound transfer setting using NSCA.

Nagios xi is my central server
nagios core is non central server

what I need to do in core? how to install NSCA in core?

Pls. help.

Re: integration of nagios core to nagiosxi

Posted: Tue Sep 04, 2012 9:11 am
by ltifst
hi,

I have done all the above steps for distribution monitoring, when I am seeing in my noncentral server /var/log/message the below error is comming.

Sep 4 19:40:00 lntnagiosxi nagios: Warning: Attempting to execute the command "/usr/local/nagios/libexec/eventhandlers/host_check XXXXX $SERVICESTATEID$ '$SERVICEOUTPUT$'" resulted in a return code of 127. Make sure the script or binary you are trying to execute actually exists...

Sep 4 19:40:10 lntnagiosxi nagios: Warning: Attempting to execute the command "/usr/local/nagios/libexec/eventhandlers/service_check XX.XX.XX.XX 'Ping' 0 'OK - XX.XX.XX.XX: rta 2.213ms, lost 0%'" resulted in a return code of 127. Make sure the script or binary you are trying to execute actually exists...

Sep 4 19:40:10 lntnagiosxi nagios: Warning: Attempting to execute the command "/usr/local/nagios/libexec/eventhandlers/service_check XX_XXpore_Pri 'Ping' 0 'OK - XX.XX.XX.XX: rta 6.860ms, lost 0%'" resulted in a return code of 127. Make sure the script or binary you are trying to execute actually exists...

Sep 4 19:40:10 lntnagiosxi nagios: Warning: Attempting to execute the command "/usr/local/nagios/libexec/eventhandlers/service_check XX_sing_bakro 'Serial0/0/0 Status' 0 'OK: Interface Serial0/0/0 (index 3) is up.'" resulted in a return code of 127. Make sure the script or binary you are trying to execute actually exists...