comparison usr/src/cmd/fm/fmtopo/common/fmtopo.c @ 12979:ab9ae749152f

PSARC/2009/617 Software Events Notification Parameters CLI PSARC/2009/618 snmp-notify: SNMP Notification Daemon for Software Events PSARC/2009/619 smtp-notify: Email Notification Daemon for Software Events PSARC/2010/225 fmd for non-global Solaris zones PSARC/2010/226 Solaris Instance UUID PSARC/2010/227 nvlist_nvflag(3NVPAIR) PSARC/2010/228 libfmevent additions PSARC/2010/257 sysevent_evc_setpropnvl and sysevent_evc_getpropnvl PSARC/2010/265 FMRI and FMA Event Stabilty, 'ireport' category 1 event class, and the 'sw' FMRI scheme PSARC/2010/278 FMA/SMF integration: instance state transitions PSARC/2010/279 Modelling panics within FMA PSARC/2010/290 logadm.conf upgrade 6392476 fmdump needs to pretty-print 6393375 userland ereport/ireport event generation interfaces 6445732 Add email notification agent for FMA and software events 6804168 RFE: Allow an efficient means to monitor SMF services status changes 6866661 scf_values_destroy(3SCF) will segfault if is passed NULL 6884709 Add snmp notification agent for FMA and software events 6884712 Add private interface to tap into libfmd_msg macro expansion capabilities 6897919 fmd to run in a non-global zone 6897937 fmd use of non-private doors is not safe 6900081 add a UUID to Solaris kernel image for use in crashdump identification 6914884 model panic events as a defect diagnosis in FMA 6944862 fmd_case_open_uuid, fmd_case_uuisresolved, fmd_nvl_create_defect 6944866 log legacy sysevents in fmd 6944867 enumerate svc scheme in topo 6944868 software-diagnosis and software-response fmd modules 6944870 model SMF maintenance state as a defect diagnosis in FMA 6944876 savecore runs in foreground for systems with zfs root and dedicated dump 6965796 Implement notification parameters for SMF state transitions and FMA events 6968287 SUN-FM-MIB.mib needs to be updated to reflect Oracle information 6972331 logadm.conf upgrade PSARC/2010/290
author Gavin Maltby <gavin.maltby@oracle.com>
date Fri, 30 Jul 2010 17:04:17 +1000
parents be69f645ce17
children
comparison
equal deleted inserted replaced
12978:19d842faf8e4 12979:ab9ae749152f
18 * 18 *
19 * CDDL HEADER END 19 * CDDL HEADER END
20 */ 20 */
21 21
22 /* 22 /*
23 * Copyright 2009 Sun Microsystems, Inc. All rights reserved. 23 * Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved.
24 * Use is subject to license terms.
25 */ 24 */
26 25
27 26
28 #include <sys/fm/protocol.h> 27 #include <sys/fm/protocol.h>
29 #include <fm/libtopo.h> 28 #include <fm/libtopo.h>
32 #include <limits.h> 31 #include <limits.h>
33 #include <strings.h> 32 #include <strings.h>
34 #include <stdio.h> 33 #include <stdio.h>
35 #include <errno.h> 34 #include <errno.h>
36 #include <umem.h> 35 #include <umem.h>
36 #include <zone.h>
37 #include <sys/param.h> 37 #include <sys/param.h>
38 38
39 #define FMTOPO_EXIT_SUCCESS 0 39 #define FMTOPO_EXIT_SUCCESS 0
40 #define FMTOPO_EXIT_ERROR 1 40 #define FMTOPO_EXIT_ERROR 1
41 #define FMTOPO_EXIT_USAGE 2 41 #define FMTOPO_EXIT_USAGE 2
958 { 958 {
959 int err; 959 int err;
960 topo_walk_t *twp; 960 topo_walk_t *twp;
961 int flag; 961 int flag;
962 962
963 if (getzoneid() != GLOBAL_ZONEID &&
964 strcmp(opt_s, FM_FMRI_SCHEME_HC) == 0) {
965 return (0);
966 }
967
963 if ((twp = topo_walk_init(thp, opt_s, walk_node, NULL, &err)) 968 if ((twp = topo_walk_init(thp, opt_s, walk_node, NULL, &err))
964 == NULL) { 969 == NULL) {
965 (void) fprintf(stderr, "%s: failed to walk %s topology:" 970 (void) fprintf(stderr, "%s: failed to walk %s topology:"
966 " %s\n", g_pname, opt_s, topo_strerror(err)); 971 " %s\n", g_pname, opt_s, topo_strerror(err));
967 972
1266 if ((uuid = topo_snap_hold(thp, NULL, &err)) == NULL) { 1271 if ((uuid = topo_snap_hold(thp, NULL, &err)) == NULL) {
1267 (void) fprintf(stderr, "%s: failed to snapshot topology: %s\n", 1272 (void) fprintf(stderr, "%s: failed to snapshot topology: %s\n",
1268 g_pname, topo_strerror(err)); 1273 g_pname, topo_strerror(err));
1269 return (fmtopo_exit(thp, uuid, FMTOPO_EXIT_ERROR)); 1274 return (fmtopo_exit(thp, uuid, FMTOPO_EXIT_ERROR));
1270 } else if (err != 0) { 1275 } else if (err != 0) {
1271 (void) fprintf(stderr, "%s: topology snapshot incomplete\n", 1276 (void) fprintf(stderr, "%s: topology snapshot incomplete%s\n",
1272 g_pname); 1277 g_pname, getzoneid() != GLOBAL_ZONEID &&
1278 strcmp(opt_s, FM_FMRI_SCHEME_HC) == 0 ?
1279 " (" FM_FMRI_SCHEME_HC " scheme does not enumerate "
1280 "in a non-global zone)": "");
1273 } 1281 }
1274 1282
1275 if (opt_x) { 1283 if (opt_x) {
1276 if (opt_b) { 1284 if (opt_b) {
1277 (void) fprintf(stderr, 1285 (void) fprintf(stderr,