JavaScript is required to for searching.
Skip Navigation Links
Exit Print View
Oracle Solaris Administration: Common Tasks     Oracle Solaris 11 Information Library
search filter icon
search icon

Document Information

About This Book

1.  Locating Information About Oracle Solaris Commands

2.  Managing User Accounts and Groups (Overview)

3.  Managing User Accounts and Groups (Tasks)

4.  Booting and Shutting Down an Oracle Solaris System

5.  Working With Oracle Configuration Manager

6.  Managing Services (Overview)

7.  Managing Services (Tasks)

Monitoring Services (Task Map)

Monitoring SMF Services

How to List the Status of a Service

How to List Customizations of a Service

How to Show Which Services Are Dependent on a Service Instance

How to Show Which Services a Service Is Dependent On

How to Set Up Email Notification of SMF Transition Events

Managing SMF Services (Task Map)

Managing SMF Services

Using RBAC Rights Profiles With SMF

How to Disable a Service Instance

How to Enable a Service Instance

How to Restart a Service

How to Restore a Service That Is in the Maintenance State

How to Create an SMF Profile

How to Apply an SMF Profile

Configuring SMF Services (Task Map)

Configuring SMF Services

How to Modify an SMF Service Property

How to Modify a Service That Is Configured by a File

How to Change an Environment Variable for a Service

How to Change a Property for an inetd Controlled Service

How to Delete Customizations for a Service

How to Modify a Command-Line Argument for an inetd Controlled Service

How to Convert inetd.conf Entries

Using Run Control Scripts (Task Map)

Using Run Control Scripts

How to Use a Run Control Script to Stop or Start a Legacy Service

How to Add a Run Control Script

How to Disable a Run Control Script

Troubleshooting the Service Management Facility

Debugging a Service That Is Not Starting

How to Repair a Corrupt Repository

How to Boot Without Starting Any Services

How to Force an sulogin Prompt If the system/filesystem/local:default Service Fails During Boot

8.  Using the Fault Manager

9.  Managing System Information (Tasks)

10.  Managing System Processes (Tasks)

11.  Monitoring System Performance (Tasks)

12.  Managing Software Packages (Tasks)

13.  Managing Disk Use (Tasks)

14.  Scheduling System Tasks (Tasks)

15.  Setting Up and Administering Printers by Using CUPS (Tasks)

16.  Managing the System Console, Terminal Devices, and Power Services (Tasks)

17.  Managing System Crash Information (Tasks)

18.  Managing Core Files (Tasks)

19.  Troubleshooting System and Software Problems (Tasks)

20.  Troubleshooting Miscellaneous System and Software Problems (Tasks)

Index

Monitoring SMF Services

The following tasks show how to monitor SMF services.

How to List the Status of a Service

This procedure can be used to show what services are running.

Example 7-1 Showing the Status of the sendmail Service

This example shows the status of a service that includes dependencies. Also, the -p option is used so that information about the process ID, start time and command run is displayed

$ svcs -lp network/smtp:sendmail
fmri         svc:/network/smtp:sendmail
name         sendmail SMTP mail transfer agent
enabled      true
state        online
next_state   none
state_time   Tue Aug 09 19:25:54 2011
logfile      /var/svc/log/network-smtp:sendmail.log
restarter    svc:/system/svc/restarter:default
contract_id  114
manifest     /etc/svc/profile/generic_limited_net.xml
manifest     /lib/svc/manifest/network/smtp-sendmail.xml
dependency   require_all/refresh file://localhost/etc/mail/sendmail.cf (online)
dependency   require_all/refresh file://localhost/etc/nsswitch.conf (online)
dependency   optional_all/none svc:/system/filesystem/autofs (online)
dependency   require_all/none svc:/system/filesystem/local (online)
dependency   require_all/none svc:/network/service (online)
dependency   require_all/refresh svc:/milestone/name-services (online)
dependency   optional_all/refresh svc:/system/identity:domain (online)
dependency   optional_all/none svc:/system/system-log (online)
process      101077 /usr/lib/sendmail -bd -q15m

Example 7-2 Showing the Status of all Services

The following command lists all services that are installed on the system as well as the status of each service. The command displays those services that are disabled as well as those that are enabled.

$ svcs -a

Example 7-3 Showing the Status of Services Controlled by inetd

The following command lists services that are controlled by inetd. Each service's FMRI is listed, along with the run state and whether the service is enabled or disabled.

$ inetadm

How to List Customizations of a Service

How to Show Which Services Are Dependent on a Service Instance

This procedure shows how to determine which service instances depend on the specified service.

Example 7-4 Displaying the Service Instances That Are Dependent on the multiuser Milestone

The following example shows how to determine which service instances are dependent on the multiuser milestone.

$ svcs -D milestone/multi-user
STATE          STIME    FMRI
disabled       Aug_09   svc:/application/time-slider:default
disabled       Aug_09   svc:/application/management/net-snmp:default
online         Aug_09   svc:/system/intrd:default
online         Aug_09   svc:/system/boot-config:default
online         Aug_09   svc:/milestone/multi-user-server:default

How to Show Which Services a Service Is Dependent On

This procedure shows how to determine which services a specified service instance is dependent on.

Example 7-5 Displaying the Service Instances That the multiuser Milestone Is Dependent On

The following example shows the services instances that the multiuser milestone is dependent on:

$ svcs -d milestone/multi-user:default
STATE          STIME    FMRI
disabled       Aug_09   svc:/network/nfs/client:default
disabled       Aug_09   svc:/network/smb/client:default
disabled       Aug_09   svc:/system/mdmonitor:default
disabled       Aug_09   svc:/application/print/server:default
online         Aug_09   svc:/system/resource-controls:default
online         Aug_09   svc:/system/metasync:default
online         Aug_09   svc:/system/rmtmpfiles:default
online         Aug_09   svc:/system/utmp:default
online         Aug_09   svc:/system/name-service/cache:default
online         Aug_09   svc:/system/device/audio:default
online         Aug_09   svc:/network/rpc/bind:default
online         Aug_09   svc:/milestone/name-services:default
online         Aug_09   svc:/network/iscsi/initiator:default
online         Aug_09   svc:/milestone/single-user:default
online         Aug_09   svc:/system/filesystem/local:default
online         Aug_09   svc:/network/inetd:default
online         Aug_09   svc:/system/cron:default
online         Aug_09   svc:/system/filesystem/autofs:default
online         Aug_09   svc:/system/filesystem/ufs/quota:default
online         Aug_09   svc:/system/power:default
online         Aug_09   svc:/system/system-log:default
online         Aug_09   svc:/system/system-log:default
online         Aug_09   svc:/system/auditd:default
online         Aug_09   svc:/network/smtp:sendmail

How to Set Up Email Notification of SMF Transition Events

This procedure causes the system to generate an email notification each time one of the services or a selected service has a change in state. You can choose to use either SMTP or SNMP. Normally, you would only select SNMP if you already have SNMP configured for some other reason.

By default, SNMP traps are sent on maintenance transitions. If you use SNMP for monitoring, you can configure additional traps for other state transitions.

  1. Become an administrator or assume a role that includes the Service Management rights profile.

    For more information, see How to Obtain Administrative Rights in Oracle Solaris Administration: Security Services.

  2. Set notification parameters.

    The following examples show how to set notification parameters for SMF and FMA events, as well as how to list and delete notification parameters.

Example 7-6 Configuring Notifications for All SMF Service State Events

The following command creates a notification that sends email when transactions go into the maintenance state.

# /usr/sbin/svccfg setnotify -g maintenance mailto:sysadmins@example.com

You can also choose to select transactions that start in the state listed with the from option and end in the state listed with the to option. The valid SMF states for this option are: degraded, maintenance, offline, and online. You can use the -g all option to generate email for all state transition events. See the Notification Parameters section in the smf(5) man page for more information.

Example 7-7 Configuring Notifications for an Individual Service

The following command creates a notification that sends email when the switch service goes into the online state.

# /usr/sbin/svccfg -s svc:/system/name-service/switch:default setnotify to-online \ mailto:sysadmins@example.com

Example 7-8 Configuring Notifications for FMA Events

The following command creates a notification that sends an SNMP message when a FMA problem is repaired.

# /usr/sbin/svccfg setnotify problem-repaired snmp: 

The FMA event classes include problem-diagnosed, problem-updated, problem-repaired and problem-resolved. See the Notification Parameters section in the smf(5) man page for more information.

Example 7-9 Listing Notification Settings

The following command shows the notification settings for a new problem diagnosed by the FMA service. Notification settings for SMF service state transition events can be displayed by including the service state instead of the event class or by not including any arguments with listnotify.

# /usr/sbin/svccfg listnotify problem-diagnosed

Example 7-10 Deleting Notification Settings

The following command deletes the notification settings associated with the switch service transitioning to the online service state. You can use an FMA event class in place of the service state.

# /usr/sbin/svccfg -s svc:/system/name-service/switch:default delnotify to-online