apt-get install libpve-apiclient-perl sudo
wget https://raw.githubusercontent.com/librenms/librenms-agent/master/agent-local/proxmox -O /etc/snmp/proxmox
chmod +x /etc/snmp/proxmox
wget -O /etc/snmp/distro https://raw.githubusercontent.com/librenms/librenms-agent/master/snmp/distro
chmod +x /etc/snmp/distro
#修改 /etc/sudoers
echo "Debian-snmp ALL=(ALL) NOPASSWD: /etc/snmp/proxmox">> /etc/sudoers
#修改 /etc/snmp/snmpd.conf
mv /etc/snmp/snmpd.conf /etc/snmp/snmpd.conf.ori
cat <
rocommunity public 192.168.0.0/16
syslocation 5FG
syscontact email@email
extend hardware "/bin/cat /sys/devices/virtual/dmi/id/product_name"
extend manufacturer "/bin/cat /sys/devices/virtual/dmi/id/sys_vendor"
extend distro "/etc/snmp/distro"
extend proxmox "/usr/bin/sudo /etc/snmp/proxmox"
EOF
systemctl enable snmpd
systemctl start snmpd
沒有留言:
張貼留言