Last active
November 25, 2020 17:01
-
-
Save realtebo/147bcb09c2960a6479533e45c5b218e5 to your computer and use it in GitHub Desktop.
Install NCPA on a Debian 10 [on the remote machine to be controlled by nagios]
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
# All steps on debian require root | |
# DO NOT TRY THIS ON DEBIAN 8 - It will not works ! | |
# Note the `-`. Is important ! | |
su - | |
cd /tmp | |
wget https://assets.nagios.com/downloads/ncpa/ncpa-latest.d9.amd64.deb | |
# NOTE: if you got this problem or similar : | |
# dpkg: warning: 'start-stop-daemon' not found in PATH or not executable | |
# you are not using `su -`. | |
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 | |
# Restart the service | |
systemctl restart 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