Langsung aja ya...
Pastikan anda sudah login sebagai root, kalo bingung cara login sebagai root, pake perintahsudo -i
1. Installation
Agar lebih mantap, kita akan install net-snmp-utils dari pkgs.org,, [segilas info] pkgs.info adalah website yang menyediakan berbagai macam package dari berbagai macam distribusi linux [udah gitu aja].
Yuk lanjut, kita donlot dulu package net-snmp-utils dari web tsb, kalo pake mesin 64 bit, sedot pake
# wget -c http://mirror.centos.org/centos/6/os/x86_64/Packages/net-snmp-5.5-41.el6.x86_64.rpm && wget -c http://mirror.centos.org/centos/6/os/x86_64/Packages/net-snmp-utils-5.5-41.el6.x86_64.rpm && wget -c http://mirror.centos.org/centos/6/os/x86_64/Packages/net-snmp-libs-5.5-41.el6.x86_64.rpmkalo mesin 32 bit pake
# wget -c http://mirror.centos.org/centos/6/os/i386/Packages/net-snmp-5.5-41.el6.i686.rpm && wget -c http://mirror.centos.org/centos/6/os/i386/Packages/net-snmp-utils-5.5-41.el6.i686.rpm && wget -c http://mirror.centos.org/centos/6/os/i386/Packages/net-snmp-libs-5.5-41.el6.i686.rpmkalo udah selesai, install pke
# rpm -i net-snmp[tab]SELAMAT!!!!
snmp sudah tersematkan di server anda....
Mau lanjut ke konfigurasi??
Yuuuukkk ke bawah....
2. Konfigurasi
Buat jaga-jaga, jangan lupa backup dulu file settingan/konfigurasi default snmp (bawaan pabrik istilahnya). Hajar dengan
# cp /etc/snmp/snmpd.conf /etc/snmp/snmpd.conf.aselikalo udah, masuk ke folder tempat bersemayam snmpd.conf dengan
#cd /etc/snmpDi sini kita akan menggunakan salah satu utilisasi dari snmp yg bisa generate config secara otomatis, utils yg cocok banget buat anak2 manja seperti kita [hayoo kalo ga mau ngakuin kalo manja, tutup aja page ini secepatnya... :) hehee.... bercanda koq]
lanjut yuk....
# snmpconf -g basic_setupakan ada beberapa pertanyaan yg akan muncul, dijawab gimana??
liat ke bawah yuuukkk...
#snmpconf -g basic_setupCek di /etc/snmp/snmpd.conf apakah sudah mengandung config yang baru, kalo sudah, berarti ya sukses dan waktunya berjingkrak...
The following installed configuration files were found:
1: ./snmpd.conf
Would you like me to read them in? Their content will be merged with theoutput files created by this session.
Valid answer examples: "all", "none","3","1,2,5"
Read in which (default = all): none*************************************************** Beginning basic system information setup ***************************************************Do you want to configure the information returned in the system MIB group (contact info, etc)? (default = y): y
Configuring: syslocationDescription: The [typically physical] location of the system. Note that setting this value here means that when trying to perform an snmp SET operation to the sysLocation.0 variable will make the agent return the "notWritable" error code. IE, including this token in the snmpd.conf file will disable write access to the variable. arguments: location_string
The location of the system: At home
Finished Output: syslocation "di hatimu"
Configuring: syscontactDescription: The contact information for the administrator. Note that setting this value here means that when trying toperform an snmp SET operation to the sysContact.0 variable will make the agent return the "notWritable" error code. IE, including this token in the snmpd.conf file will disable write access to the variable. arguments: contact_string
The contact information: Shinichi
Finished Output: syscontact ShinichiDo you want to properly set the value of the sysServices.0 OID (if you don't know, just say no)? (default = y): y
Configuring: sysservicesDescription: The proper value for the sysServices object. arguments: sysservices_number
does this host offer physical services (eg, like a repeater) [answer 0 or 1]: 0does this host offer datalink/subnetwork services (eg, like a bridge): 0does this host offer internet services (eg, supports IP): 1does this host offer end-to-end services (eg, supports TCP): 1does this host offer application services (eg, supports SMTP): 1
Finished Output: sysservices 76***************************************** BEGINNING ACCESS CONTROL SETUP *****************************************Do you want to configure the agent's access control? (default = y): yDo you want to allow SNMPv3 read-write user based access (default = y): nDo you want to allow SNMPv3 read-only user based access (default = y): nDo you want to allow SNMPv1/v2c read-write community access (default = y): nDo you want to allow SNMPv1/v2c read-only community access (default = y): y
Configuring: rocommunityDescription: a SNMPv1/SNMPv2c read-only access community name arguments: community [default|hostname|network/bits] [oid]
The community name to add read-only access for: publicThe hostname or network address to accept this community name from [RETURN for all]:The OID that this community should be restricted to [RETURN for no-restriction]:
Finished Output: rocommunity publicDo another rocommunity line? (default = y): n******************************************* Beginning trap destination setup *******************************************Do you want to configure where and if the agent will send traps? (default = y): n******************************************* Beginning monitoring setup *******************************************Do you want to configure the agent's ability to monitor various aspects of your system? (default = y): n
Error: An snmpd.conf file already exists in this directory.
'overwrite', 'skip', 'rename' or 'append'? : overwrite
The following files were created:
snmpd.conf
These files should be moved to /usr/local/share/snmp if you want them used by everyone on the system. In the future, if you add the -i option to the command line I'll copy them there automatically for you.
Or, if you want them for your personal use only, copy them to/root/.snmp . In the future, if you add the -p option to the command line I'll copy them there automatically for you.