Install SNMP di FreeBSD

Instal SNMP di FreeBSD

SNMP (Simple Network Management Protocol) adalah protokol manajemen jaringan yang yang digunakan untuk memonitor dan mengelola berbagai perangkat di jaringan Internet meliputi hub, router, switch, workstation.

Instalasi SNMP melalui Port

#cd /usr/ports/net-mgmt/net-snmp && make install clean

Kemudian edit file /etc/rc.conf tambahkan baris berikut :
snmpd_enable=”YES”

file konfigurasi berada di /usr/local/share/snmp/snmpd.conf . edit file ini di bagian :

####
# First, map the community name (COMMUNITY) into a security name
# (local and mynetwork, depending on where the request is coming
# from):

# sec.name source community
com2sec local localhost COMMUNITY
com2sec mynetwork NETWORK/24 COMMUNITY

Sebagai contoh, ganti NETWORK/24 seperti di bawah ini :

# sec.name source community
com2sec local localhost COMMUNITY
com2sec unsaja 202.152.27.126/32 unsaja

####
# Second, map the security names into group names:

#               sec.model  sec.name
group MyRWGroup v1         local
group MyRWGroup v2c        local
group MyRWGroup usm        local
group MyROGroup v1         unsaja
group MyROGroup v2c        unsaja
group MyROGroup usm        unsaja
Bila sudah selesai pengeditan Anda, silahkan Anda simpan.

Sekarang kita jalankan SNMPnya dengan perintah:

#/usr/local/sbin/snmpd -c /usr/local/share/snmp/snmpd.conf -p /var/run/snmpd.pid
Pastikan ini tidak ada error, silahkan Anda selalu ngecek dengan perintah “tail -f /var/log/messages”, setiap Anda melakukan pengeditan. Kemudian silahkan Testing SNMP-nya dengan perintah seperti dibawah ini :

# snmpwalk -v1 -c local localhost system

Hasilnya seperti dibawah ini, :

router-inp# snmpwalk -v1 -c localan localhost system
SNMPv2-MIB::sysDescr.0 = STRING: FreeBSD xxx.uns.ac.id 6.3-RELEASE FreeBSD 6.3-RELEASE #0: Sat Apr 26 09:11:29 UTC 2008     root@xxx.uns.ac.id:/usr/src/sys/i386/compile/SMP i386
SNMPv2-MIB::sysObjectID.0 = OID: NET-SNMP-MIB::netSnmpAgentOIDs.8
DISMAN-EVENT-MIB::sysUpTimeInstance = Timeticks: (121047753) 14 days, 0:14:37.53
SNMPv2-MIB::sysContact.0 = STRING: Me <me@somewhere.org>
SNMPv2-MIB::sysName.0 = STRING: xxx.uns.ac.id
SNMPv2-MIB::sysLocation.0 = STRING: Right here, right now.
SNMPv2-MIB::sysServices.0 = INTEGER: 72
SNMPv2-MIB::sysORLastChange.0 = Timeticks: (10) 0:00:00.10
SNMPv2-MIB::sysORID.1 = OID: SNMPv2-MIB::snmpMIB
SNMPv2-MIB::sysORID.2 = OID: TCP-MIB::tcpMIB
SNMPv2-MIB::sysORID.3 = OID: IP-MIB::ip
SNMPv2-MIB::sysORID.4 = OID: UDP-MIB::udpMIB
SNMPv2-MIB::sysORID.5 = OID: SNMP-VIEW-BASED-ACM-MIB::vacmBasicGroup
SNMPv2-MIB::sysORID.6 = OID: SNMP-FRAMEWORK-MIB::snmpFrameworkMIBCompliance
SNMPv2-MIB::sysORID.7 = OID: SNMP-MPD-MIB::snmpMPDCompliance
SNMPv2-MIB::sysORID.8 = OID: SNMP-USER-BASED-SM-MIB::usmMIBCompliance
SNMPv2-MIB::sysORID.9 = OID: IF-MIB::ifMIB
SNMPv2-MIB::sysORDescr.1 = STRING: The MIB module for SNMPv2 entities
SNMPv2-MIB::sysORDescr.2 = STRING: The MIB module for managing TCP implementations
SNMPv2-MIB::sysORDescr.3 = STRING: The MIB module for managing IP and ICMP implementations
SNMPv2-MIB::sysORDescr.4 = STRING: The MIB module for managing UDP implementations
SNMPv2-MIB::sysORDescr.5 = STRING: View-based Access Control Model for SNMP.
SNMPv2-MIB::sysORDescr.6 = STRING: The SNMP Management Architecture MIB.
SNMPv2-MIB::sysORDescr.7 = STRING: The MIB for Message Processing and Dispatching.
SNMPv2-MIB::sysORDescr.8 = STRING: The management information definitions for the SNMP User-based Security Model.
SNMPv2-MIB::sysORDescr.9 = STRING: The MIB module to describe generic objects for network interface sub-layers
SNMPv2-MIB::sysORUpTime.1 = Timeticks: (7) 0:00:00.07
SNMPv2-MIB::sysORUpTime.2 = Timeticks: (7) 0:00:00.07
SNMPv2-MIB::sysORUpTime.3 = Timeticks: (7) 0:00:00.07
SNMPv2-MIB::sysORUpTime.4 = Timeticks: (7) 0:00:00.07
SNMPv2-MIB::sysORUpTime.5 = Timeticks: (7) 0:00:00.07
SNMPv2-MIB::sysORUpTime.6 = Timeticks: (9) 0:00:00.09
SNMPv2-MIB::sysORUpTime.7 = Timeticks: (9) 0:00:00.09
SNMPv2-MIB::sysORUpTime.8 = Timeticks: (9) 0:00:00.09
SNMPv2-MIB::sysORUpTime.9 = Timeticks: (10) 0:00:00.10

Bila sewaktu mentest dengan snmpwalk, muncul pesan host time out atau unkown host, silahkan Anda cek sekali lagi konfigurasi Anda. Bisa jadi waktu Configure SNMP-nya ada error atau setingan di /var/snmp.conf-nya belum benar. Selalu cek dengan “tail -f /var/log/messages”

Biar setiap kali sistem restart, snmpnya langsung jalan, edit file startup di /usr/local/etc/rc.d/snmp di bagian :

snmpd_enable=${snmpd_enable-”YES”}
snmpd_flags=${snmpd_flags-””}
snmpd_pidfile=${snmpd_pidfile-”/var/run/snmpd.pid”}
snmpd_conffile=${snmpd_conffile-”/usr/local/share/snmp/snmpd.conf”}

Tinggalkan Balasan

Isikan data di bawah atau klik salah satu ikon untuk log in:

Logo WordPress.com

You are commenting using your WordPress.com account. Logout / Ubah )

Gambar Twitter

You are commenting using your Twitter account. Logout / Ubah )

Foto Facebook

You are commenting using your Facebook account. Logout / Ubah )

Foto Google+

You are commenting using your Google+ account. Logout / Ubah )

Connecting to %s

%d blogger menyukai ini: