nagios core + nagiosxi + Nagios Federated Monitoring

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
vnc786
Posts: 68
Joined: Thu Aug 29, 2013 8:45 am

nagios core + nagiosxi + Nagios Federated Monitoring

Post by vnc786 »

Hi,

How should one proceed to display all nagios core checks results in NagiosXI Server

Reading:
http://support.nagios.com/forum/viewtop ... 29&p=54362
https://assets.nagios.com/downloads/gen ... r_MSPs.pdf
NSCA
jdalrymple
Skynet Drone
Posts: 2620
Joined: Wed Feb 11, 2015 1:56 pm

Re: nagios core + nagiosxi + Nagios Federated Monitoring

Post by jdalrymple »

This is straightforward.

You use nsca on the XI server (already setup, you just have to fiddle with inbound transfer settings)

You use send_nsca on the Core servers, wrapped up with a command that is defined as your ocsp_command and ochp_command:

Code: Select all

define command{
        command_name    ochp_submit
        command_line    $USER1$/submit_ochp.sh $HOSTNAME$ $HOSTSTATEID$ '$HOSTOUTPUT$' '$HOSTPERFDATA$'
        }

define command{
        command_name    ocsp_submit
        command_line    $USER1$/submit_ocsp.sh $HOSTNAME$ '$SERVICEDESC$' $SERVICESTATEID$ '$SERVICEOUTPUT$' '$SERVICEPERFDATA$'
        }

With wrappers that look like this- ish:

submit_ochp.sh:

Code: Select all

#!/bin/bash
CMD=/usr/sbin/send_nsca
CFG=/etc/nagios/send_nsca.cfg
HOST=$1
RESULT=$2
OUTPUT="$3"
PERF="$4"
printf "%b" "${HOST}\t${RESULT}\t${OUTPUT}|${PERF}\n" | $CMD -H nagiosxi.example.com -c $CFG
submit_ocsp.sh

Code: Select all

#!/bin/bash

CMD=/usr/sbin/send_nsca
CFG=/etc/nagios/send_nsca.cfg
HOST=$1
SRV=$2
RESULT=$3
OUTPUT="$4"
PERF="$5"

printf "%b" "${HOST}\t${SRV}\t${RESULT}\t${OUTPUT}|${PERF}\n" | $CMD -H nagiosxi.example.com -c $CFG
Don't forget to configure nsca.cfg (handled by inbound transfer on the XI box) and send_nsca.cfg:

Code: Select all

password=blablablabla
encryption_method=3

Enable the proper settings in nagios.cfg on your core box:

Code: Select all

obsess_over_services=1
obsess_over_hosts=1
ocsp_timeout=5
ocsp_command=ocsp_submit
ochp_command=ochp_submit
And then also make sure that your hosts/services you want to be submitted have the obsess bit turned on,
For hosts:

Code: Select all

obsess_over_host             1
For services:

Code: Select all

obsess_over_service             1
Have fun.
vnc786
Posts: 68
Joined: Thu Aug 29, 2013 8:45 am

Re: nagios core + nagiosxi + Nagios Federated Monitoring

Post by vnc786 »

Hi jdalrymple,

thanks for reply will try & let you know
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: nagios core + nagiosxi + Nagios Federated Monitoring

Post by lmiltchev »

Let us know if you run into some issues.
Be sure to check out our Knowledgebase for helpful articles and solutions!
Locked