medstat.c revision 89901a21ad56eda0d7f06f49600bc6bec61d001d
/*
* 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
*/
/*
* Copyright 2009 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
/*
* mediator status utility.
*/
#include <meta.h>
#include <sdssc.h>
static void
char *string)
{
"usage: %s [-q] -s setname\n"),
myname);
}
/*
* parse args and do it
*/
int
main(
int argc,
char *argv[]
)
{
int c;
char *sname = MD_LOCAL_NAME;
int i;
int medok = 0;
int golden = 0;
int verbose = 1;
/*
* Get the locale set up before calling any other routines
* with messages to ouput. Just in case we're not in a build
* environment, make sure that TEXT_DOMAIN gets set to
* something.
*/
#if !defined(TEXT_DOMAIN)
#define TEXT_DOMAIN "SYS_TEST"
#endif
(void) textdomain(TEXT_DOMAIN);
/*
* There is no need to proxy the command to owner of the set
* contains the required information and so it can be used.
*/
if ((sdssc_bind_library() == SDSSC_ERROR)) {
"Failed to initialised libscsds.so.1\n");
exit(1);
}
/* initialize */
}
optind = 1;
opterr = 1;
switch (c) {
case 'q':
verbose = 0;
break;
case 's':
break;
case '?':
if (optopt == '?')
/*FALLTHROUGH*/
default:
}
}
/* must have set for everything else */
/* snarf MDDB */
if (meta_setup_db_locations(ep) != 0) {
}
}
if (verbose)
"configured for set \"%s\".\n"), sname);
}
if (verbose)
(void) printf("%8.8s\t\t%6.6s\t"
for (i = 0; i < MED_MAX_HOSTS; i++) {
continue;
if (verbose)
(void) printf("%-17.17s\t",
if (mdanyrpcerror(ep)) {
if (verbose)
(void) printf("%s\n",
gettext("Unreachable"));
continue;
if (verbose)
(void) printf("%s\n",
gettext("Bad"));
} else {
if (verbose)
(void) printf("%s\n",
gettext("Fatal"));
}
continue;
}
if (verbose)
if (verbose)
(void) printf("\t%s",
gettext("Yes"));
golden++;
} else {
if (verbose)
}
if (verbose)
(void) printf("\n");
medok++;
}
if (golden)
}
/*
* part of metaset but part of mediators.
*/
}
/* NOTREACHED */
return (0);
}