Mercurial > illumos > illumos-gate
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 |
rev | line source |
---|---|
0 | 1 /* |
2 * CDDL HEADER START | |
3 * | |
4 * The contents of this file are subject to the terms of the | |
5609 | 5 * Common Development and Distribution License (the "License"). |
6 * You may not use this file except in compliance with the License. | |
0 | 7 * |
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE | |
9 * or http://www.opensolaris.org/os/licensing. | |
10 * See the License for the specific language governing permissions | |
11 * and limitations under the License. | |
12 * | |
13 * When distributing Covered Code, include this CDDL HEADER in each | |
14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE. | |
15 * If applicable, add the following below this CDDL HEADER, with the | |
16 * fields enclosed by brackets "[]" replaced with your own identifying | |
17 * information: Portions Copyright [yyyy] [name of copyright owner] | |
18 * | |
19 * CDDL HEADER END | |
20 */ | |
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 | 23 */ |
24 | |
25 #include <fmdump.h> | |
26 #include <stdio.h> | |
27 #include <time.h> | |
28 | |
29 /*ARGSUSED*/ | |
30 static int | |
31 err_short(fmd_log_t *lp, const fmd_log_record_t *rp, FILE *fp) | |
32 { | |
33 char buf[32]; | |
34 | |
5609 | 35 fmdump_printf(fp, "%-20s %-32s\n", |
36 fmdump_date(buf, sizeof (buf), rp), rp->rec_class); | |
0 | 37 |
38 return (0); | |
39 } | |
40 | |
41 /*ARGSUSED*/ | |
42 static int | |
43 err_verb1(fmd_log_t *lp, const fmd_log_record_t *rp, FILE *fp) | |
44 { | |
45 uint64_t ena = 0; | |
46 char buf[32]; | |
47 | |
48 (void) nvlist_lookup_uint64(rp->rec_nvl, FM_EREPORT_ENA, &ena); | |
49 | |
5609 | 50 fmdump_printf(fp, "%-20s %-37s 0x%016llx\n", |
51 fmdump_date(buf, sizeof (buf), rp), rp->rec_class, ena); | |
0 | 52 |
53 return (0); | |
54 } | |
55 | |
56 /*ARGSUSED*/ | |
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 | 60 { |
61 char buf[32]; | |
62 | |
63 fmdump_printf(fp, "%-20s.%9.9llu %s\n", | |
64 fmdump_year(buf, sizeof (buf), rp), rp->rec_nsec, rp->rec_class); | |
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 | 71 fmdump_printf(fp, "\n"); |
72 return (0); | |
73 } | |
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 | 98 const fmdump_ops_t fmdump_err_ops = { |
99 "error", { | |
100 { | |
101 "TIME CLASS", | |
102 (fmd_log_rec_f *)err_short | |
103 }, { | |
104 "TIME CLASS ENA", | |
105 (fmd_log_rec_f *)err_verb1 | |
106 }, { | |
107 "TIME CLASS", | |
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 | 114 } } |
115 }; |