Versi Ubuntu: Ubuntu 14.04.1 LTS
Versi SNMP: 5.7.2
Masalah pendek: Banyak entri dalam file konfigurasi "default" rusak. Yang tidak terlalu penting karena saya bahkan tidak bisa memulai SNMP.
Hasil yang Diinginkan: Saya ingin instance SNMP yang berfungsi, yang memiliki sebanyak mungkin fungsi default di dalamnya.
CATATAN: Dari banyak sumber, termasuk situs web Ubuntu yang dimiliki Canonical, dikatakan bahwa saya harus memodifikasi export
dan SNMPDOPTS
, agar memiliki fungsi dasar.
/etc/default/snmpd
export MIBS=UCD-SNMP-MIB
SNMPDRUN=yes
SNMPDOPTS='-Lsd -Lf /dev/null -u snmp -g snmp -I -smux -p /var/run/snmpd.pid -c /etc/snmp/snmpd.conf'
TRAPDRUN=no
TRAPDOPTS='-Lsd -p /var/run/snmptrapd.pid'
SNMPDCOMPAT=yes
/etc/snmp/snmpd.conf
view systemonly included .1.3.6.1.2.1.1
view systemonly included .1.3.6.1.2.1.25.1
rocommunity public
rwcommunity nanana
sysLocation vm1-ryd-wlo
sysContact Paul Adams <pauladams@nanana.com>
sysServices 72
disk / 10000
disk /var 5%
load 12 10 5
trapsink localhost public
iquerySecName internalUser
rouser internalUser
master agentx
/var/log/syslog
Oct 3 13:59:51 mdnsreflector-ryd-wlo snmpd[9120]: Server Exiting with code 1
Oct 3 14:00:09 mdnsreflector-ryd-wlo snmpd[9143]: Turning on AgentX master support.
Oct 3 14:00:09 mdnsreflector-ryd-wlo snmpd[9145]: NET-SNMP version 5.7.2
sudo service --status-all
[ + ] snmpd
sudo service ufw status
Status: inactive
Meskipun konfigurasi ini memuat dan tampaknya berjalan. Anda tidak bisa menanyakan apa pun dari instance SNMP ini dari perangkat jarak jauh. Koneksi akhirnya habis.
Meminta dari server itu sendiri tidak menghasilkan apa-apa.
snmpwalk -Os -c public -v 1 sistem localhost
system: Unknown Object Identifier (Sub-id not found: (top) -> system)
- Saya harus menghapus entri "agentAddress" karena perangkat lunak terus panik setiap kali mencoba memproses perintah itu. (Meskipun itu adalah default dan caranya seharusnya tercantum dalam konfigurasi.)
/etc/var/syslog
Oct 3 14:10:32 mdnsreflector-ryd-wlo snmpd[9292]: Turning on AgentX master support.
Oct 3 14:10:32 mdnsreflector-ryd-wlo snmpd[9292]: Turning on AgentX master support.
Oct 3 14:10:32 mdnsreflector-ryd-wlo snmpd[9292]: Error opening specified endpoint "udp:161"
Oct 3 14:10:32 mdnsreflector-ryd-wlo snmpd[9292]: Server Exiting with code 1
layanan sudo - status-semua
[ - ] snmpd
- Saya harus menghapus beberapa entri default di konfigurasi karena mereka juga menyebabkan kesalahan saat menjalankannya.
/etc/snmp/snmpd.conf
proc mount
proc ntalkd 4
proc sendmail 10 1
includeAllDisks 10%
extend test1 /bin/echo Hello, world!
extend-sh test2 echo Hello, world! ; echo Hi there ; exit 35
/ var / log / syslog
Oct 3 10:51:11 mdnsreflector-ryd-wlo snmpd[7575]: /etc/snmp/snmpd.conf: line 90: Error: Already have an entry for this process.
Oct 3 10:51:11 mdnsreflector-ryd-wlo snmpd[7575]: /etc/snmp/snmpd.conf: line 92: Error: Already have an entry for this process.
Oct 3 10:51:11 mdnsreflector-ryd-wlo snmpd[7575]: /etc/snmp/snmpd.conf: line 94: Error: Already have an entry for this process.
Oct 3 10:51:11 mdnsreflector-ryd-wlo snmpd[7575]: /etc/snmp/snmpd.conf: line 106: Error: includeAllDisks already specified.
Oct 3 10:51:11 mdnsreflector-ryd-wlo snmpd[7575]: /etc/snmp/snmpd.conf: line 106: Error: #011ignoring: includeAllDisks 10%
Oct 3 10:51:11 mdnsreflector-ryd-wlo snmpd[7575]: /etc/snmp/snmpd.conf: line 146: Error: duplicate trigger name
Oct 3 10:51:11 mdnsreflector-ryd-wlo snmpd[7575]: message repeated 6 times: [ /etc/snmp/snmpd.conf: line 146: Error: duplicate trigger name]
Oct 3 10:51:11 mdnsreflector-ryd-wlo snmpd[7575]: /etc/snmp/snmpd.conf: line 148: Error: duplicate trigger name
Oct 3 10:51:11 mdnsreflector-ryd-wlo snmpd[7575]: /etc/snmp/snmpd.conf: line 148: Error: duplicate trigger name
Oct 3 10:51:11 mdnsreflector-ryd-wlo snmpd[7575]: duplicate table data attempted to be entered. row exists
Oct 3 10:51:11 mdnsreflector-ryd-wlo snmpd[7575]: Failed to register extend entry 'test1' - possibly duplicate name.
Oct 3 10:51:11 mdnsreflector-ryd-wlo snmpd[7575]: duplicate table data attempted to be entered. row exists
Oct 3 10:51:11 mdnsreflector-ryd-wlo snmpd[7575]: Failed to register extend entry 'test2' - possibly duplicate name.