} echo "no (sync pool not configured)\n"; exit(0); } if (($endpoints = endpoints($urls)) === FALSE) { echo "Cannot parse URLs from sync pool list\n"; exit(1); } 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"; foreach ($endpoints as $endpoint) { list($internal, $label, $url) = $endpoint; echo "{$internal}_queuelength.label sync {$label}\n"; echo "{$internal}_queuelength.draw AREASTACK\n"; echo "{$internal}_queuelength.type GAUGE\n"; } exit(0); } $sync = new SyncLib('ykval-synclib:munin'); $queuelength = $sync->getQueueLengthByServer(); foreach ($endpoints as $endpoint) { list($internal, $label, $url) = $endpoint; $count = 0; if (array_key_exists($url, $queuelength)) { $count = $queuelength[$url]; } echo "{$internal}_queuelength.value {$count}\n"; } exit(0);