mirror of
https://github.com/Yubico/yubikey-val.git
synced 2025-01-20 10:52:15 +01:00
Add ykval-munin-queuelength.php.
This commit is contained in:
parent
e8713d873e
commit
7363cb54c3
1
Makefile
1
Makefile
@ -35,6 +35,7 @@ install:
|
||||
install -D ykval-import.php $(sbinprefix)/ykval-import
|
||||
install -D ykval-checksum-clients.php $(sbinprefix)/ykval-checksum-clients
|
||||
install -D ykval-munin-ksmlatency.php $(muninprefix)/ykval_ksmlatency
|
||||
install -D ykval-munin-queuelength.php $(muninprefix)/ykval_queuelength
|
||||
install -D --backup --mode 640 --group $(wwwgroup) ykval-config.php $(etcprefix)/ykval-config.php-template
|
||||
install -D ykval-db.sql $(docprefix)/ykval-db.sql
|
||||
install -D $(DOCS) $(docprefix)/
|
||||
|
36
ykval-munin-queuelength.php
Executable file
36
ykval-munin-queuelength.php
Executable file
@ -0,0 +1,36 @@
|
||||
#!/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');
|
||||
$sync->addField('ip', $_SERVER['REMOTE_ADDR']);
|
||||
|
||||
$len = $sync->getQueueLength ();
|
||||
echo "queuelength.value $len\n";
|
||||
|
||||
#%# family=auto
|
||||
#%# capabilities=autoconf
|
||||
?>
|
Loading…
x
Reference in New Issue
Block a user