munin_statistics
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
munin_statistics [2022/07/21 20:43] – admin | munin_statistics [2022/07/21 23:06] (current) – admin | ||
---|---|---|---|
Line 13: | Line 13: | ||
** Updated for Debian Bullseye ** | ** Updated for Debian Bullseye ** | ||
- | ====== Installation | + | ===== Installation ===== |
< | < | ||
#Note: munin=graphing server and munin-node=server sending stats: | #Note: munin=graphing server and munin-node=server sending stats: | ||
Line 19: | Line 19: | ||
</ | </ | ||
- | It should | + | It will work out of the box. Wait at least 5 minutes ( /etc/cron.d/ |
+ | |||
+ | <del>Default web is located in / | ||
Remember to open firewall to allow munin-node to connect to the graphing server! It uses port 4949. | Remember to open firewall to allow munin-node to connect to the graphing server! It uses port 4949. | ||
- | ====== Temperature Monitoring with Munin ====== | + | Ok - so, after apt-get installing munin, the following apache config gets enabled: |
+ | < | ||
+ | vi / | ||
+ | #update lines to: | ||
+ | < | ||
+ | #Require local | ||
+ | Require all granted | ||
+ | </ | ||
+ | |||
+ | How with a web browser navigate to http:// | ||
+ | Because Require local was changed to all, you can view stats instead of a 403. | ||
+ | |||
+ | ==== Change servername on graphs==== | ||
+ | < | ||
+ | vi / | ||
+ | #uncomment and update to: | ||
+ | host_name server.domain.com | ||
+ | </ | ||
+ | |||
+ | < | ||
+ | vi / | ||
+ | #Change | ||
+ | # | ||
+ | #to | ||
+ | [server.domain.com] | ||
+ | address 127.0.0.1 | ||
+ | use_node_name yes | ||
+ | |||
+ | </ | ||
+ | ...A few minutes later, you should see updates. | ||
+ | |||
+ | |||
+ | ==== Removing graphs / plugins ==== | ||
+ | All possible plugins are stored in: / | ||
+ | |||
+ | To delete a plugin, simply delete it from / | ||
+ | |||
+ | ==== Adding graphs / plugins ==== | ||
+ | === Apache plugins === | ||
+ | < | ||
+ | ln -s / | ||
+ | ln -s / | ||
+ | ln -s / | ||
+ | ln -s / | ||
+ | |||
+ | #You may need to do: | ||
+ | a2enmod status | ||
+ | #reported: Module status already enabled | ||
+ | #check / | ||
+ | |||
+ | </ | ||
+ | Note: there are lots more graphs for apache, but require apache mod_watch. See [[munin_statistics# | ||
+ | |||
+ | === SQL plugins === | ||
+ | Well MySQL is now MariaDb. | ||
+ | < | ||
+ | ln -s / | ||
+ | ln -s / | ||
+ | ln -s / | ||
+ | </ | ||
+ | |||
+ | === Other useful plugins === | ||
+ | < | ||
+ | ln -s / | ||
+ | |||
+ | ln -s / | ||
+ | ^ For the above, to monitor just certain processes | ||
+ | vi / | ||
+ | #Add | ||
+ | [multips_memory] | ||
+ | env.names apache2 mariadbd | ||
+ | |||
+ | </ | ||
+ | |||
+ | ===== Temperature Monitoring with Munin ===== | ||
This is with a 2.6 kernel and udev! | This is with a 2.6 kernel and udev! | ||
+ | < | ||
| | ||
| | ||
- | < | + | #The above should edit / |
| | ||
- | < | + | #A reboot should sort everything. (Cant remember if a reboot is required or not.) |
+ | </ | ||
Onto config of Munin. All munin templates are kept in / | Onto config of Munin. All munin templates are kept in / | ||
+ | < | ||
ln -s / | ln -s / | ||
ln -s / | ln -s / | ||
ln -s / | ln -s / | ||
+ | </ | ||
The above lines should pick up all required - and should not need editing - once the sensor modules are included. | The above lines should pick up all required - and should not need editing - once the sensor modules are included. | ||
+ | |||
** Test Sensors ** | ** Test Sensors ** | ||
- | Test the sensors by simply going: | + | < |
+ | #Test the sensors by simply going: | ||
| | ||
+ | </ | ||
- | http://www.debian-administration.org/articles/229 | + | * http://munin.projects.linpro.no/wiki/Documentation |
- | + | * http:// | |
- | http:// | + | |
- | + | | |
- | http://www.debianhelp.co.uk/munin.htm | + | |
- | http:// | + | ===== SMART Monitoring with Munin ===== |
- | + | ||
- | http:// | + | |
- | + | ||
- | http:// | + | |
- | + | ||
- | ====== SMART Monitoring with Munin ====== | + | |
Note that smartmontools must be installed and smartd running before munin will pick up and use smart. Configure smart using the way mentioned on this wiki here: [[SMART]] | Note that smartmontools must be installed and smartd running before munin will pick up and use smart. Configure smart using the way mentioned on this wiki here: [[SMART]] | ||
After SMART is running: | After SMART is running: | ||
+ | < | ||
ln -s / | ln -s / | ||
ln -s / | ln -s / | ||
- | < | + | #edit the following only for Debian Etch or older |
vi / | vi / | ||
# | # | ||
Line 77: | Line 154: | ||
| | ||
+ | </ | ||
That should do it. Apologies for the lack of a reference. | That should do it. Apologies for the lack of a reference. | ||
Line 97: | Line 175: | ||
The known fix was: | The known fix was: | ||
+ | < | ||
vi / | vi / | ||
#on line 239 change from: | #on line 239 change from: | ||
Line 102: | Line 181: | ||
#to: | #to: | ||
| | ||
+ | </ | ||
That should solve that little error. Restart munin-node and then see. | That should solve that little error. Restart munin-node and then see. | ||
Reference: http:// | Reference: http:// | ||
Line 116: | Line 195: | ||
Refs: http:// | Refs: http:// | ||
- | ====== Disk Usage (DU) Monitoring of home and mail Directories plugin for Munin ====== | + | ===== Disk Usage (DU) Monitoring of home and mail Directories plugin for Munin ===== |
The following file is placed in: | The following file is placed in: | ||
+ | < | ||
/ | / | ||
# | # | ||
Line 193: | Line 273: | ||
# vim: | # vim: | ||
+ | </ | ||
Note: The above file is modified from the original which can be obtained at: | Note: The above file is modified from the original which can be obtained at: | ||
- | http:// | + | * http:// |
- | http:// | + | |
The above munin plugin reads the information from a temp file in / | The above munin plugin reads the information from a temp file in / | ||
+ | < | ||
# | # | ||
du -B 1 --max-depth=1 /home /srv /var /tmp /usr | sort -nr | grep -Ev '/ | du -B 1 --max-depth=1 /home /srv /var /tmp /usr | sort -nr | grep -Ev '/ | ||
#Its not very tidy, I know, but it does the trick. | #Its not very tidy, I know, but it does the trick. | ||
+ | </ | ||
- | ====== Munin Monitoring of Xen CPU and Network Traffic | + | ===== Munin Monitoring of Xen CPU and Network Traffic ===== |
- | The following websites provide the original information: | + | The following websites provide the original information: |
- | http:// | + | |
- | http:// | + | |
+ | * http:// | ||
+ | * http:// | ||
+ | * http:// | ||
+ | |||
+ | < | ||
cd / | cd / | ||
wget http:// | wget http:// | ||
Line 222: | Line 308: | ||
/ | / | ||
+ | </ | ||
That should do it. | That should do it. | ||
Line 231: | Line 318: | ||
- | ====== Email Notifications from Munin ====== | + | ===== Email Notifications from Munin ===== |
Typically I use nagios to monitor services, while munin monitors individual systems, with each system having munin-node installed. Instead of having nice pretty graphs to monitor performance on an hourly, daily or weekely basis, munin can easily be set to send warning and critical email notifications. | Typically I use nagios to monitor services, while munin monitors individual systems, with each system having munin-node installed. Instead of having nice pretty graphs to monitor performance on an hourly, daily or weekely basis, munin can easily be set to send warning and critical email notifications. | ||
The information on notifications using munin is quite scarse. It took quite a bit of trial and error to get everything fully corrected. Below is the most simple config. It sends one email when a service is exceeded. It sends a final email when the service is below the threshold set. | The information on notifications using munin is quite scarse. It took quite a bit of trial and error to get everything fully corrected. Below is the most simple config. It sends one email when a service is exceeded. It sends a final email when the service is below the threshold set. | ||
+ | < | ||
vi / | vi / | ||
# | # | ||
Line 247: | Line 335: | ||
df._dev_sda1.critical 95 | df._dev_sda1.critical 95 | ||
+ | </ | ||
Its that simple. With a minimum of two entries all can be up and running. Now, lets explain a little: | Its that simple. With a minimum of two entries all can be up and running. Now, lets explain a little: | ||
The values/ | The values/ | ||
+ | < | ||
ssh root@mail | ssh root@mail | ||
cd / | cd / | ||
Line 265: | Line 355: | ||
postfix_mailqueue.active.warning 90 | postfix_mailqueue.active.warning 90 | ||
+ | </ | ||
See the following for allowing contacts for particular servers and/or for particular services: | See the following for allowing contacts for particular servers and/or for particular services: | ||
http:// | http:// | ||
+ | < | ||
| | ||
Line 285: | Line 376: | ||
# Useful if the receiving end does not accept all kinds of characters | # Useful if the receiving end does not accept all kinds of characters | ||
# NB: Only available in Munin-1.2.5 or with the patch described in ticket 34. | # NB: Only available in Munin-1.2.5 or with the patch described in ticket 34. | ||
+ | </ | ||
- | ===== Summary of Checks | + | ==== Summary of Checks ==== |
- | pluginname.service.warning 90 < | + | < |
- | pluginname.service.critical 95 < | + | pluginname.service.warning 90 |
+ | pluginname.service.critical 95 | ||
- | pluginname = ls / | + | pluginname = ls / |
servicename = munin-run pluginname | servicename = munin-run pluginname | ||
+ | </ | ||
- | + | ==== Subject Title of Email ==== | |
- | ===== Subject Title of Email ===== | + | |
contact.me.command mail -s "Munin Notification ${var:host} ${var: | contact.me.command mail -s "Munin Notification ${var:host} ${var: | ||
Line 302: | Line 395: | ||
Number of Alerts (max messages). I didnt bother setting this. More info can be found at: http:// | Number of Alerts (max messages). I didnt bother setting this. More info can be found at: http:// | ||
- | ====== Munin via CGI (Reduce CPU Load) ====== | + | ===== Munin via CGI (Reduce CPU Load) ===== |
As the cpu usage of Munin creating graphs every 5 minutes takes quite a while, munin ships with a cgi script which will render the graphs with all the data. By default the munin-cgi-graph (cgi) is installed with munin. To enable, do the following: | As the cpu usage of Munin creating graphs every 5 minutes takes quite a while, munin ships with a cgi script which will render the graphs with all the data. By default the munin-cgi-graph (cgi) is installed with munin. To enable, do the following: | ||
+ | < | ||
vi / | vi / | ||
| | ||
Line 321: | Line 415: | ||
# | # | ||
| | ||
- | + | </ | |
- | Wait 5 minutes for munin to rebuild the html pages. Take a look at the source and you will see something like:<br> | + | Wait 5 minutes for munin to rebuild the html pages. Take a look at the source and you will see something like:\\ |
<img src="/ | <img src="/ | ||
If you see an error or a blank page or a error 500: | If you see an error or a blank page or a error 500: | ||
+ | < | ||
tail / | tail / | ||
#the above error file will reveal all errors. | #the above error file will reveal all errors. | ||
+ | </ | ||
- | References: | + | References: |
- | http:// | + | |
- | http:// | + | |
- | Another option for munin (to reduce cpu load) is to edit /etc/cron.d/ | + | * http://waste.mandragor.org/ |
+ | * http:// | ||
+ | Another option for munin (to reduce cpu load) is to edit / | ||
- | ====== Monitor Memory Usage of Processes | + | ===== Monitor Memory Usage of Processes ===== |
< | < | ||
Line 354: | Line 450: | ||
#That should do it. Wait and watch for the graphs. | #That should do it. Wait and watch for the graphs. | ||
</ | </ | ||
+ | < | ||
ln -s / | ln -s / | ||
vi / | vi / | ||
Line 361: | Line 458: | ||
:wq | :wq | ||
/ | / | ||
+ | </ | ||
- | Related links: | + | Related links: |
- | http:// | + | |
- | http:// | + | |
- | http:// | + | |
- | http:// | + | |
- | http:// | + | |
- | ====== | + | Extra Links |
- | http:// | + | |
- | http:// | + | |
- | http:// | + | |
- | http:// | + | |
- | ====== Update: munin-node on Lenny ====== | + | ===== Update: munin-node on Lenny ===== |
So I installed munin-node on debian lenny, and it took me a few minutes to see why there were no graphs been generated. Problem: it appears that by default no plugins are enabled by default when installing munin-node. Thats unforunate! | So I installed munin-node on debian lenny, and it took me a few minutes to see why there were no graphs been generated. Problem: it appears that by default no plugins are enabled by default when installing munin-node. Thats unforunate! | ||
Line 381: | Line 479: | ||
To enable the most common plugins go: | To enable the most common plugins go: | ||
+ | < | ||
/ | / | ||
ls / | ls / | ||
/ | / | ||
+ | </ | ||
- | ====== Split up Munin multi-graphs to separate graphs | + | ===== Split up Munin multi-graphs to separate graphs ===== |
I use munin to monitor my KVM VMs as outlined on http:// | I use munin to monitor my KVM VMs as outlined on http:// | ||
- | ===== Before | + | ==== Before ==== |
http:// | http:// | ||
+ | < | ||
vi / | vi / | ||
Line 395: | Line 496: | ||
use_node_name yes | use_node_name yes | ||
- | # | + | # |
libvirt_cputime_deb04.graph_title Deb04 CPU | libvirt_cputime_deb04.graph_title Deb04 CPU | ||
libvirt_cputime_deb04.update no | libvirt_cputime_deb04.update no | ||
- | libvirt_cputime_deb04.graph_args -u 100 < | + | libvirt_cputime_deb04.graph_args -u 100 #Set the Upper limit to 100% |
- | libvirt_cputime_deb04.deb04.cdef deb04, | + | libvirt_cputime_deb04.deb04.cdef deb04, |
libvirt_cputime_deb04.graph_category Virtual Machines | libvirt_cputime_deb04.graph_category Virtual Machines | ||
libvirt_cputime_deb04.graph_order deb04=server.domain.com: | libvirt_cputime_deb04.graph_order deb04=server.domain.com: | ||
+ | </ | ||
- | ===== After ===== | + | ==== After ==== |
http:// | http:// | ||
Because I use cgi to render the images, I can now script the URL: http:// | Because I use cgi to render the images, I can now script the URL: http:// | ||
- | Links: | + | Links: |
- | No 1 source: http:// | + | |
- | No 2 source: http:// | + | |
- | http:// | + | |
- | http:// | + | |
- | http:// | + | |
- | http:// | + | |
- | Sample http:// | + | * Sample http:// |
- | ====== Apache Mod_Watch & Munin Graphs showing vhost accesses | + | ===== Apache Mod_Watch & Munin Graphs showing vhost accesses ===== |
While this is more of an apache topic than a munin one, the main reason I wanted to compile the mod_watch module for apache is so I can graph vhost usage and access. Munin will then show graphs of how much a vhost is used. Also, while there are other how-to websites out there for this, they seem to drop off and disappear after a few years. | While this is more of an apache topic than a munin one, the main reason I wanted to compile the mod_watch module for apache is so I can graph vhost usage and access. Munin will then show graphs of how much a vhost is used. Also, while there are other how-to websites out there for this, they seem to drop off and disappear after a few years. | ||
Line 423: | Line 525: | ||
The main reference I used was: http:// | The main reference I used was: http:// | ||
- | ===== Compile ===== | + | |
+ | ==== Compile ==== | ||
+ | < | ||
| | ||
wget http:// | wget http:// | ||
Line 433: | Line 537: | ||
make -f Makefile.dso build | make -f Makefile.dso build | ||
make -f Makefile.dso install | make -f Makefile.dso install | ||
- | + | </ | |
- | ===== Add and config mod_watch apache module ===== | + | ==== Add and config mod_watch apache module ==== |
+ | < | ||
vi / | vi / | ||
- | < | + | #add in |
| | ||
Line 455: | Line 560: | ||
/ | / | ||
- | ===== Checking mod_watch for errors ===== | + | </ |
+ | |||
+ | ==== Checking mod_watch for errors ==== | ||
+ | < | ||
| | ||
# | # | ||
- | ===== mod_watch Errors received | + | </ |
+ | |||
+ | ==== mod_watch Errors received ==== | ||
in error.log with Debian Squeeze running 2.6.32-5-amd64 | in error.log with Debian Squeeze running 2.6.32-5-amd64 | ||
+ | < | ||
tail -f / | tail -f / | ||
- | < | + | #I noticed the following warns when I accessed any vhosts with mod_watch enabled |
| | ||
| | ||
Line 467: | Line 578: | ||
| | ||
| | ||
- | + | </ | |
- | ===== resolve mod_watch errors | + | === resolve mod_watch errors === |
Googling led me to http:// | Googling led me to http:// | ||
+ | < | ||
cd / | cd / | ||
vi SharedHash.c | vi SharedHash.c | ||
- | < | + | #on line 102 change to look like: |
| | ||
{ | { | ||
Line 480: | Line 592: | ||
return str; | return str; | ||
} | } | ||
- | So now browing | + | </ |
+ | So now browsing | ||
- | ===== Munin Plugin for Mod_Watch ===== | + | ==== Munin Plugin for Mod_Watch ==== |
+ | < | ||
cd / | cd / | ||
wget http:// | wget http:// | ||
chmod 755 apache_watch | chmod 755 apache_watch | ||
vi apache_watch | vi apache_watch | ||
- | < | + | #change my $URL = exists $ENV{' |
my $URL = exists $ENV{' | my $URL = exists $ENV{' | ||
ln -s / | ln -s / | ||
+ | </ | ||
That should do it. Once mod_watch is working and accessible munin should pick it up ok. | That should do it. Once mod_watch is working and accessible munin should pick it up ok. | ||
References: | References: | ||
- | http:// | + | * http:// |
- | http:// | + | |
- | http:// | + | |
This is a nice apache module. I'm surprised that there is no maintained similar apache module. I've seen another similar munin plugin that parses / | This is a nice apache module. I'm surprised that there is no maintained similar apache module. I've seen another similar munin plugin that parses / | ||
- | ====== Migrate Munin RRD Graphs between x32 and x64 ====== | + | ===== Migrate Munin RRD Graphs between x32 and x64 ===== |
Although not critical, on setting up a new munin server on x64 debian, I wanted to keep the existing graphs which were made on a x32 debian server. Copying across the various folders in / | Although not critical, on setting up a new munin server on x64 debian, I wanted to keep the existing graphs which were made on a x32 debian server. Copying across the various folders in / | ||
Line 507: | Line 622: | ||
The above kind person created two scripts, a dump.sh and a restore.sh that goes through all rrd files munin created and exports them out as xml files. | The above kind person created two scripts, a dump.sh and a restore.sh that goes through all rrd files munin created and exports them out as xml files. | ||
It worked nicely. | It worked nicely. | ||
+ | |||
+ | < | ||
| | ||
Line 520: | Line 637: | ||
done | done | ||
+ | </ | ||
Scp across / | Scp across / | ||
+ | < | ||
| | ||
#!/bin/bash | #!/bin/bash | ||
Line 534: | Line 653: | ||
chown munin:munin " | chown munin:munin " | ||
done | done | ||
+ | </ | ||
Code above from: http:// | Code above from: http:// |
munin_statistics.1658432619.txt.gz · Last modified: 2022/07/21 20:43 by admin