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
Fredrik Thulin 6b1e08eca8 Fix db-config init.
Re-order includes to get database settings set up correctly when
using Debian/Ubuntu package.
2012-05-25 10:58:52 +02:00

39 lines
814 B
PHP
Executable File

#!/usr/bin/php
<?php
set_include_path(get_include_path() . PATH_SEPARATOR .
"/etc/ykval:/usr/share/ykval");
require_once 'ykval-config.php';
require_once 'ykval-synclib.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');
if (isset($_SERVER['REMOTE_ADDR'])) {
$sync->addField('ip', $_SERVER['REMOTE_ADDR']);
}
$len = $sync->getQueueLength ();
echo "queuelength.value $len\n";
#%# family=auto
#%# capabilities=autoconf
?>