Last active
July 23, 2020 07:29
-
-
Save realtebo/e46f3f4aa0c33aae3c88035ada929a14 to your computer and use it in GitHub Desktop.
Install NCPA for Nagios on Debian 10 (on the remote controlled server, not on the controller)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Nota - Se eseguendo dpk c'è un errore di comandi non trovati | |
# su | |
# nano /root/.bashrc | |
# appendero in fondo | |
# export PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin | |
# salvare | |
# source /root/.bashrc | |
su | |
apt install libssl-dev | |
cd /tmp | |
wget https://assets.nagios.com/downloads/ncpa/ncpa-latest.d9.amd64.deb | |
dpkg -i ./ncpa-latest.d9.amd64.deb | |
rm /tmp/ncpa-latest.d9.amd64.deb | |
# change the community_token as you want (will be used as a password | |
# open config | |
# nano /usr/local/ncpa/etc/ncpa.cfg | |
# go to the section name | |
# Listener Configuration (API) | |
# and change the row | |
# community_string = mytoken | |
# as you want | |
# or executes | |
sed -i 's/community_string = mytoken/community_string = mynewtoken/' /usr/local/ncpa/etc/ncpa.cfg | |
# start the service | |
systemctl enable ncpa_listener.service | |
systemctl start ncpa_listener.service | |
########################################## | |
# FROM HERE ONLY IF NOT USING UFW # | |
########################################## | |
# Configure the firewall | |
iptables -I INPUT -p tcp --destination-port 5693 -j ACCEPT | |
apt-get install -y iptables-persistent | |
# Answer yes to saving existing rules | |
# OR create a /etc/iptables/rules.v4 file containing only needed ruleset | |
# | |
########################################## | |
# FROM HERE ONLY IF USING UFW # | |
########################################## | |
ufw allow 5693 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment