Клиент munin для windows
Munin is a networked resource monitoring tool that can help analyze resource trends and «what just happened to kill our performance?» problems. It is designed to be very plug and play. A default installation provides a lot of graphs with almost no work.
In Norse mythology Hugin and Munin are the ravens of the god king Odin. They flew all over Midgard for him, seeing and remembering, and later telling him. «Munin» means «memory«.
Announcements
Latest stable release 2.0.64
It contains mainly:
- bug fixes
Latest development release 2.999.15
This is the fifteen «alpha» release before munin 3. Most, but not all functionality is implemented.
Munin plugin gallery
Browse description and graph images for Munin Plugins in the new Munin Gallery
Main Topics
About Munin
Munin the monitoring tool surveys all your computers and remembers what it saw. It presents all the information in graphs through a web interface. Its emphasis is on plug and play capabilities. After completing a installation a high number of monitoring plugins will be playing with no more effort.
Using Munin you can easily monitor the performance of your computers, networks, SANs, applications, weather measurements and whatever comes to mind. It makes it easy to determine «what’s different today» when a performance problem crops up. It makes it easy to see how you’re doing capacity-wise on any resources.
Munin uses the excellent RRDTool (written by Tobi Oetiker) and the framework is written in Perl, while plugins may be written in any language. Munin has a master/node architecture in which the master connects to all the nodes at regular intervals and asks them for data. It then stores the data in RRD files, and (if needed) updates the graphs. One of the main goals has been ease of creating new plugins (graphs).
Getting munin
Munin 2.0 is available in repositories for (at least) the following Linux distributions: Debian, Ubuntu, Fedora, Red Hat, Red Hat Enterprise Linux, Mandriva, Gentoo and is also available in FreeBSD ports.
Supported platforms
The munin master, node and most core plugins are written in Perl, The master requires perl 5.10 or newer. The node may run on older perls.
There are several alternative implementations of the munin node.
- munin-node-c Munin node and plugins written in C
- munin-node-win32 Munin node for Windows
- Muninlite Munin node written in shell script
- munin-node-python Munin Node implementation in python
- munin node for OpenWRT (written in minimal perl)
- Poor Man’s Munin Node A minimal munin node running under inetd/xinetd
Plugins
Plugins are small, standalone executables. They are easy to write, and can be written in any language. You can find many user contributed plugins in the contrib repository.
Contributing
Munin can always need more help. Please see the list of tasks if you’re looking for something to do.
Please visit our GitHub group and repositories. Due to the workload generated by spam robots and other automated vandalism, most project services has moved there.
You can read about current activities in the minutes of our weekly IRC meetings
HOWTO Monitor Windows
Table of Contents
There is a munin-node for Windows called «munin-node-win32» and another project called «munin-nude-win32» (nude. funny. ).
Alternatively, here are two other ways to monitor Windows. One uses SNMP, the other an agent specific to Munin.
Using munin-node-win32
This can get you more info than SNMP will supply (namely system temperatures). You can get it here, https://github.com/munin-monitoring/munin-node-win32 it works the same as the native munin-node program.
Just run the munin-node-win32 program on each Windows system and on the monitoring server add each Windows box as if it was a Linux box.
You may need to place msvcr71.dll and msvcp71.dll (part of the Microsoft C++ runtime) in the same directory as munin-node.exe to get it to run (it depends if they’re already in the system library path). If you do need them, search your system, as another application has probably already installed them elsewhere (and you can just copy them over). Otherwise, a quick google should get you a site offering them for download.
If you are using plugins written in Python (or any other language), and you want them to interact with a UNIX Munin server, you need to take care of the way newlines are written to stdout. By default, Windows will automatically convert any ‘\n’ character into ‘\r\n’, and Munin doesn’t seem to like it. To solve this issue, you need to write in binary mode. For Python, add the following lines (taken from http://code.activestate.com/recipes/65443/):
Fred Chu forked the munin node win32 client, fixed some bug and added some functions. Last relase in April 2010 ( http://code.google.com/p/munin-nude-win32/)
Using SNMAgent
SNMAgent is a native Win32 NT service that combines Nagios and Munin nodes. SNMAgent can monitor all statistics from Windows Perf Monitor as well as disk usage etc. See plugin-SNMAgent? for more information.
Using SNMP
The below is a contributed text that’s Debian Linux specific, but it should be easy to see how it applies to other Linuxes and Unixes.
Suppose, your shiny Debian Sarge linux server, which runs munin (i.e., /usr/bin/munin-cron from cron), is called vesta.astrohk.cz and your WinXP node (the so called SNMP agent), you would like to monitor, is library.astrohk.cz.
At first, we have to configure the client part in Windows XP SP2 (both Home and Professional probably work, I tested the former):
Start, Control Panel, Add or Remove Programs, Add/Remove? Windows Components, Management and Monitoring Tools, Details, Simple Network Management Protocol, OK, Next, insert CD or supply a directory with WinXP installation files.
Start, Control Panel, Administrative Tools, Services, look for SNMP Service in the list, Properties, Security, Send authentication trap, Accept SNMP packets from any host (or specify vesta host here), Apply.
- Configure Firewall (SNMP uses port no. 161 and UDP packets):
Start, Control Panel, Firewall, Port, write SNMP and 161, click UDP and OK.
You can also consult these two URLs, regarding SNMP:
Notice we need no «munin-node» running on the WinXP side.
Second, lets configure the server part — open /etc/munin/munin.conf and add the following two lines:
This is necessary, because snmp_* plugins change the host_name (at the time of munin-run snmp_* config), and the vesta server has to create additional plots && HTMLs for the library node.
Symlink required munin plugins (and supply the hostname in the link name):
You can run «munin-node-configure-snmp library» or «munin-node-configure-snmp —debug library» to discover, which plugins will probably work and what are your network interface identifiers («2» in our case). (Note the missing domain «.astrohk.cz» in the last two commands.)
Remember to restart munin-node on your server.
Небольшой Блог Системного Администратора
Munin — это легкий сетевой инструмент мониторинга ресурсов. Позволяет собирать данные с нескольких серверов одновременно и отображать все в легковесных красивых графиках. На графиках можно легко отслеживать все прошедшие события сервера, нагрузку и т.д. Статья посвящена настройки munin и решение возможных проблем при установки в различных случаях.
1) Устанавливаем:
Пакет munin — отвечает за сбор информации от munin-node и генерацию необходимых графиков. Устанавливается только на ту машину, где будут просматриваться отчеты;
munin-node — сервер munin, служит для сбора необходимой информации с системных компонентов и передачи её munin;
munin-plugins-extra — дополнительные плагины проверки производительности служб, таких как DNS, DHCP, Samba, memcached, hddtemp и т.д.;
libwww-perl или libio-all-lwp-perl — необходим для нормальной работы сбора информации с apache или nginx, если не собираетесь этого делать, можно пакет не ставить.
Одним из условий работы клиентской части munin является наличие любого установленного web сервера.
Процесс работы утилит довольно прост. Munin запускается с помощью cron через заданный промежуток времени и выполняет опрос всех настроенных munin-node на серверах и строит графики. Правило cron находится по этому пути /etc/cron.d/munin и содержит следующие данные:
2) Далее настраиваем серверную часть, т.е. где установлен пакет munin-node. Правим файл:
Для применения настроек, перезапускаем munin-node
3) Все работающие плагины находятся в /etc/munin/plugins. Все остальные плагины лежат в папке /usr/share/munin/plugins/. Нужные плагины добавляются созданием символической ссылки на него. К примеру:
Удаление плагина решается простым удалением ссылки на плагин:
Так же возможны более тонкие настройки параметров установленных плагинов. Эти настройки редактируются в файле /etc/munin/plugin-conf.d/munin-node в поле соответствующему плагину.
4) Настройка клиентской части munin производится редактированием файла:
изменения которые здесь необходимо сделать — это добавить все munin-node:
5) Все основные настройки произведены. Осталось настроить web доступ к munin.
Доступ к статистике через Apache:
Если у Вас установлен apache2, то при установки munin к его настройкам автоматически добавится конфиг файл виртуалхоста для доступа к мониторингу. Web интерфейс будет доступен по адресу http://localhost/munin и только с локального компьютера. Конфиг Apache для Munin находится в /etc/apache2/conf.d/munin (на самом деле это символическая ссылка на /etc/munin/apache.conf). Он определяет алиес Munin для данных мониторинга (HTML), которые сохраняются в /var/cache/munin/www. Таким образом сможем получить доступ к мониторингу со всех виртуальных хостов на сервере используя относительный путь /munin, например example.com/munin. Редактируем apache.conf:
Загружаем новые настройки apache:
Установка пароля для доступа к интерфейсу munin с помощью .htaccess:
Способ не работает при работе связки apache + nginx. В этом случае необходимо настраивать только nginx. Об этом ниже.
Создаем файл с паролем с помощью утилиты htpasswd из пакета apache2-utils:
Вводим 2 раза пароль, после чего файл создастся.
Изменяем содержимое apache.conf
Загружаем новые настройки apache:
Настройка Nginx:
Для связки apache + nginx необходимо делать то же самое. Производится настройка только nginx, а apache не нужен. Необходимо удалить файл /etc/apache2/conf.d/munin. Следовательно нет необходимости редактировать файла apache.conf.
Для открытия доступа к munin необходимо прописать дополнительную локаль к нужному хосту, ну или в дефолтный файл. От этого зависит по какому адресу будет доступен интерфейс munin.
И вставляем следующий код:
Проверяем корректность настройки:
Если что то не корректно, то исправляем, и проверяем снова. Загружаем новые настройки:
Запрос пароля к munin при работе через Nginx:
Создаем файл с паролем так же, как описано выше в случае с apache.
Вносим изменения в код локали munin:
Проверка работы плагинов
Практически все плагины, можно запустить из консоли с определенными параметрами, тем самым проверив их работу. Параметры запуска можно посмотреть, открыв сам файл плагина. Пример:
Мониторинг Apache
Включаем плагины munin для apache:
Включаем mod_status для apache:
Раскомментируем в файле status.conf строки:
Если apache2 работает на нестандартном 80-м порте или ссылке, редактируем файл:
добавляем код, указываем нужный порт и адрес:
Проверить правильность ссылки, можно открыв её, к примеру, с помощью lynx:
в результате должна открыться страница с содержимым:
Все готово, перезагружаем munin-node:
Чтобы проверить, работает ли статистика по apache, выполним команду:
В ответе необходимо проконтролировать следующие поля, чтобы на против них стояло значение «yes»:
Мониторинг Nginx
Включаем плагины munin для nginx:
Дополняем файл munin-node следующим текстом:
Создаем новый файл виртуалхоста nginx необходимый для сбора статистики:
Мониторинг MySQL
Тут огромное количество возможных пунктов мониторинга и всё через небольшое количество плагинов:
Возможны ошибки в логах:
2015/11/07-21:35:15 [16617] Error output from mysql_:
2015/11/07-21:35:15 [16617] Missing dependency Cache::Cache at /etc/munin/plugins/mysql_ line 728.
2015/11/07-21:35:15 [16617] Service ‘mysql_’ exited with status 255/0.
или при проверке через :
mysql_ | yes | no [Missing dependency Cache::Cache]
необходимо доустановить пакет:
Мониторинг температуры (sensors)
Для слежением за температурой имеющихся датчиков, необходим установленный пакет lm-sensors:
После его устанвока, запускаем sensors-detect для поиска датчиков и положительно отвечам на все задаваемые вопросы. Далее, смотрим температуру найденных датчиков:
Остается включить необходимые плагины для munin. Исходный плагин находится только в одном файле, но нам необходимо создавать симолическую ссылку с правильным именем, для мониторинга вентиляторов, температуры или напряжения. Название ссылки обязятельно должно соотвествовать ниже приведенным.
Мониторинг Memcached
В Centos почему-то не нашлось данного плагина, но можно смело использовать файл от Ubuntu — memcached_:
Если memcached работает на нестандартном порту или IP, указать можно вручную:
Мониторинг PostgreSQL
Пакет для доступа к базе postgresql из perl:
Иначе при проверке плагинов, будут уведомления:
Самих плагинов достаточно много и большинству из них можно указывать конкретную базу данных. Весь список плагинов:
