1
0
mirror of https://github.com/Yubico/yubikey-val.git synced 2024-11-29 09:24:12 +01:00
yubikey-val/ykval-munin-queuelength.php

39 lines
814 B
PHP
Raw Normal View History

2010-08-02 15:49:34 +02:00
#!/usr/bin/php
<?php
set_include_path(get_include_path() . PATH_SEPARATOR .
"/etc/ykval:/usr/share/ykval");
require_once 'ykval-synclib.php';
require_once 'ykval-config.php';
require_once 'ykval-log.php';
if ($argc==2 && strcmp($argv[1], "autoconf") == 0) {
print "yes\n";
exit (0);
}
if ($argc==2 && strcmp($argv[1], "config") == 0) {
echo "graph_title YK-VAL queue size\n";
echo "graph_vlabel sync requests in queue\n";
echo "graph_category ykval\n";
echo "queuelength.label sync requests\n";
echo "queuelength.draw AREA\n";
exit (0);
}
$sync = new SyncLib('ykval-verify:synclib');
2012-05-21 08:49:42 +02:00
if (isset($_SERVER['REMOTE_ADDR'])) {
$sync->addField('ip', $_SERVER['REMOTE_ADDR']);
}
2010-08-02 15:49:34 +02:00
$len = $sync->getQueueLength ();
echo "queuelength.value $len\n";
#%# family=auto
#%# capabilities=autoconf
?>