server-xml.pl revision 5d52a1fe1b8ea396fb5ae7f6f1567c8383445113
d49d75f5073294d798aa500728116309398bb535Andreas Gustafsson#!/usr/bin/perl
d49d75f5073294d798aa500728116309398bb535Andreas Gustafsson#
bf8267aa453e5d2a735ed732a043b77a0b355b20Mark Andrews# Copyright (C) 2015-2017 Internet Systems Consortium, Inc. ("ISC")
bf8267aa453e5d2a735ed732a043b77a0b355b20Mark Andrews#
bf8267aa453e5d2a735ed732a043b77a0b355b20Mark Andrews# This Source Code Form is subject to the terms of the Mozilla Public
bf8267aa453e5d2a735ed732a043b77a0b355b20Mark Andrews# License, v. 2.0. If a copy of the MPL was not distributed with this
bf8267aa453e5d2a735ed732a043b77a0b355b20Mark Andrews# file, You can obtain one at http://mozilla.org/MPL/2.0/.
bf8267aa453e5d2a735ed732a043b77a0b355b20Mark Andrews
bf8267aa453e5d2a735ed732a043b77a0b355b20Mark Andrews# server-xml.pl:
bf8267aa453e5d2a735ed732a043b77a0b355b20Mark Andrews# Parses the XML version of the server stats into a normalized format.
bf8267aa453e5d2a735ed732a043b77a0b355b20Mark Andrews
bf8267aa453e5d2a735ed732a043b77a0b355b20Mark Andrewsuse XML::Simple;
bf8267aa453e5d2a735ed732a043b77a0b355b20Mark Andrews
bf8267aa453e5d2a735ed732a043b77a0b355b20Mark Andrewsmy $ref = XMLin("xml.stats");
bf8267aa453e5d2a735ed732a043b77a0b355b20Mark Andrewsmy $counters = $ref->{server}->{counters};
bf8267aa453e5d2a735ed732a043b77a0b355b20Mark Andrewsforeach $group (@$counters) {
d49d75f5073294d798aa500728116309398bb535Andreas Gustafsson foreach $key (keys %{$group->{counter}}) {
ea94d370123a5892f6c47a97f21d1b28d44bb168Tinderbox User print $group->{type} . " " . $key . ": ". $group->{counter}->{$key}->{content} . "\n";
d49d75f5073294d798aa500728116309398bb535Andreas Gustafsson }
d49d75f5073294d798aa500728116309398bb535Andreas Gustafsson}
d49d75f5073294d798aa500728116309398bb535Andreas Gustafsson