Install ncpa ubuntu
#!/bin/bash
s
#
. /etc/os-release
#
echo "deb https://repo.nagios.com/deb/$VERSION_CODENAME /" | \
tee /etc/apt/sources.list.d/nagios.list
wget -qO - https://repo.nagios.com/GPG-KEY-NAGIOS-V2 | apt-key add -
apt-get update
apt-get install -y ncpa
#
NCPA_TOKEN=$(echo $(openssl rand --hex 10))
sed --in-place "s/mytoken/$NCPA_TOKEN/g" /usr/local/ncpa/etc/ncpa.cfg
#
systemctl restart ncpa_listener
#
echo $NCPA_TOKEN