#
# CDDL HEADER START
#
# The contents of this file are subject to the terms of the
# Common Development and Distribution License (the "License").
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
# See the License for the specific language governing permissions
# and limitations under the License.
#
# When distributing Covered Code, include this CDDL HEADER in each
# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
# If applicable, add the following below this CDDL HEADER, with the
# fields enclosed by brackets "[]" replaced with your own identifying
# information: Portions Copyright [yyyy] [name of copyright owner]
#
# CDDL HEADER END
#
#
#
""" A thin wrapper around the kstats support provided by rad """
import os
"""
Given a list of kstat_named, returns a dictionary of its stats
indexed by name.
"""
class Kstats:
""" Represents the system's kstats """
if conn is None:
else:
try:
except:
pass
return None
def connect_private():
"""
Create a connection to a private (piped) minimalist (kstat module
only) RAD instance.
Returns:
rad.client.RadConnection: the private connection
"""
"""
Look up a single kstat instance by module, name, and instance.
"""
clazz = None):
"""
Retrieve a list of kstat instances, filtered by optional module, name,
and instance.
"""
if module is not None:
if name is not None:
if instance is not None:
if clazz is not None:
# Enumeration and lookup can race; silently drop failures
return filter (lambda x : x is not None,
""" Call update() on the singleton control instance """
""" Close the connection to the RAD server """