comparison usr/src/cmd/fm/fmd/common/fmd_xprt.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 0c372920fdd5
children
comparison
equal deleted inserted replaced
12978:19d842faf8e4 12979:ab9ae749152f
1097 fmd_case_t *cp; 1097 fmd_case_t *cp;
1098 uint_t nelem = 0, nelem2 = 0, i; 1098 uint_t nelem = 0, nelem2 = 0, i;
1099 boolean_t injected; 1099 boolean_t injected;
1100 1100
1101 fmd_module_lock(xip->xi_queue->eq_mod); 1101 fmd_module_lock(xip->xi_queue->eq_mod);
1102 cp = fmd_case_create(xip->xi_queue->eq_mod, NULL); 1102 cp = fmd_case_create(xip->xi_queue->eq_mod, NULL, NULL);
1103 if (cp == NULL) { 1103 if (cp == NULL) {
1104 fmd_module_unlock(xip->xi_queue->eq_mod); 1104 fmd_module_unlock(xip->xi_queue->eq_mod);
1105 return; 1105 return;
1106 } 1106 }
1107 1107
1455 const fmd_xprt_rule_t *xrp; 1455 const fmd_xprt_rule_t *xrp;
1456 fmd_t *dp = &fmd; 1456 fmd_t *dp = &fmd;
1457 1457
1458 fmd_event_t *e; 1458 fmd_event_t *e;
1459 char *class, *uuid; 1459 char *class, *uuid;
1460 boolean_t isproto, isereport; 1460 boolean_t isproto, isereport, isireport, ishvireport, issysevent;
1461 1461
1462 uint64_t *tod; 1462 uint64_t *tod;
1463 uint8_t ttl; 1463 uint8_t ttl;
1464 uint_t n; 1464 uint_t n;
1465 fmd_case_t *cp; 1465 fmd_case_t *cp;
1503 } 1503 }
1504 1504
1505 fmd_dprintf(FMD_DBG_XPRT, "xprt %u %s %s\n", xip->xi_id, 1505 fmd_dprintf(FMD_DBG_XPRT, "xprt %u %s %s\n", xip->xi_id,
1506 ((logonly == FMD_B_TRUE) ? "logging" : "posting"), class); 1506 ((logonly == FMD_B_TRUE) ? "logging" : "posting"), class);
1507 1507
1508 isereport = (strncmp(class, FM_EREPORT_CLASS, 1508 isereport = (strncmp(class, FM_EREPORT_CLASS ".",
1509 sizeof (FM_EREPORT_CLASS - 1)) == 0) ? FMD_B_TRUE : FMD_B_FALSE; 1509 sizeof (FM_EREPORT_CLASS)) == 0) ? FMD_B_TRUE : FMD_B_FALSE;
1510
1511 isireport = (strncmp(class, FM_IREPORT_CLASS ".",
1512 sizeof (FM_IREPORT_CLASS)) == 0) ? FMD_B_TRUE : FMD_B_FALSE;
1513
1514 issysevent = (strncmp(class, SYSEVENT_RSRC_CLASS,
1515 sizeof (SYSEVENT_RSRC_CLASS) - 1)) == 0 ? FMD_B_TRUE : FMD_B_FALSE;
1516
1517 if (isireport) {
1518 char *pri;
1519
1520 if (nvlist_lookup_string(nvl, FM_IREPORT_PRIORITY, &pri) == 0 &&
1521 strncmp(pri, "high", 5) == 0) {
1522 ishvireport = 1;
1523 } else {
1524 ishvireport = 0;
1525 }
1526 }
1510 1527
1511 /* 1528 /*
1512 * The logonly flag should only be set for ereports. 1529 * The logonly flag should only be set for ereports.
1513 */ 1530 */
1514 if ((logonly == FMD_B_TRUE) && (isereport == FMD_B_FALSE)) { 1531 if (logonly == FMD_B_TRUE && isereport == FMD_B_FALSE) {
1515 fmd_error(EFMD_XPRT_INVAL, "discarding nvlist %p: " 1532 fmd_error(EFMD_XPRT_INVAL, "discarding nvlist %p: "
1516 "logonly flag is not valid for class %s", 1533 "logonly flag is not valid for class %s",
1517 (void *)nvl, class); 1534 (void *)nvl, class);
1518 1535
1519 (void) pthread_mutex_lock(&xip->xi_stats_lock); 1536 (void) pthread_mutex_lock(&xip->xi_stats_lock);
1603 goto done; 1620 goto done;
1604 } 1621 }
1605 } 1622 }
1606 1623
1607 /* 1624 /*
1608 * Record the event in the errlog if it is an ereport. This code will 1625 * Record ereports and ireports in the log. This code will
1609 * be replaced later with a per-transport intent log instead. 1626 * be replaced later with a per-transport intent log instead.
1610 */ 1627 */
1611 if (isereport == FMD_B_TRUE) { 1628 if (isereport == FMD_B_TRUE || isireport == FMD_B_TRUE ||
1612 (void) pthread_rwlock_rdlock(&dp->d_log_lock); 1629 issysevent == B_TRUE) {
1613 fmd_log_append(dp->d_errlog, e, NULL); 1630 pthread_rwlock_t *lockp;
1614 (void) pthread_rwlock_unlock(&dp->d_log_lock); 1631 fmd_log_t *lp;
1632
1633 if (isereport == FMD_B_TRUE) {
1634 lp = fmd.d_errlog;
1635 lockp = &fmd.d_log_lock;
1636 } else {
1637 if (ishvireport || issysevent) {
1638 lp = fmd.d_hvilog;
1639 lockp = &fmd.d_hvilog_lock;
1640 } else {
1641 lp = fmd.d_ilog;
1642 lockp = &fmd.d_ilog_lock;
1643 }
1644 }
1645
1646 (void) pthread_rwlock_rdlock(lockp);
1647 fmd_log_append(lp, e, NULL);
1648 (void) pthread_rwlock_unlock(lockp);
1615 } 1649 }
1616 1650
1617 /* 1651 /*
1618 * If a list.suspect event is received, create a case for the specified 1652 * If a list.suspect event is received, create a case for the specified
1619 * UUID in the case hash, with the transport module as its owner. 1653 * UUID in the case hash, with the transport module as its owner.