1
0
mirror of https://github.com/Yubico/yubikey-val.git synced 2025-03-04 03:29:18 +01:00

Modify ykval-munin-queuelength plugin.

- use host (and port if any) for graph title.
This commit is contained in:
Jean Paul Galea 2015-09-08 14:40:24 +02:00
parent d6d4e3e58a
commit 0fdff26403

View File

@ -37,19 +37,8 @@ set_include_path(implode(PATH_SEPARATOR, array(
require_once 'ykval-config.php';
require_once 'ykval-db.php';
function url2shortname ($url)
{
if (preg_match("/^[^\/]+\/\/([a-z0-9-]+)/", $url, $name)==0)
{
echo "Cannot match URL hostname: " . $url . "\n";
exit(1);
}
return $name[1];
}
$urls = $baseParams['__YKVAL_SYNC_POOL__'];
$shortnames = array_map("url2shortname", $urls);
$shortnames = array_map("short_name", $urls);
if ($argc == 2 && strcmp($argv[1], "autoconf") == 0)
{
@ -95,7 +84,7 @@ foreach ($shortnames as $shortname)
foreach ($r as $result)
{
if (strpos($result['server'], "$shortname.") !== FALSE)
if (short_name($result['server']) === $shortname)
{
$count = $result['count'];
break;