TotaalscriptSNMPCentos: verschil tussen versies
Uiterlijk
Geen bewerkingssamenvatting |
Geen bewerkingssamenvatting |
||
| Regel 1: | Regel 1: | ||
* yum install -y net-snmp net-snmp-util xinetd git | |||
yum install -y net-snmp net-snmp-util xinetd git | * mv /etc/snmp/snmpd.conf snmpd.conf2.org | ||
mv /etc/snmp/snmpd.conf snmpd.conf2.org | * touch /etc/snmp/snmpd.conf | ||
touch /etc/snmp/snmpd.conf | * chkconfig snmpd on | ||
chkconfig snmpd on | * cd /opt/ | ||
cd /opt/ | * git clone https://github.com/librenms/librenms-agent.git | ||
git clone https://github.com/librenms/librenms-agent.git | * cd librenms-agent | ||
cd librenms-agent | * cp check_mk_agent /usr/bin/check_mk_agent | ||
cp check_mk_agent /usr/bin/check_mk_agent | * chmod +x /usr/bin/check_mk_agent | ||
chmod +x /usr/bin/check_mk_agent | * cp /opt/librenms-agent/snmp/distro /usr/bin | ||
cp /opt/librenms-agent/snmp/distro /usr/bin | * cp check_mk_xinetd /etc/xinetd.d/check_mk | ||
cp check_mk_xinetd /etc/xinetd.d/check_mk | * mkdir -p /usr/lib/check_mk_agent/plugins /usr/lib/check_mk_agent/local | ||
mkdir -p /usr/lib/check_mk_agent/plugins /usr/lib/check_mk_agent/local | * chkconfig xinetd on | ||
chkconfig xinetd on | * cat <<EOT>> /etc/snmp/snmpd.conf | ||
cat <<EOT>> /etc/snmp/snmpd.conf | * # Change RANDOMSTRINGGOESHERE to your preferred SNMP community string | ||
# Change RANDOMSTRINGGOESHERE to your preferred SNMP community string | * com2sec readonly default 4ABpublic | ||
com2sec readonly default 4ABpublic | * group MyROGroup v2c readonly | ||
group MyROGroup v2c readonly | * view all included .1 80 | ||
view all included .1 80 | * access MyROGroup "" any noauth exact all none none | ||
access MyROGroup "" any noauth exact all none none | * | ||
* syslocation Rotterdam, Nl [51.922982,4.431308] | |||
syslocation Rotterdam, Nl [51.922982,4.431308] | * syscontact B.Huijsen <info@4allbusiness.nl> | ||
syscontact B.Huijsen <info@4allbusiness.nl> | * | ||
* #Distro Detection | |||
#Distro Detection | * extend .1.3.6.1.4.1.2021.7890.1 distro /usr/bin/distro | ||
extend .1.3.6.1.4.1.2021.7890.1 distro /usr/bin/distro | * | ||
* #Hardware Detection (uncomment to enable) | |||
#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.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.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' | ||
#extend .1.3.6.1.4.1.2021.7890.4 serial '/bin/cat /sys/devices/virtual/dmi/id/product_serial' | * EOT | ||
EOT | * service snmpd restart | ||
service snmpd restart | * service xinetd restart | ||
service xinetd restart | * | ||
Huidige versie van 24 mei 2018 13:07
- yum install -y net-snmp net-snmp-util xinetd git
- mv /etc/snmp/snmpd.conf snmpd.conf2.org
- touch /etc/snmp/snmpd.conf
- chkconfig snmpd on
- cd /opt/
- git clone https://github.com/librenms/librenms-agent.git
- cd librenms-agent
- cp check_mk_agent /usr/bin/check_mk_agent
- chmod +x /usr/bin/check_mk_agent
- cp /opt/librenms-agent/snmp/distro /usr/bin
- cp check_mk_xinetd /etc/xinetd.d/check_mk
- mkdir -p /usr/lib/check_mk_agent/plugins /usr/lib/check_mk_agent/local
- chkconfig xinetd on
- cat <<EOT>> /etc/snmp/snmpd.conf
- # Change RANDOMSTRINGGOESHERE to your preferred SNMP community string
- com2sec readonly default 4ABpublic
- 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'
- EOT
- service snmpd restart
- service xinetd restart