Révision ece1c2b0
[http_load_] Default to Multigraph
| plugins/http/http_load_ | ||
|---|---|---|
| 18 | 18 |
# |
| 19 | 19 |
# Author: Espen Braastad / Linpro AS |
| 20 | 20 |
# espen@linpro.no |
| 21 |
# Olivier Mehani (multigraph support) |
|
| 22 |
# shtrom+munin@ssji.net |
|
| 21 | 23 |
# |
| 22 | 24 |
##### Short usage guide: ##### |
| 23 | 25 |
# |
| ... | ... | |
| 47 | 49 |
# sudo -u <user> /usr/share/munin/plugins/http_load_ cron verbose |
| 48 | 50 |
# |
| 49 | 51 |
# 4. Run munin-node-configure --suggest --shell and run the symlink |
| 50 |
# commands manually to update the munin-node plugin list. You should |
|
| 51 |
# ignore the _multi suggestion unless you want to use the multigraph |
|
| 52 |
# mode (see below), in which case you should only create the _multi |
|
| 53 |
# symlinks. |
|
| 54 |
# |
|
| 52 |
# commands manually to update the munin-node plugin list.xi |
|
| 53 |
# |
|
| 55 | 54 |
# (5. If you want to change the filter which the plugin uses to select which |
| 56 | 55 |
# tags to follow in a web page, edit the subroutine called "filter" below.) |
| 57 | 56 |
# |
| ... | ... | |
| 73 | 72 |
# |
| 74 | 73 |
# 4. /etc/init.d/munin-node restart |
| 75 | 74 |
# |
| 76 |
# Multigraph support
|
|
| 75 |
# Single graph support
|
|
| 77 | 76 |
# |
| 78 |
# The default behaviour is to output one full graph per metric. This |
|
| 79 |
# plugin also supports a multigraph mode, which only outputs one graph |
|
| 80 |
# type on the summary # page, and create a separate page with all the |
|
| 81 |
# others. |
|
| 77 |
# The default behaviour is the multigraph mode: only the loadtime will be shown |
|
| 78 |
# on the Munin summary page. The graphs there are linked to a second-level |
|
| 79 |
# summary page that list all other metrics. It is also possible to create |
|
| 80 |
# single graphs, that would show immediately on the summary page, by using |
|
| 81 |
# symlinks with a different name, postfixed with the name of the metric: |
|
| 82 |
# * http_load_hostname: multigraph (default) |
|
| 83 |
# * http_load_hostname_loadtime: loadtime only |
|
| 84 |
# * http_load_hostname_size: total page size |
|
| 85 |
# * http_load_hostname_response: response code |
|
| 86 |
# * http_load_hostname_tags: HTML tags summary |
|
| 87 |
# * http_load_hostname_type: Content-Types |
|
| 88 |
# * http_load_hostname_elements: source site of the loaded elements |
|
| 82 | 89 |
# |
| 83 |
# This mode is enabled by only creating the _multi symlink, suggested
|
|
| 84 |
# by munin-node-configure.
|
|
| 90 |
# Note that hostname is not the FQDN of the host, but rather the one given when
|
|
| 91 |
# running munin-node-configure --suggest --shell and run the symlink
|
|
| 85 | 92 |
# |
| 86 | 93 |
##### |
| 87 | 94 |
# |
| ... | ... | |
| 564 | 571 |
# Y: The type of graph (elements, size, loadtime, ..) |
| 565 | 572 |
|
| 566 | 573 |
my ($id,$type); |
| 567 |
$0 =~ /http_load(?:_([^_]+)|)_(.+)\s*$/;
|
|
| 574 |
$0 =~ /http_load(?:_([^_]+)|)(_(.+))?\s*$/;
|
|
| 568 | 575 |
$id = $1; |
| 569 |
$type = $2; |
|
| 576 |
$type = $3; |
|
| 577 |
|
|
| 578 |
if($type eq "") {
|
|
| 579 |
$type = "multi"; |
|
| 580 |
} |
|
| 570 | 581 |
|
| 571 | 582 |
$debug && print "Id: $id, Type: $type\n"; |
| 572 | 583 |
|
| ... | ... | |
| 585 | 596 |
my %urls=&read_urls($url_file); |
| 586 | 597 |
while ( my ($id, $url) = each(%urls) ) {
|
| 587 | 598 |
$debug && print "id: $id => url: $url\n"; |
| 588 |
print $id . "_size\n"; |
|
| 589 |
print $id . "_loadtime\n"; |
|
| 590 |
print $id . "_response\n"; |
|
| 591 |
print $id . "_tags\n"; |
|
| 592 |
print $id . "_type\n"; |
|
| 593 |
print $id . "_elements\n"; |
|
| 594 |
print $id . "_multi\n"; |
|
| 599 |
print $id . "\n"; |
|
| 595 | 600 |
} |
| 596 | 601 |
exit(0); |
| 597 | 602 |
|
Formats disponibles : Unified diff