LibreNMS client installeren en instellen op CentOS

From 4AllBusiness
Jump to navigation Jump to search

LibreNMS op client instelling voor Linux/CentOS

In CentOS het volgende installeren om snmp en xinetd te activeren:

yum install -y net-snmp net-snmp-util xinetd git

Vervolgens de inhoud van de /etc/snmp/snmpd.conf aanpassen naar:

mv /etc/snmp/snmpd.conf snmpd.conf2.org
touch /etc/snmp/snmpd.conf
cat > /etc/snmp/snmpd.conf

copy en paste de volgende tekst na de public name aangepast te hebben sluit af met ctrl-D

# Change RANDOMSTRINGGOESHERE to your preferred SNMP community string
com2sec readonly  default         publicPassAanpassen

group MyROGroup v2c        readonly
view all    included  .1                               80
access MyROGroup ""      any       noauth    exact  all    none   none

syslocation Rotterdam, Nl [51.922982,4.431308]
syscontact B.Huijsen <info@4allbusiness.nl>

#Distro Detection
extend .1.3.6.1.4.1.2021.7890.1 distro /usr/bin/distro

#Hardware Detection (uncomment to enable)
#extend .1.3.6.1.4.1.2021.7890.2 hardware '/bin/cat /sys/devices/virtual/dmi/id/product_name'
#extend .1.3.6.1.4.1.2021.7890.3 manufacturer '/bin/cat /sys/devices/virtual/dmi/id/sys_vendor'
#extend .1.3.6.1.4.1.2021.7890.4 serial '/bin/cat /sys/devices/virtual/dmi/id/product_serial'
chkconfig snmpd on
service snmpd start

Installeer de Unix-agent (mk_agent)

Clone the librenms-agent repository:

cd /opt/
git clone https://github.com/librenms/librenms-agent.git
cd librenms-agent

Copy the relevant check_mk_agent to /usr/bin:

cp check_mk_agent /usr/bin/check_mk_agent
chmod +x /usr/bin/check_mk_agent

Copy the snmp extras to the /usrt/bin

cp /opt/librenms-agent/snmp/distro /usr/bin

Copy the service file(s) into place.

cp check_mk_xinetd /etc/xinetd.d/check_mk

Create the relevant directories.

mkdir -p /usr/lib/check_mk_agent/plugins /usr/lib/check_mk_agent/local

Copy each of the scripts from agent-local/ into /usr/lib/check_mk_agent/local that you require to be graphed. You can find detail setup instructions for specific applications above. Make each one executable that you want to use with chmod +x /usr/lib/check_mk_agent/local/$script Enable the check_mk service

chkconfig xinetd on
service xinetd start

Login to the LibreNMS web interface and edit the device you want to monitor. Under the modules section, ensure that unix-agent is enabled in modules. Then under Applications, enable the apps that you plan to monitor. Wait for around 10 minutes and you should start seeing data in your graphs under Apps for the device.