mirror of
https://github.com/Yubico/yubikey-val.git
synced 2025-03-04 12:29:19 +01:00
Modify ykval-munin-queuelength plugin.
- use host (and port if any) for graph title.
This commit is contained in:
parent
d6d4e3e58a
commit
0fdff26403
@ -37,19 +37,8 @@ set_include_path(implode(PATH_SEPARATOR, array(
|
|||||||
require_once 'ykval-config.php';
|
require_once 'ykval-config.php';
|
||||||
require_once 'ykval-db.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__'];
|
$urls = $baseParams['__YKVAL_SYNC_POOL__'];
|
||||||
$shortnames = array_map("url2shortname", $urls);
|
$shortnames = array_map("short_name", $urls);
|
||||||
|
|
||||||
if ($argc == 2 && strcmp($argv[1], "autoconf") == 0)
|
if ($argc == 2 && strcmp($argv[1], "autoconf") == 0)
|
||||||
{
|
{
|
||||||
@ -95,7 +84,7 @@ foreach ($shortnames as $shortname)
|
|||||||
|
|
||||||
foreach ($r as $result)
|
foreach ($r as $result)
|
||||||
{
|
{
|
||||||
if (strpos($result['server'], "$shortname.") !== FALSE)
|
if (short_name($result['server']) === $shortname)
|
||||||
{
|
{
|
||||||
$count = $result['count'];
|
$count = $result['count'];
|
||||||
break;
|
break;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user