Hello ,
I success installalled NRDP and now I send the output of services monitored by my nagios core to nagiosXI with NRDP .
In my landscape I have 2 nagiosXI servers , one for dev and test system and another for production systems.
In some remote sites I have installed nagios core servees with svil , test and prod system monitored .
I tried without succcess to creare in the command.cfg 2 commands and add the follow line in the nagios.cfg file :
nagios.cfg :
# NRDP Send Data to NagiosXI
ochp_command=send_nrdp_host , send_nrdp_host_prod
ocsp_command=send_nrdp_service , send_nrdp_service_prod
command.cfg
define command{
command_name send_nrdp_host
command_line $USER1$/send_nrdp.php --url=http://xxx.xxx.xxx.xxx/nrdp/ --token=mytoken --host="$HOSTNAME$" --state=$HOSTSTATEID$ --output="$HOSTOUTPUT$"
}
define command{
command_name send_nrdp_service
command_line $USER1$/send_nrdp.php --url=http://xxx.xxx.xxx.xxx/nrdp/ --token=mytoken --host="$HOSTNAME$" --service="$SERVICEDESC$" --state=$SERVICESTATEID$ --output="$SERVICEOUTPUT$"
}
command_name send_nrdp_host_prod
command_line $USER1$/send_nrdp.php --url=http://xxx.xxx.xxx.xxx/nrdp/ --token=mytoken --host="$HOSTNAME$" --state=$HOSTSTATEID$ --output="$HOSTOUTPUT$"
}
define command{
command_name send_nrdp_service_prod
command_line $USER1$/send_nrdp.php --url=http://xxx.xxx.xxx.xxx/nrdp/ --token=mytoken --host="$HOSTNAME$" --service="$SERVICEDESC$" --state=$SERVICESTATEID$ --output="$SERVICEOUTPUT$"
}
This is possible to send the output of services monitored by nagios core to 2 nagiosXI servers wth NRDP ?
Thanks in advance
Davide
NDRP - Send output from 1 nagios core to 2 nagiosXI servers
Re: NDRP - Send output from 1 nagios core to 2 nagiosXI serv
Hi
Here's what I came up with. I create a command that calls a script that runs the send_nrdp command twice, once for each server.
So on the core machine I edited commands.cfg to add:
I edited localhost.cfg and changed the host alias:
and I defined a service:
in /usr/local/nagios/libexec I created a file called "nrdptwice":
Give that a try.
Thanks
Here's what I came up with. I create a command that calls a script that runs the send_nrdp command twice, once for each server.
So on the core machine I edited commands.cfg to add:
Code: Select all
define command {
command_name nrdptwice
command_line $USER1$/nrdptwice $HOSTALIAS$ $HOSTSTATEID$ $HOSTOUTPUT$
}
Code: Select all
define host {
use linux-server ; Name of host template to use
; This host definition will inherit all variables that are defined
; in (or inherited by) the linux-server host template definition.
host_name localhost
alias mycoreserver
address 127.0.0.1
}Code: Select all
define service {
use local-service ; Name of service template to use
host_name localhost
service_description nrdp2
check_command nrdptwice
}in /usr/local/nagios/libexec I created a file called "nrdptwice":
Code: Select all
#!/bin/sh
/usr/local/nrdp/clients/send_nrdp.php --url=http://192.168.23.81/nrdp/ --token=nrdptoken --host=$1 --state=$2 --output=$3
/usr/local/nrdp/clients/send_nrdp.php --url=http://192.168.23.82/nrdp/ --token=nrdptoken --host=$1 --state=$2 --output=$3
Thanks