#!/bin/bash

# Alias: TCP port number for NSCA
# Menu: Distributed Monitoring
# Description:
#  Configure the TCP port used for NSCA

case "$1" in
    default)
        echo "5667"
    ;;
    choices)
        echo "[0-9]{1,5}"
    ;;
    set)
        sed -ri 's/^([[:space:]]*server_port[[:space:]]*=[[:space:]]*)([0-9]+)/\1'$2'/' $OMD_ROOT/etc/nsca/nsca.cfg
    ;;
    depends)
        [ "$CONFIG_CORE" != none -a "$CONFIG_NSCA" = on ]
    ;;
esac
