Вход на сайт
Навигация
- Cisco
- FreeBSD
- Colorize - подсвечивание ключевых слов
- Munin — мониторинг сервера на основе FreeBSD
- Postfix + Postgrey. Небольшой пример того, как можно бороться со спамом.
- Roudcube. Установка и настройка.
- VPN между FreeBSD и Windows. Установка mpd4.
- Блокируем TeamViewer
- Выполнение mount из-под прав обычного пользователя
- Добавление базы и пользователя в MySQL
- Как узнать серийный номер винчестера в FreeBSD
- Модули Apache22 (Apache22 modules)
- Мониторинг винтчестеров (HDD/жестких дисков) с помощью SMART (smartmontools)
- Мониторинг загрузки канала (MRTG)
- Мониторинг загрузки сетевых интерфейсов в реальном времени
- Мониторинг нагрузки процессора (SNMP MRTG CPU Monitoring)
- Настройка DNS сервера named
- Настройка сервера времени NTP
- Настройка фаервола (firewall ipfw) на ОС FreeBSD
- Обновление FreeBSD. Краткий мануал.
- Обновление портов (CVSup)
- Обновление портов. Portupgrade.
- Организация VPN между 3-мя офисами
- Повышаем безопасность FreeBSD
- Проблема после обновление SpamAssassin
- Работа с .htaccess и .htpasswd
- Скрипты
- Тестирование MySQL
- Управление дуплексным режимом и скоростью подключения к порту.
- Установка MySQL сервера
- Установка связки Apache22+php5+mysql5
- Шейпер на ipfw
- Подсказки по редактированию
Мониторинг загрузки канала (MRTG)
Zmej чт, 05/01/2012 - 11:54
Идея не моя, вычитал на просторах интернета. Часто бывает, что Вам необходимо видеть текущую нагрузку на Ваш канал.
Попробуем реализовать у себя:
1. Для начала нам необходим net-snmp:
#cd /usr/ports/net-mgmt/net-snmp#make install clean
2. После установки, необходимо добавить в rc.conf следующее
snmpd_enable=”YES”snmpd_flags=”-a -Lsd -p /var/run/snmpd.pid”
3. Дальше, запускаем snmpconf –i и делаем по примеру.
#snmpconf -iThe following installed configuration files were found:1: /usr/local/share/snmp/snmpd.confWould 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): allI can create the following types of configuration files for you.Select the file type you wish to create:(you can create more than one as you run this program)1: snmpd.conf2: snmptrapd.conf3: snmp.confOther options: quitSelect File: 1The configuration information which can be put into snmpd.conf is dividedinto sections. Select a configuration section for snmpd.confthat you wish to create:1: System Information Setup2: Access Control Setup3: Trap Destinations4: Monitor Various Aspects of the Running Host5: Extending the Agent6: Agent Operating ModeOther options: finishedSelect section: 1Section: System Information SetupDescription:This section defines some of the information reported inthe “system” mib group in the mibII tree.Select from:1: The [typically physical] location of the system.2: The contact information for the administrator3: The proper value for the sysServices object.Other options: finished, listSelect section: 1Configuring: syslocationDescription:The [typically physical] location of the system.Note that setting this value here means that when trying toperform an snmp SET operation to the sysLocation.0 variable will makethe agent return the “notWritable” error code. IE, includingthis token in the snmpd.conf file will disable write access tothe variable.arguments: location_stringThe location of the system: KyivFinished Output: syslocation KyivSection: System Information SetupDescription:This section defines some of the information reported inthe “system” mib group in the mibII tree.Select from:1: The [typically physical] location of the system.2: The contact information for the administrator3: The proper value for the sysServices object.Other options: finished, listSelect section: 2Configuring: syscontactDescription:The contact information for the administratorNote that setting this value here means that when trying toperform an snmp SET operation to the sysContact.0 variable will makethe agent return the “notWritable” error code. IE, includingthis token in the snmpd.conf file will disable write access tothe variable.arguments: contact_stringThe contact information: email@gmail.comFinished Output: syscontact email@gmail.comSection: System Information SetupDescription:This section defines some of the information reported inthe “system” mib group in the mibII tree.Select from:1: The [typically physical] location of the system.2: The contact information for the administrator3: The proper value for the sysServices object.Other options: finished, listSelect section: 3Configuring: sysservicesDescription:The proper value for the sysServices object.arguments: sysservices_numberdoes 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): 0does this host offer end-to-end services (eg, supports TCP): 0does this host offer application services (eg, supports SMTP): 1Finished Output: sysservices 64Section: System Information SetupDescription:This section defines some of the information reported inthe “system” mib group in the mibII tree.Select from:1: The [typically physical] location of the system.2: The contact information for the administrator3: The proper value for the sysServices object.Other options: finished, listSelect section: finishedThe configuration information which can be put into snmpd.conf is dividedinto sections. Select a configuration section for snmpd.confthat you wish to create:1: System Information Setup2: Access Control Setup3: Trap Destinations4: Monitor Various Aspects of the Running Host5: Extending the Agent6: Agent Operating ModeOther options: finishedSelect section: finishedThe configuration information which can be put into snmpd.conf is dividedinto sections. Select a configuration section for snmpd.confthat you wish to create:1: System Information Setup2: Access Control Setup3: Trap Destinations4: Monitor Various Aspects of the Running Host5: Extending the Agent6: Agent Operating ModeOther options: finishedSelect section: 2Section: Access Control SetupDescription:This section defines who is allowed to talk to your runningsnmp agent.Select from:1: a SNMPv3 read-write user2: a SNMPv3 read-only user3: a SNMPv1/SNMPv2c read-only access community name4: a SNMPv1/SNMPv2c read-write access community nameOther options: finished, listSelect section: 3Configuring: rocommunityDescription:a SNMPv1/SNMPv2c read-only access community namearguments: community [default|hostname|network/bits] [oid]The community name to add read-only access for: pcbsdThe hostname or network address to accept this community name from [RETURN for all]: localhostThe OID that this community should be restricted to [RETURN for no-restriction]:Finished Output: rocommunity pcbsd localhostSection: Access Control SetupDescription:This section defines who is allowed to talk to your runningsnmp agent.Select from:1: a SNMPv3 read-write user2: a SNMPv3 read-only user3: a SNMPv1/SNMPv2c read-only access community name4: a SNMPv1/SNMPv2c read-write access community nameOther options: finished, listSelect section: finishedThe configuration information which can be put into snmpd.conf is dividedinto sections. Select a configuration section for snmpd.confthat you wish to create:1: System Information Setup2: Access Control Setup3: Trap Destinations4: Monitor Various Aspects of the Running Host5: Extending the Agent6: Agent Operating ModeOther options: finishedSelect section: 6Section: Agent Operating ModeDescription:This section defines how the agent will operate when itis running.Select from:1: Should the agent operate as a master agent or not.2: The system user that the agent runs as.3: The system group that the agent runs as.4: The IP address and port number that the agent will listen on.Other options: finished, listSelect section: 4Configuring: agentaddressDescription:The IP address and port number that the agent will listen on.By default the agent listens to any and all traffic from anyinterface on the default SNMP port (161). This allows you tospecify which address, interface, transport type and port(s) that youwant the agent to listen on. Multiple definitions of this tokenare concatenated together (using ‘:’s).arguments: [transport:]port[@interface/address],…Enter the port numbers, etc that you want the agent to listen to: localhostFinished Output: agentaddress localhostSection: Agent Operating ModeDescription:This section defines how the agent will operate when itis running.Select from:1: Should the agent operate as a master agent or not.2: The system user that the agent runs as.3: The system group that the agent runs as.4: The IP address and port number that the agent will listen on.Other options: finished, listSelect section: finishedThe configuration information which can be put into snmpd.conf is dividedinto sections. Select a configuration section for snmpd.confthat you wish to create:1: System Information Setup2: Access Control Setup3: Trap Destinations4: Monitor Various Aspects of the Running Host5: Extending the Agent6: Agent Operating ModeOther options: finishedSelect section: finishedI can create the following types of configuration files for you.Select the file type you wish to create:(you can create more than one as you run this program)1: snmpd.conf2: snmptrapd.conf3: snmp.confOther options: quitSelect File: quitThe following files were created:snmpd.conf installed in /usr/local/share/snmp
4. На этом по сути настройка snmpd закончена. Остается только сделать
#/usr/local/etc/rc.d/snmpd.sh start
И проверить, работает ли он
#sockstat -4 | grep snmpdroot snmpd 621 7 tcp4 *:199 *:*root snmpd 621 9 udp4 127.0.0.1:161 *:*
5. Дальше, нам необходим пакет mrtg
#cd /usr/ports/net-mgmt/mrtg/#make install clean
6. Для настройки мы будем использовать специальную утилиту cfgmaker
#cfgmaker –global ‘WorkDir: /usr/local/www/data-dist’ –global ‘Options[_]: bits,growright’ –output /usr/local/etc/mrtg/mrtg.cfg pcbsd@localhost
WorkDir: – здесь прописывается путь до директории, в которую Вы хотите выкладывать инфу для apache
comm@localhost – comm – это пользователь, который имеет доступ до net-snmp, а localhost – – это имя хоста, на котором, собственно и запущен net-snmp.
7. Теперь будем запускать генератор графиков раз в 5 минут от пользователя www.
Зададим права на папки пользователю www:
#chown -R www /usr/local/etc/mrtg/#chown -R www /usr/local/www/data-dist
Тут возможно и другое решение, не обязательно такое.
И последний штрих в /etc/crontab добавим следуюшую строку:
*/5 * * * * root /usr/local/bin/mrtg /usr/local/etc/mrtg/mrtg.cfg
8. И в довершение, для большей красоты, используем
indexmaker –output /usr/local/www/data-dist index.html –columns=1 /usr/local/etc/mrtg/mrtg.cfg
- Войдите чтобы оставить комментарии
Новые пользователи
- Zmej
Сейчас на сайте
Пользователей онлайн: 0.

Последние комментарии