Software /
code /
prosody-modules
Comparison
mod_munin/mod_munin.lua @ 1897:effd909d05b0
mod_munin: Strip mod_measure_ and mod_statistics_ from section names
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Wed, 07 Oct 2015 20:41:20 +0200 |
parent | 1692:44ddec97ad82 |
child | 1898:d85ddd3e588a |
comparison
equal
deleted
inserted
replaced
1896:777554cf1ae1 | 1897:effd909d05b0 |
---|---|
91 if host == nil then | 91 if host == nil then |
92 sect, name, typ, host = stat:match("^([^.]+)%.([^:]+):(%a+)$"); | 92 sect, name, typ, host = stat:match("^([^.]+)%.([^:]+):(%a+)$"); |
93 elseif host == "*" then | 93 elseif host == "*" then |
94 host = nil; | 94 host = nil; |
95 end | 95 end |
96 if sect:find"^mod_measure_.") then | |
97 sect = sect:sub(13); | |
98 elseif sect:find"^mod_statistics_.") then | |
99 sect = sect:sub(16); | |
100 end | |
96 key = clean_fieldname(s_format("%s_%s_%s", host or "global", sect, typ)); | 101 key = clean_fieldname(s_format("%s_%s_%s", host or "global", sect, typ)); |
97 | 102 |
98 if not meta:get(key) then | 103 if not meta:get(key) then |
99 if host then | 104 if host then |
100 meta:set(key, "", "graph_title", s_format("%s %s on %s", sect, typ, host)); | 105 meta:set(key, "", "graph_title", s_format("%s %s on %s", sect, typ, host)); |