
Тестилось и работает на Ubuntu 10.04 и в 12.04. Заранее оговорюсь, у Вас должен быть установлен и настроен LAMP-сервер, далее ставим необходимый нам софт:
| sudo apt-get install snmpd mrtg | 
Правим:
| sudo nano /etc/snmp/snmpd.conf | 
Для 10.04 исправляем такие строки, было:
| com2sec paranoid  default         public #com2sec readonly default public #com2sec readwrite default private  | 
Доводим до такого вида:
| #com2sec paranoid  default         public com2sec readonly default public #com2sec readwrite default private  | 
Для Ubuntu 12.04 выкладываю полностью конфиг, так как некоторые не понимают, что там к чему:
| ############################################################################### # # EXAMPLE.conf: # An example configuration file for configuring the Net-SNMP agent ('snmpd') # See the 'snmpd.conf(5)' man page for details # # Some entries are deliberately commented out, and will need to be explicitly activated # ############################################################################### # # AGENT BEHAVIOUR # #  Listen for connections from the local system only ############################################################################### #  createUser authOnlyUser  MD5 "remember to change this password" #  If you also change the usernames (which might be sensible), ###############################################################################                                                  #  system + hrSystem groups only                                                  #  Full access from the local host                                                  #  Full access from an example network                                                  #  Full read-only access for SNMPv3 #  It's no longer typically necessary to use the full 'com2sec/group/access' configuration ############################################################################### #  Note that setting these values here, results in the corresponding MIB objects being 'read-only' # #  Walk the UCD-SNMP-MIB::prTable to see the resulting output # #  Walk the UCD-SNMP-MIB::dskTable to see the resulting output # #  Walk the UCD-SNMP-MIB::laTable to see the resulting output ###############################################################################                                     #   send SNMPv1  traps #  Note that you typically only want *one* of these three lines # ############################################################################### # #  Note that this last entry requires the script '/tmp/shtest' to be created first, #  Walk the NET-SNMP-EXTEND-MIB tables (nsExtendConfigTable, nsExtendOutput1Table #  Note that the "extend" directive supercedes the previous "exec" and "sh" directives # # Note that this requires one of the two 'passtest' scripts to be installed first, # Walk the NET-SNMP-PASS-MIB::netSnmpPassExamples subtree to see the resulting output #  | 
Теперь перезапускаем snmpd:
| sudo /etc/init.d/snmpd restart | 
Создаем директорию
| sudo mkdir /var/www/mrtg | 
и
| sudo mkdir /etc/mrtg | 
запускаем cfgmaker
| cfgmaker --global "workdir: /var/www/mrtg" -ifref=ip --output /etc/mrtg/mrtg.cfg --global 'options[_]: growright,bits' public@localhost | 
Создаем веб-страницу
| indexmaker /etc/mrtg/mrtg.cfg > /var/www/mrtg/index.html | 
Для того, чтобы апач подхватил все это хозяйство, правим конфиг в /etc/apache2/sites-available/. Так как у меня все работает сайт на php, то дополняем его записью
Alias /mrtg/ "/var/www/mrtg/" <Directory "/var/www/mrtg/"> Options +Indexes +ExecCGI +FollowSymLinks DirectoryIndex index.html AllowOverride Limit </Directory>  | 
Добавляем в cron:
| 0,5,10,15,20,25,30,35,40,45,50,55 * * * * root env LANG=C /usr/bin/mrtg /etc/mrtg/mrtg.cfg --logging /var/log/mrtg.log | 
И перезапускаем snmpd:
| sudo /etc/init.d/snmpd restart | 
Проверяем, набрав в браузере http://sitename/mrtg/ все должно работать!


