diff --git a/README.md b/README.md index ce22ff6..6eafefc 100644 --- a/README.md +++ b/README.md @@ -1,42 +1,305 @@ -Monitorix -========= +Monitorix For yunohost +====================== -A light monitoring tools. +[![Integration level](https://dash.yunohost.org/integration/monitorix.svg)](https://ci-apps.yunohost.org/jenkins/job/monitorix%20%28Community%29/lastBuild/consoleFull) +[![Install monitorix with YunoHost](https://install-app.yunohost.org/install-with-yunohost.png)](https://install-app.yunohost.org/?app=monitorix) -[![Integration level](https://dash.yunohost.org/integration/monitorix.svg)](https://ci-apps.yunohost.org/jenkins/job/monitorix%20%28Community%29/lastBuild/consoleFull) +> *This package allow you to install monitorix quickly and simply on a YunoHost server. +If you don't have YunoHost, please see [here](https://yunohost.org/#/install) to know how to install and enjoy it.* -[![Install Monitorix with YunoHost](https://install-app.yunohost.org/install-with-yunohost.png)](https://install-app.yunohost.org/?app=monitorix) +Overview +-------- + +Monitorix is a free, open source, lightweight system monitoring tool designed to monitor as many services and system resources as possible. It has been created to be used under production Linux/UNIX servers, but due to its simplicity and small size can be used on embedded devices as well. + +**Shipped version:** 3.10 + +Screenshots +----------- + +![](https://www.monitorix.org/imgs/mail.png) + +Demo +---- + +* [Official demo](https://www.fibranet.cat/monitorix/) + +Documentation +------------- + + * Official documentation: https://www.monitorix.org/documentation.html + * YunoHost documentation: There no other documentations, feel free to contribute. + +YunoHost specific features +-------------------------- + +### Multi-users support + +This app have no specific authentification and no specific user management. + +### Supported architectures + +* x86-64b - [![Build Status](https://ci-apps.yunohost.org/jenkins/job/monitorix%20(Community)/badge/icon)](https://ci-apps.yunohost.org/jenkins/job/monitorix%20(Community)/) +* ARMv8-A - [![Build Status](https://ci-apps-arm.yunohost.org/jenkins/job/monitorix%20(Community)%20(%7EARM%7E)/badge/icon)](https://ci-apps-arm.yunohost.org/jenkins/job/monitorix%20(Community)%20(%7EARM%7E)/) +* Jessie x86-64b - [![Build Status](https://ci-stretch.nohost.me/jenkins/job/monitorix%20(Community)/badge/icon)](https://ci-stretch.nohost.me/jenkins/job/monitorix%20(Community)/) + + + +Additional informations +----------------------- + +### More sensor + +If you want to see the temperature of some sensor you can install the `lm-sensor` packet. For disk temperature you can instal the `hddtemp` packet. + +### Custom config + +If you want do custom the monitorix config for more personnal information you can add a file in `/etc/monitorix/conf.d/`. This config file will be overwritte the original config in `/etc/monitorix/monitorix.conf`. + +You will have a full complete documentation for monitorix config here : https://www.monitorix.org/documentation.html + +By example you can extends the basic config by this : + +``` +priority = 5 + + + + disk = y + lmsens = y + gensens = y + mail = y + + +# LMSENS graph +# ----------------------------------------------------------------------------- + + + core0 = temp1 + core1 = + mb0 = + cpu0 = + fan0 = + fan1 = + fan2 = + volt0 = + volt1 = + volt2 = + volt3 = + volt4 = + volt5 = + volt6 = + volt7 = + + + +# GENSENS graph +# ----------------------------------------------------------------------------- + + + 0 = cpu_temp + 1 = cpu0_freq, cpu1_freq, cpu2_freq, cpu3_freq + + + cpu_temp = /sys/class/thermal/thermal_zone0/temp + cpu0_freq = /sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_cur_freq + cpu1_freq = /sys/devices/system/cpu/cpu1/cpufreq/cpuinfo_cur_freq + cpu2_freq = /sys/devices/system/cpu/cpu2/cpufreq/cpuinfo_cur_freq + cpu3_freq = /sys/devices/system/cpu/cpu3/cpufreq/cpuinfo_cur_freq + + + cpu_temp = 1000 + cpu0_freq = 0.001 + cpu1_freq = 0.001 + cpu2_freq = 0.001 + cpu3_freq = 0.001 + + + cpu_temp = CPU Temperature + cpu0_freq = CPU 0 Frequency + cpu1_freq = CPU 1 Frequency + cpu2_freq = CPU 2 Frequency + cpu3_freq = CPU 3 Frequency + + + cpu_temp = 300, 65, /etc/monitorix/monitorix_alerts_scripts/cpu_temp.sh + + + +# DISK graph +# ----------------------------------------------------------------------------- + + + 0 = /dev/sda + + + realloc_enabled = y + realloc_timeintvl = 0 + realloc_threshold = 1 + realloc_script = /etc/monitorix/monitorix_alerts_scripts/disk_realloc.sh + pendsect_enabled = y + pendsect_timeintvl = 0 + pendsect_threshold = 1 + pendsect_script = /etc/monitorix/monitorix_alerts_scripts/disk_pendsect.sh + + + +# FS graph +# ----------------------------------------------------------------------------- + + + 0 = /, /home, /var, /tmp, swap + + + / = Root FS + /home = home + /var = var + /tmp = tmp + + + + rigid = 2, 0, 2, 0 + limit = 100, 1000, 100, 1000 + + / = 3600, 98, /etc/monitorix/monitorix_alerts_scripts/fs_rootfs.sh + /home = 3600, 98, /etc/monitorix/monitorix_alerts_scripts/fs_home.sh + /var = 3600, 98, /etc/monitorix/monitorix_alerts_scripts/fs_var.sh + /tmp = 3600, 98, /etc/monitorix/monitorix_alerts_scripts/fs_tmp.sh + swap = 3600, 98, /etc/monitorix/monitorix_alerts_scripts/fs_swap.sh + + + + +# MAIL graph +# ----------------------------------------------------------------------------- + + mta = postfix + greylist = postgrey + stats_rate = real + rigid = 0, 0, 0, 0, 0 + limit = 1, 1000, 1000, 1000, 1000 + + delvd_enabled = y + delvd_timeintvl = 60 + delvd_threshold = 100 + delvd_script = /etc/monitorix/monitorix_alerts_scripts/mail_delvd.sh + mqueued_enabled = y + mqueued_timeintvl = 3600 + mqueued_threshold = 100 + mqueued_script = /etc/monitorix/monitorix_alerts_scripts/mail_mqueued.sh + + + + +# NET graph +# ----------------------------------------------------------------------------- + + list = eth0,lo + + eth0 = FastEthernet LAN, 0, 10000000 + lo = loopback, 0, 10000000 + + + gateway = eth0 + + +# PROCESS graph +# ----------------------------------------------------------------------------- + + + 0 = sshd, ntpd, monitorix, monitorix-httpd + 1 = openvpn, ... + ... + 6 = mysqld, slapd, postgresql + + + master = Postfix + imap = Dovecot + + rigid = 2, 0, 0, 0, 0, 0, 0, 0 + limit = 100, 1000, 1000, 1000, 1000, 1000, 1000, 1000 + + + + + + enabled = y + url_prefix = http://127.0.0.1:8081/monitorix + smtp_hostname = localhost + from_address = noreply@domain.tld + hour = 2 + minute = 7 + + enabled = y + graphs = system, fs, gensens, disk, netstat, port, nginx + to = user@domain.tld + + + enabled = y + graphs = system, fs, gensens, disk, kern, proc, net, netstat, process, serv, port, user, nginx, mysql, fail2ban, int + to = user@domain.tld + + + enabled = y + graphs = system, fs, gensens, disk, kern, proc, net, netstat, process, serv, port, user, nginx, mysql, fail2ban, int + to = user@domain.tld + + + enabled = y + graphs = system, fs, gensens, disk, kern, proc, net, netstat, process, serv, port, user, nginx, mysql, fail2ban, int + to = user@domain.tld + + + +``` + +In this config we have : +- We set the process priority to 5 (which mean that it will be lower priority than the other process). +- We get the lmsensor sensor data. +- We get some sensors data not accessible with lmsensor (with gensens) +- We check the disk health and send an email if any error happens. For that you need to make some script. An example is available in `/usr/share/doc/monitorix/monitorix-alert.sh`. +- We check the filesystem. +- We check the traffic in the network card. +- We check some process. +- We send every day, week, month and year a rapport. + +Links +----- + + * Report a bug: https://github.com/YunoHost-Apps/monitorix_ynh/issues + * App website: Link to the official website of this app + * YunoHost website: https://yunohost.org/ + +--- Install ------- From command line: -`sudo yunohost app install -l Monitorix https://github.com/YunoHost-Apps/monitorix_ynh` +`sudo yunohost app install -l monitorix https://github.com/YunoHost-Apps/monitorix_ynh` Upgrade ------- From command line: -`sudo yunohost app upgrade -u https://github.com/YunoHost-Apps/monitorix_ynh` +`sudo yunohost app upgrade monitorix -u https://github.com/YunoHost-Apps/monitorix_ynh` -Issue ------ +Developers infos +---------------- -Any issue is welcome here : https://github.com/YunoHost-Apps/monitorix_ynh/issues - -More sensor ------------ - -If you want to see the temperature of some sensor you can install the `lm-sensor` packet. For disk temperature you can instal the `hddtemp` packet. - -Custom config -------------- - -If you want do custom the monitorix config for more personnal information you can add a file in `/etc/monitorix/conf.d/`. This config file will be overwritte the original config in `/etc/monitorix/monitorix.conf`. +To try the testing branch, please proceed like that. +``` +sudo yunohost app install https://github.com/YunoHost-Apps/monitorix_ynh/tree/testing --debug +or +sudo yunohost app upgrade monitorix -u https://github.com/YunoHost-Apps/monitorix_ynh/tree/testing --debug +``` License ------- -Monitorix is published under the GNU General Public License v2.0 License : http://www.monitorix.org/license.html +Monitorix is published under the GNU General Public License v2.0 License : http://www.monitorix.org/license.html \ No newline at end of file diff --git a/conf/post_iptable_rules_hook b/conf/post_iptable_rules_hook index fc489a4..c30c307 100644 --- a/conf/post_iptable_rules_hook +++ b/conf/post_iptable_rules_hook @@ -2,5 +2,8 @@ if [[ $(systemctl status monitorix.service | grep "Active" | cut -d'(' -f2 | cut -d ')' -f1) = 'running' ]] then - systemctl restart monitorix.service + systemctl stop monitorix.service + sleep 1 + pkill -f "monitorix-httpd listening on" || true + systemctl start monitorix.service fi \ No newline at end of file