1
0
Fork 0
mirror of https://github.com/munin-monitoring/contrib.git synced 2025-07-22 02:51:03 +00:00

[http_load_] Default to Multigraph

This commit is contained in:
Olivier Mehani 2017-06-18 20:55:38 +10:00
parent 3216a70b13
commit ece1c2b024

View file

@ -18,6 +18,8 @@
# #
# Author: Espen Braastad / Linpro AS # Author: Espen Braastad / Linpro AS
# espen@linpro.no # espen@linpro.no
# Olivier Mehani (multigraph support)
# shtrom+munin@ssji.net
# #
##### Short usage guide: ##### ##### Short usage guide: #####
# #
@ -47,10 +49,7 @@
# sudo -u <user> /usr/share/munin/plugins/http_load_ cron verbose # sudo -u <user> /usr/share/munin/plugins/http_load_ cron verbose
# #
# 4. Run munin-node-configure --suggest --shell and run the symlink # 4. Run munin-node-configure --suggest --shell and run the symlink
# commands manually to update the munin-node plugin list. You should # commands manually to update the munin-node plugin list.xi
# ignore the _multi suggestion unless you want to use the multigraph
# mode (see below), in which case you should only create the _multi
# symlinks.
# #
# (5. If you want to change the filter which the plugin uses to select which # (5. If you want to change the filter which the plugin uses to select which
# tags to follow in a web page, edit the subroutine called "filter" below.) # tags to follow in a web page, edit the subroutine called "filter" below.)
@ -73,15 +72,23 @@
# #
# 4. /etc/init.d/munin-node restart # 4. /etc/init.d/munin-node restart
# #
# Multigraph support # Single graph support
# #
# The default behaviour is to output one full graph per metric. This # The default behaviour is the multigraph mode: only the loadtime will be shown
# plugin also supports a multigraph mode, which only outputs one graph # on the Munin summary page. The graphs there are linked to a second-level
# type on the summary # page, and create a separate page with all the # summary page that list all other metrics. It is also possible to create
# others. # single graphs, that would show immediately on the summary page, by using
# symlinks with a different name, postfixed with the name of the metric:
# * http_load_hostname: multigraph (default)
# * http_load_hostname_loadtime: loadtime only
# * http_load_hostname_size: total page size
# * http_load_hostname_response: response code
# * http_load_hostname_tags: HTML tags summary
# * http_load_hostname_type: Content-Types
# * http_load_hostname_elements: source site of the loaded elements
# #
# This mode is enabled by only creating the _multi symlink, suggested # Note that hostname is not the FQDN of the host, but rather the one given when
# by munin-node-configure. # running munin-node-configure --suggest --shell and run the symlink
# #
##### #####
# #
@ -564,9 +571,13 @@ $debug && print "Scriptname: " . $scriptname . "\n";
# Y: The type of graph (elements, size, loadtime, ..) # Y: The type of graph (elements, size, loadtime, ..)
my ($id,$type); my ($id,$type);
$0 =~ /http_load(?:_([^_]+)|)_(.+)\s*$/; $0 =~ /http_load(?:_([^_]+)|)(_(.+))?\s*$/;
$id = $1; $id = $1;
$type = $2; $type = $3;
if($type eq "") {
$type = "multi";
}
$debug && print "Id: $id, Type: $type\n"; $debug && print "Id: $id, Type: $type\n";
@ -585,13 +596,7 @@ if($ARGV[0] and $ARGV[0] eq "autoconf") {
my %urls=&read_urls($url_file); my %urls=&read_urls($url_file);
while ( my ($id, $url) = each(%urls) ) { while ( my ($id, $url) = each(%urls) ) {
$debug && print "id: $id => url: $url\n"; $debug && print "id: $id => url: $url\n";
print $id . "_size\n"; print $id . "\n";
print $id . "_loadtime\n";
print $id . "_response\n";
print $id . "_tags\n";
print $id . "_type\n";
print $id . "_elements\n";
print $id . "_multi\n";
} }
exit(0); exit(0);