annotate usr/src/cmd/fm/fmdump/common/error.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 f84d3cc28d24
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
1 /*
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
2 * CDDL HEADER START
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
3 *
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
4 * The contents of this file are subject to the terms of the
5609
6c18074bcfad 6514377 memory leak in fmd_event_recreate
cy152378
parents: 0
diff changeset
5 * Common Development and Distribution License (the "License").
6c18074bcfad 6514377 memory leak in fmd_event_recreate
cy152378
parents: 0
diff changeset
6 * You may not use this file except in compliance with the License.
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
7 *
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
9 * or http://www.opensolaris.org/os/licensing.
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
10 * See the License for the specific language governing permissions
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
11 * and limitations under the License.
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
12 *
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
13 * When distributing Covered Code, include this CDDL HEADER in each
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
15 * If applicable, add the following below this CDDL HEADER, with the
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
16 * fields enclosed by brackets "[]" replaced with your own identifying
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
17 * information: Portions Copyright [yyyy] [name of copyright owner]
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
18 *
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
19 * CDDL HEADER END
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
20 */
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
21 /*
12979
ab9ae749152f PSARC/2009/617 Software Events Notification Parameters CLI
Gavin Maltby <gavin.maltby@oracle.com>
parents: 9501
diff changeset
22 * Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved.
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
23 */
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
24
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
25 #include <fmdump.h>
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
26 #include <stdio.h>
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
27 #include <time.h>
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
28
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
29 /*ARGSUSED*/
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
30 static int
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
31 err_short(fmd_log_t *lp, const fmd_log_record_t *rp, FILE *fp)
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
32 {
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
33 char buf[32];
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
34
5609
6c18074bcfad 6514377 memory leak in fmd_event_recreate
cy152378
parents: 0
diff changeset
35 fmdump_printf(fp, "%-20s %-32s\n",
6c18074bcfad 6514377 memory leak in fmd_event_recreate
cy152378
parents: 0
diff changeset
36 fmdump_date(buf, sizeof (buf), rp), rp->rec_class);
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
37
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
38 return (0);
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
39 }
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
40
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
41 /*ARGSUSED*/
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
42 static int
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
43 err_verb1(fmd_log_t *lp, const fmd_log_record_t *rp, FILE *fp)
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
44 {
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
45 uint64_t ena = 0;
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
46 char buf[32];
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
47
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
48 (void) nvlist_lookup_uint64(rp->rec_nvl, FM_EREPORT_ENA, &ena);
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
49
5609
6c18074bcfad 6514377 memory leak in fmd_event_recreate
cy152378
parents: 0
diff changeset
50 fmdump_printf(fp, "%-20s %-37s 0x%016llx\n",
6c18074bcfad 6514377 memory leak in fmd_event_recreate
cy152378
parents: 0
diff changeset
51 fmdump_date(buf, sizeof (buf), rp), rp->rec_class, ena);
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
52
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
53 return (0);
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
54 }
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
55
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
56 /*ARGSUSED*/
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
57 static int
12979
ab9ae749152f PSARC/2009/617 Software Events Notification Parameters CLI
Gavin Maltby <gavin.maltby@oracle.com>
parents: 9501
diff changeset
58 err_verb23_cmn(fmd_log_t *lp, const fmd_log_record_t *rp, FILE *fp,
ab9ae749152f PSARC/2009/617 Software Events Notification Parameters CLI
Gavin Maltby <gavin.maltby@oracle.com>
parents: 9501
diff changeset
59 nvlist_prtctl_t pctl)
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
60 {
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
61 char buf[32];
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
62
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
63 fmdump_printf(fp, "%-20s.%9.9llu %s\n",
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
64 fmdump_year(buf, sizeof (buf), rp), rp->rec_nsec, rp->rec_class);
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
65
12979
ab9ae749152f PSARC/2009/617 Software Events Notification Parameters CLI
Gavin Maltby <gavin.maltby@oracle.com>
parents: 9501
diff changeset
66 if (pctl)
ab9ae749152f PSARC/2009/617 Software Events Notification Parameters CLI
Gavin Maltby <gavin.maltby@oracle.com>
parents: 9501
diff changeset
67 nvlist_prt(rp->rec_nvl, pctl);
ab9ae749152f PSARC/2009/617 Software Events Notification Parameters CLI
Gavin Maltby <gavin.maltby@oracle.com>
parents: 9501
diff changeset
68 else
ab9ae749152f PSARC/2009/617 Software Events Notification Parameters CLI
Gavin Maltby <gavin.maltby@oracle.com>
parents: 9501
diff changeset
69 nvlist_print(fp, rp->rec_nvl);
ab9ae749152f PSARC/2009/617 Software Events Notification Parameters CLI
Gavin Maltby <gavin.maltby@oracle.com>
parents: 9501
diff changeset
70
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
71 fmdump_printf(fp, "\n");
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
72 return (0);
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
73 }
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
74
12979
ab9ae749152f PSARC/2009/617 Software Events Notification Parameters CLI
Gavin Maltby <gavin.maltby@oracle.com>
parents: 9501
diff changeset
75 static int
ab9ae749152f PSARC/2009/617 Software Events Notification Parameters CLI
Gavin Maltby <gavin.maltby@oracle.com>
parents: 9501
diff changeset
76 err_verb2(fmd_log_t *lp, const fmd_log_record_t *rp, FILE *fp)
ab9ae749152f PSARC/2009/617 Software Events Notification Parameters CLI
Gavin Maltby <gavin.maltby@oracle.com>
parents: 9501
diff changeset
77 {
ab9ae749152f PSARC/2009/617 Software Events Notification Parameters CLI
Gavin Maltby <gavin.maltby@oracle.com>
parents: 9501
diff changeset
78 return (err_verb23_cmn(lp, rp, fp, NULL));
ab9ae749152f PSARC/2009/617 Software Events Notification Parameters CLI
Gavin Maltby <gavin.maltby@oracle.com>
parents: 9501
diff changeset
79 }
ab9ae749152f PSARC/2009/617 Software Events Notification Parameters CLI
Gavin Maltby <gavin.maltby@oracle.com>
parents: 9501
diff changeset
80
ab9ae749152f PSARC/2009/617 Software Events Notification Parameters CLI
Gavin Maltby <gavin.maltby@oracle.com>
parents: 9501
diff changeset
81 static int
ab9ae749152f PSARC/2009/617 Software Events Notification Parameters CLI
Gavin Maltby <gavin.maltby@oracle.com>
parents: 9501
diff changeset
82 err_pretty(fmd_log_t *lp, const fmd_log_record_t *rp, FILE *fp)
ab9ae749152f PSARC/2009/617 Software Events Notification Parameters CLI
Gavin Maltby <gavin.maltby@oracle.com>
parents: 9501
diff changeset
83 {
ab9ae749152f PSARC/2009/617 Software Events Notification Parameters CLI
Gavin Maltby <gavin.maltby@oracle.com>
parents: 9501
diff changeset
84 nvlist_prtctl_t pctl;
ab9ae749152f PSARC/2009/617 Software Events Notification Parameters CLI
Gavin Maltby <gavin.maltby@oracle.com>
parents: 9501
diff changeset
85 int rc;
ab9ae749152f PSARC/2009/617 Software Events Notification Parameters CLI
Gavin Maltby <gavin.maltby@oracle.com>
parents: 9501
diff changeset
86
ab9ae749152f PSARC/2009/617 Software Events Notification Parameters CLI
Gavin Maltby <gavin.maltby@oracle.com>
parents: 9501
diff changeset
87 if ((pctl = nvlist_prtctl_alloc()) != NULL) {
ab9ae749152f PSARC/2009/617 Software Events Notification Parameters CLI
Gavin Maltby <gavin.maltby@oracle.com>
parents: 9501
diff changeset
88 nvlist_prtctl_setdest(pctl, fp);
ab9ae749152f PSARC/2009/617 Software Events Notification Parameters CLI
Gavin Maltby <gavin.maltby@oracle.com>
parents: 9501
diff changeset
89 nvlist_prtctlop_nvlist(pctl, fmdump_render_nvlist, NULL);
ab9ae749152f PSARC/2009/617 Software Events Notification Parameters CLI
Gavin Maltby <gavin.maltby@oracle.com>
parents: 9501
diff changeset
90 }
ab9ae749152f PSARC/2009/617 Software Events Notification Parameters CLI
Gavin Maltby <gavin.maltby@oracle.com>
parents: 9501
diff changeset
91
ab9ae749152f PSARC/2009/617 Software Events Notification Parameters CLI
Gavin Maltby <gavin.maltby@oracle.com>
parents: 9501
diff changeset
92 rc = err_verb23_cmn(lp, rp, fp, pctl);
ab9ae749152f PSARC/2009/617 Software Events Notification Parameters CLI
Gavin Maltby <gavin.maltby@oracle.com>
parents: 9501
diff changeset
93
ab9ae749152f PSARC/2009/617 Software Events Notification Parameters CLI
Gavin Maltby <gavin.maltby@oracle.com>
parents: 9501
diff changeset
94 nvlist_prtctl_free(pctl);
ab9ae749152f PSARC/2009/617 Software Events Notification Parameters CLI
Gavin Maltby <gavin.maltby@oracle.com>
parents: 9501
diff changeset
95 return (rc);
ab9ae749152f PSARC/2009/617 Software Events Notification Parameters CLI
Gavin Maltby <gavin.maltby@oracle.com>
parents: 9501
diff changeset
96 }
ab9ae749152f PSARC/2009/617 Software Events Notification Parameters CLI
Gavin Maltby <gavin.maltby@oracle.com>
parents: 9501
diff changeset
97
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
98 const fmdump_ops_t fmdump_err_ops = {
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
99 "error", {
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
100 {
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
101 "TIME CLASS",
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
102 (fmd_log_rec_f *)err_short
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
103 }, {
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
104 "TIME CLASS ENA",
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
105 (fmd_log_rec_f *)err_verb1
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
106 }, {
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
107 "TIME CLASS",
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
108 (fmd_log_rec_f *)err_verb2
9501
f84d3cc28d24 PSARC 2009/265 fmdump -m
Robert Johnston <Robert.Johnston@Sun.COM>
parents: 5609
diff changeset
109 }, {
12979
ab9ae749152f PSARC/2009/617 Software Events Notification Parameters CLI
Gavin Maltby <gavin.maltby@oracle.com>
parents: 9501
diff changeset
110 "TIME CLASS",
ab9ae749152f PSARC/2009/617 Software Events Notification Parameters CLI
Gavin Maltby <gavin.maltby@oracle.com>
parents: 9501
diff changeset
111 (fmd_log_rec_f *)err_pretty
ab9ae749152f PSARC/2009/617 Software Events Notification Parameters CLI
Gavin Maltby <gavin.maltby@oracle.com>
parents: 9501
diff changeset
112 }, {
9501
f84d3cc28d24 PSARC 2009/265 fmdump -m
Robert Johnston <Robert.Johnston@Sun.COM>
parents: 5609
diff changeset
113 NULL, NULL
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
114 } }
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
115 };