From 7d381e70f372408bb044118acf0171827c263976 Mon Sep 17 00:00:00 2001 From: Christian Weiske Date: Sat, 19 Feb 2022 06:25:34 +0100 Subject: [PATCH] [http/http_responsecode] Add support for host_name --- plugins/http/http_responsecode | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/plugins/http/http_responsecode b/plugins/http/http_responsecode index 621357d7..ff4f3f7e 100755 --- a/plugins/http/http_responsecode +++ b/plugins/http/http_responsecode @@ -13,6 +13,7 @@ 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 @@ -20,6 +21,19 @@ Configuration example 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 @@ -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"