munin interview questions
Top munin frequently asked interview questions
I want to use munin to collect system stats and save it in database. But I could not find any way to get the raw stats munin collects. Is there any way to get that raw data munin collects and with which it creates graph ?
Source: (StackOverflow)
According to the plugin:
The following environment variables are used
ping_args - Arguments to ping (default "-c 2")
ping_args2 - Arguments after the host name (required for Solaris)
ping - Ping program to use
host - Host to ping
Configuration example
[multiping]
env.host www.example.org mail.example.org
where do i specify the [multiping]
Source: (StackOverflow)
I have installed munin and munin-node on my monitoring server and installed munin-node on my mongodb server, I have set them both up and all is working great. But, the mongodb plugins aren't showing on my monitoring server. I see the node listed and "Disk, Network, Processes, System", but not the mongo stuff. If I execute one of the plugins directly on the mongo server "python /usr/share/munin/plugins/mongo_btree" it returns output, but nothing shows on the monitoring server.
Source: (StackOverflow)
The default update interval in Munin is 5 minutes which is OK for most purposes.
For some cases though 5 minutes is too frequent, useless and sometimes increases load of the servers being watched.
For example, I want to graph database sizes once every day and I have plugins written for that. But sampling every 5 minutes could be costly in terms of performance.
So, is it possible to configure Munin for specific graphs to update every day or every hour instead of every 5 minutes?
Source: (StackOverflow)
I will like to munin to graph after every two minutes to increase the granularity. There are some links pointing out that its somehow possible with munin 2.0 , any idea how?
Source: (StackOverflow)
On a fresh apache and munin server install when I to to domain.com/munin I get this error.
Forbidden
You don't have permission to access /munin on this server.
for these directories I did a chown -R munin:munin
dbdir /var/lib/munin
htmldir /var/cache/munin/www
logdir /var/log/munin
rundir /var/run/munin
What am I supposed to do with apache? I restated apache with /etc/init.d/apache restart but still get forbidden. I have made no changes to the apache config files from a fresh apache install.
Source: (StackOverflow)
I am trying to figure out a situation where PHP is not consuming a lot of memory but instead causes a very high Committed_AS
result.
Take this munin memory report for example:
As soon as I kick off our Laravel queue (10 ~ 30 workers), committed memory goes through the roof. We have 2G mem + 2G swap on this vps instance and so far there are about 600M unused memory (that's about 30% free).
If I understand Committed_AS
correctly, it's meant to be a 99.9% guarantee no out of memory
issue given current workload, and it seems to suggest we need to triple our vps memory just to be safe.
I tried to reduce the number of queues from 30 to around 10, but as you can see the green line is quite high.
As for the setup: Laravel 4.1 with PHP 5.5 opcache enabled. The upstart script we use spawn instance like following:
instance $N
exec start-stop-daemon --start --make-pidfile --pidfile /var/run/laravel_queue.$N.pid --chuid $USER --chdir $HOME --exec /usr/bin/php artisan queue:listen -- --queue=$N --timeout=60 --delay=120 --sleep=30 --memory=32 --tries=3 >> /var/log/laravel_queue.$N.log 2>&1
I have seen a lot of cases when high swap use imply insufficient memory, but our swap usage is low, so I am not sure what troubleshooting step is appropriate here.
PS: we don't have this problem prior to Laravel 4.1 and our vps upgrade, here is an image to prove that.
Maybe I should rephrase my question as: how are Committed_AS calculated exactly and how does PHP factor into it?
Updated 2014.1.29:
I had a theory on this problem: since laravel queue worker actually use PHP sleep()
when waiting for new job from queue (in my case beanstalkd
), it would suggest the high Committed_AS
estimation is due to the relatively low workload and relatively high memory consumption.
This make sense as I see Committed_AS
~= avg. memory usage / avg. workload
. As PHP sleep()
properly, little to no CPU are used; yet whatever memory it consumes is still reserved. Which result in server thinking: hey, you use so much memory (on average) even when load is minimal (on average), you should be better prepared for higher load (but in this case, higher load doesn't result in higher memory footprint)
If anyone would like to test this theory, I will be happy to award the bounty to them.
Source: (StackOverflow)
Tell me please, how does configuration Munin, that would monitoring by hours.
I have configuration by day, by weeks but I don't know how configuration Munin by hours.
Thanks.
Source: (StackOverflow)
I recently installed Munin on my machines. I got everything to work and the data is actually being drawn on the graphs! :)
But, for some reason, when I click on each individual graph, it brings me to the dynazoom page but it's all plain text with no images :(
Here is my apache.conf:
# Enable this for template generation
Alias /munin /var/cache/munin/www
# Enable this for cgi-based templates
#Alias /munin-cgi/static /var/cache/munin/www/static
#ScriptAlias /munin-cgi /usr/lib/munin/cgi/munin-cgi-html
#<Location /munin-cgi>
# Order allow,deny
# Allow from localhost 127.0.0.0/8 ::1
# AuthUserFile /etc/munin/munin-htpasswd
# AuthName "Munin"
# AuthType Basic
# require valid-user
#</Location>
<Directory /var/cache/munin/www>
Order allow,deny
# Allow from localhost 127.0.0.0/8 ::1
Allow from all
Options None
AllowOverride None
# This file can be used as a .htaccess file, or a part of your apache
# config file.
#
# For the .htaccess file option to work the munin www directory
# (/var/cache/munin/www) must have "AllowOverride all" or something
# close to that set.
#
AuthUserFile /etc/munin/munin-htpasswd
AuthName "Munin"
AuthType Basic
require valid-user
# This next part requires mod_expires to be enabled.
#
# Set the default expiration time for files to 5 minutes 10 seconds from
# their creation (modification) time. There are probably new files by
# that time.
#
<IfModule mod_expires.c>
ExpiresActive On
ExpiresDefault M310
</IfModule>
</Directory>
# Enables fastcgi for munin-cgi-html if present
#<Location /munin-cgi>
# <IfModule mod_fastcgi.c>
# SetHandler fastcgi-script
# </IfModule>
#</Location>
#<Location /munin-cgi/static>
# SetHandler None
#</Location>
# Enables fastcgi for munin-cgi-graph if present
ScriptAlias /munin-cgi/munin-cgi-graph /usr/lib/munin/cgi/munin-cgi-graph
<Location /munin-cgi/munin-cgi-graph>
Order allow,deny
Allow from localhost 127.0.0.0/8 ::1
# AuthUserFile /etc/munin/munin-htpasswd
# AuthName "Munin"
# AuthType Basic
# require valid-user
<IfModule mod_fcgid.c>
SetHandler fcgid-script
</IfModule>
<IfModule !mod_fcgid.c>
SetHandler cgi-script
</IfModule>
</Location>
ScriptAlias /munin-cgi/munin-cgi-html /usr/lib/munin/cgi/munin-cgi-html
<Location /munin-cgi/munin-cgi-html>
Order allow,deny
Allow from localhost 127.0.0.0/8 ::1
# AuthUserFile /etc/munin/munin-htpasswd
# AuthName "Munin"
# AuthType Basic
# require valid-user
<IfModule mod_fcgid.c>
SetHandler fcgid-script
</IfModule>
<IfModule !mod_fcgid.c>
SetHandler cgi-script
</IfModule>
</Location>
Any reason why this could not be working? If I haven't given enough information, please let me know. Thank you
Source: (StackOverflow)
I am using apache2 and munin server on Ubuntu. How do I password protect domain.com/munin with this username and password
admin/test101
Here is the location of my munin htmldir:
htmldir /var/cache/munin/www
Source: (StackOverflow)
I've got a 400+ node munin-1.4.x installation, that I'd like to upgrade to munin-2.x, to take advantage of the CGI based content generation (html & graphs) on the munin master server. I've gone through the official dox ( http://munin-monitoring.org/wiki/CgiHowto2 ), and its simply not working. It only covers a VirtualHost ( http://munin.example.com ), which is not my setup, but I tried to use it as a starting point.
Specifically, I want & need http://example.com/munin to be the base URL that dynamically generates the html content listing all the nodes, with links to the individual node pages (which are then dynamically generated/updated when clicked upon). The added catch is that I'm doing this on Fedora(16), and the vast majority of howto's that I've found assume Debian/Ubuntu (or assume non-cgi static content generation via cron).
The official Fedora munin package installs the following:
- munin base directory is /var/www/html/munin
- munin static content direcotry is /var/www/html/munin/static
- munin cgi scripts (munin-cg-graph & munin-cg-html) are in /var/www/html/munin/cgi
What I've done so far:
* set "html_strategy cgi" and "cgiurl_graph /munin/cgi/munin-cgi-html" in /etc/munin/munin.conf
* Added the following to /etc/httpd/conf/httpd.conf:
# Rewrites
RewriteEngine On
Alias /static /var/www/html/munin/static
Alias /munin /var/www/html/munin
# HTML
RewriteCond %{REQUEST_URI} !^/static
RewriteCond %{REQUEST_URI} .html$ [or]
RewriteCond %{REQUEST_URI} =/
RewriteRule ^/(.*) /var/www/html/munin/cgi/munin-cgi-html/$1 [L]
# Images
# - remove path to munin-cgi-graph, if present
RewriteRule ^/munin/cgi/munin-cgi-graph/(.*) /$1
RewriteCond %{REQUEST_URI} !^/static
RewriteCond %{REQUEST_URI} .png$
RewriteRule ^/(.*) /var/www/html/munin/cgi/munin-cgi-graph/$1 [L]
ScriptAlias /munin/cgi/munin-cgi-graph /var/www/html/munin/cgi/munin-cgi-graph
<Location /munin/cgi/munin-cgi-graph>
Options +ExecCGI FollowSymLinks
<IfModule mod_fcgid.c>
SetHandler fcgi-script
</IfModule>
<IfModule !mod_fcgid.c>
SetHandler cgi-script
</IfModule>
</Location>
ScriptAlias /munin/cgi/munin-cgi-html /var/www/html/munin/cgi/munin-cgi-html
<Location /munin/cgi/munin-cgi-html>
Options +ExecCGI FollowSymLinks
<IfModule mod_fcgid.c>
SetHandler fcgi-script
</IfModule>
<IfModule !mod_fcgid.c>
SetHandler cgi-script
</IfModule>
</Location>
However, after doing all that (and restarting apache), when I go to http://example.com/munin , I get a 404 error, and in the apache error log I see:
File does not exist: /var/www/html/munin/cgi/munin-cgi-html/munin/index.html
I'm hoping that i'm just missing something obvious, but right now I'm at a complete loss on what else might need to be adjusted to make this work. thanks.
Source: (StackOverflow)
Apologies if this is asked and answer but I've scoured the web and cannot find any info to help with this.
Basically I have Munin install on multiple centos 6.5 machines. They all work well. But the CGI graphics (when you select to view a specific chart to zoom in and stuff) do not. All we see is a broken image.
The installs are all ootb with little to no modification. There are a few errors in both Munin's and httpd's logs:
munin-cgi-graph.log:
2014/10/15 10:41:05 [PERL WARNING] Use of uninitialized value $dom in concatenation (.) or string at /var/www/cgi-bin/munin-cgi-graph line 137.
2014/10/15 10:41:05 [PERL WARNING] Use of uninitialized value $host in concatenation (.) or string at /var/www/cgi-bin/munin-cgi-graph line 137.
2014/10/15 10:41:05 [PERL WARNING] Use of uninitialized value $serv in concatenation (.) or string at /var/www/cgi-bin/munin-cgi-graph line 137.
2014/10/15 10:41:05 [PERL WARNING] Use of uninitialized value $scale in concatenation (.) or string at /var/www/cgi-bin/munin-cgi-graph line 137.
2014/10/15 10:41:05 [PERL WARNING] Use of uninitialized value $scale in pattern match (m//) at /var/www/cgi-bin/munin-cgi-graph line 139.
2014/10/15 10:41:05 [WARNING] Request for graph without specifying domain. Bailing out.
httpd error.log:
[Wed Oct 15 11:18:16 2014] [warn] [client 10.77.98.119] (104)Connection reset by peer: mod_fcgid: error reading data from FastCGI server
[Wed Oct 15 11:18:16 2014] [error] [client 10.77.98.119] Premature end of script headers: munin-cgi-graph
Status: 404 Not Found
Content-Type: image/png
X-Munin-Pid: 24520
X-Munin-Request: 0/0
Now to call out this error seems to have changed since yesterday. I did install mod_fcgid based on another forum and it still didn't work. But it seems to have changed the error.
I'm hitting a wall with this stuff sadly. I thought it would be easy (silly me!). Any help would be totally brilliant!
Cheers,
Ryu.
Source: (StackOverflow)
I've been using Munin for some days and I think it's very interesting information, but I don't understand some of the graphs, and how they can be used/read to get information to improve system.
The ones I don't understand are:
Disk
Disk throughput per device
Inode usage in percent
IOstat
Firewall Throughput
Processes
Fork rate
Number of threads
VMstat
System
Available entropy
File table usage
Individual interrupts
Inode table usage
Interrupts and context switches
Ty!
Source: (StackOverflow)
I want my munin plugin to report unknown values if the value can't be reported. What do I have to return?
- "nan"
- "-nan"
- nothing at all, just skip returning a value
- "unknown"
- ...?
Nothing works for me.
Background: ntp_offset plugin fails if ntp is not running at all. I want to return unknown value and send an alert message.
Source: (StackOverflow)
I want to use Munin to show the wave of my data. I get the data from ttyACM0, it's an Arduino UNO. I use shell script. But I got a problem, I cannot ues 'cat /dev/ttyACM0' to get the data.
Here is the problem, the programme stopped at 'cat /dev/ttyACM0',
+ . /usr/share/munin/plugins/plugin.sh
+ '[' '' = autoconf ']'
+ '[' '' = config ']'
++ cat /dev/ttyACM0
Sometimes there is another problem, it's that 'LINE = $(cat /dev/ttyACM0 | awk -F: '{print $2}')' command not found. Anyone has an idea? Thanks very much.
Here is a part of my code,
if [ "$1" = "config" ]; then
echo 'graph_title Temperature of board'
echo 'graph_args --base 1000 -l 0'
echo 'graph_vlabel temperature(°C)'
echo 'graph_category temperature'
echo 'graph_scale no'
echo 'graph_period second'
echo 'graph_info This graph shows the temperature of board'
LINE = $(cat /dev/ttyACM0 | awk -F: '{print $2}')
for i in 0 1 2 3 4; do
case $i in
1)
TYPE="Under PCB"
;;
2)
TYPE="HDD"
;;
3)
TYPE="PHY"
;;
4)
TYPE="CPU"
;;
5)
TYPE="Ambience"
;;
esac
name=$(clean_name $TYPE)
if ["$TYPE" != "NA"]; then
echo "temp_$name.label $TYPE";
fi
done
exit 0
fi
LINE = $(cat /dev/ttyACM0 | awk -F: '{print $2}')
for i in 0 1 2 3 4; do
case $i in
1)
TYPE="Under PCB"
VALUE=$(echo "$LINE" | awk '{print $1}')
;;
2)
TYPE="HDD"
VALUE=$(echo "$LINE" | awk '{print $2}')
;;
3)
TYPE="PHY"
VALUE=$(echo "$LINE" | awk '{print $3}')
;;
4)
TYPE="CPU"
VALUE=$(echo "$LINE" | awk '{print $4}')
;;
5)
TYPE="Ambience"
VALUE=$(echo "$LINE" | awk '{print $5}')
;;
esac
name=$(clean_name $TYPE)
if ["$TYPE" != "NA"]; then
echo "temp_$name.value $VALUE";
fi
done
Source: (StackOverflow)