在 Oracle® Solaris 11.2 中管理系统服务

退出打印视图

更新时间: 2014 年 7 月
 
 

显示事件通知参数

svcs -n 命令显示 FMA 事件通知参数、系统范围的 SMF 状态转换通知参数和服务实例状态转换通知参数。有关这些参数的信息,请参见 smf(5) 手册页中的“通知参数”。

$ svcs -n
Notification parameters for FMA Events
    Event: problem-diagnosed
        Notification Type: smtp
            Active: true
            reply-to: root@localhost
            to: root@localhost

        Notification Type: snmp
            Active: true

        Notification Type: syslog
            Active: true

    Event: problem-repaired
        Notification Type: snmp
            Active: true

    Event: problem-resolved
        Notification Type: snmp
            Active: true

System wide notification parameters:
svc:/system/svc/global:default:
    Event: to-maintenance
        Notification Type: smtp
            Active: true
            to: sysadmins@example.com

svc:/application/pkg/mirror:default:
    Event: to-maintenance
        Notification Type: smtp
            Active: true
            to: installteam@example.com

显示三种 FMA 事件:problem-diagnosedproblem-repairedproblem-resolved。还可以针对第四种事件 (problem-updated) 配置通知参数。

对于系统范围的状态转换通知设置,还会列出存储这些全局设置的服务。此系统范围的设置为定制设置。系统范围或全局类型的值适用于未设置定制值的所有服务实例。

显示的最后一条设置是特定服务实例的定制设置。

使用 svccfg listnotify 命令仅显示指定事件的通知参数。对于状态转换事件,请使用 -g 选项显示全局设置。输出还显示通知参数值的来源。

$ svccfg listnotify problem-resolved
    Event: problem-resolved (source: svc:/system/fm/notify-params:default)
        Notification Type: snmp
            Active: true
$ svccfg listnotify -g to-maintenance
    Event: to-maintenance (source: svc:/system/svc/global:default)
        Notification Type: smtp
            Active: true
            to: sysadmins@example.com
$ svccfg -s pkg/mirror listnotify to-maintenance
    Event: to-maintenance (source: svc:/application/pkg/mirror)
        Notification Type: smtp
            Active: true
            to: installteam@example.com

有关配置事件通知的信息,请参见配置状态转换和 FMA 事件的通知