Thursday, March 18, 2010

Nagios - NSCA setup details

NSCA server configured on this sevrer ( for centralized monitoring purpose)

Following things are setup, for future refrence.


#cat /etc/nagios/nsca.cfg

server_port=5667
server_address=10.11.128.62
nsca_user=nagios
nsca_group=nagios
debug=1
password= *******
decryption_method=1


Port entry in services

#cat /etc/services | grep 5667
nsca 5667/tcp # Nagios Server check acceptor


[root@sgd1mon01 ~]# cat /etc/xinetd.d/nsca
# default: off
# description: NSCA (Nagios Service Check Acceptor)
service nsca
{
flags = REUSE
type = UNLISTED
port = 5667
socket_type = stream
wait = no
user = nagios
group = nagios
server = /usr/sbin/nsca
server_args = -c /etc/nagios/nsca.cfg --inetd
log_on_failure += USERID
disable = no
only_from = 127.0.0.1
}

* only_from :- add ip address, seprate by space, from which the NSCA may be addressed.


Client side Configuration

The conf file send_nsca.cfg on client side must contain same parameter.

password= ******
decryption=1


Testing command from client side. ( send_nsca -H 10.131.11.142 -p 5667 -c /usr/local/nagios/etc/send_nsca.cfg )

Or we can try with script.

[root@nagios etc]# cat test_nsca
#!/bin/bash
CFG="/usr/local/nagios/etc/send_nsca.cfg"
CMD="linux01;nmbd;3;UNKNOWN - just one NSCA test"

/bin/echo $CMD | /usr/local/bin/send_nsca -H 10.131.11.142 -d ';' -c $CFG

[root@nagios etc]# ./test_nsca
1 data packet(s) sent to host successfully.

Mean connectivity through.

0 comments: