Intorduction to Munin monitoring tool and extending it with PHP
This is a quick introduction to http://munin-monitoring.org/ monitoring tool. To make it little bit more interesting I decided to step outside of my comfort zone and record a video instead of posting plane text.
Enjoy watching!
Hello_world extension
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
#!/usr/bin/php <?php if( isset( $_SERVER['argv'][1] ) && $_SERVER['argv'][1] == 'config' ) { ?> graph_title Hello World! graph_vlabel important value graph_total total rn1.label First random number rn2.label Second random number <?php exit(0); } printf( "rn1.value %s\n", rand(0,100) ); printf( "rn2.value %s\n", rand(0,100) ); |
If you need a VirtualHost configuration you can use the one below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
<VirtualHost *:80> ServerName 192.168.0.7 DocumentRoot /var/www/html/munin ErrorLog /var/log/httpd/munin-error.log CustomLog /var/log/httpd/munin-access.log combined <Directory /var/cache/munin/www> Order allow,deny Allow from All Options None AuthUserFile /etc/munin/munin-htpasswd AuthName "Munin" AuthType Basic require valid-user <IfModule mod_expires.c> ExpiresActive On ExpiresDefault M310 </IfModule> </Directory> </VirtualHost > |