Page 1 of 1
nagios core + nagiosxi + Nagios Federated Monitoring
Posted: Wed Jun 03, 2015 12:20 pm
by vnc786
Re: nagios core + nagiosxi + Nagios Federated Monitoring
Posted: Wed Jun 03, 2015 12:37 pm
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:
For services:
Have fun.
Re: nagios core + nagiosxi + Nagios Federated Monitoring
Posted: Wed Jun 03, 2015 1:41 pm
by vnc786
Hi jdalrymple,
thanks for reply will try & let you know
Re: nagios core + nagiosxi + Nagios Federated Monitoring
Posted: Wed Jun 03, 2015 3:21 pm
by lmiltchev
Let us know if you run into some issues.