Skip to content

Commit

Permalink
Merge pull request #1296 from cweiske/http_responsecode-host_name
Browse files Browse the repository at this point in the history
[http/http_responsecode] Add support for host_name
  • Loading branch information
sumpfralle committed Mar 9, 2022
2 parents a92de3b + 7d381e7 commit 0781145
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions plugins/http/http_responsecode
Expand Up @@ -13,13 +13,27 @@ The following environment variables are used
sites - Sites to check
max_time - Timeout for each site check - defaults to 5 seconds
host_name - To put the graph onto a different host
Configuration example
[http_responsecode]
env.sites example.com example2.de
env.max_time 5
You can display the graph on another host (e.g., the actual server) than the
one running http_responsecode.
To do so, first configure the plugin to use a different hostname.
env.host_name server
Then configure munin (in /etc/munin/munin-conf or /etc/munin/munin-conf.d), to
support a new host.
[example.net;server]
address 127.0.0.1
use_node_name no
=head1 AUTHOR
Copyright (C) 2013 Thomas Heidrich
Expand Down Expand Up @@ -53,6 +67,9 @@ if [ "$1" = "config" ]; then
echo 'graph_category network'
echo 'graph_info This graph shows HTTP response code statistics.'
echo 'graph_printf %3.0lf'
if [ -n "$host_name" ]; then
echo "host_name $host_name"
fi
for site in $sites; do
siteid=`echo $site | sed 's/[^a-z]*//g'`
echo "$siteid.label $site"
Expand Down

0 comments on commit 0781145

Please sign in to comment.