X

News, tips, partners, and perspectives for the Oracle Solaris operating system

  • Monday, March 19, 2018

One SMF Service to Monitor the Rest!

Contributed by: Thejaswini Kodavur

Have you ever wondered if there was a single service that monitors all your other services and makes administration easier? If yes then “SMF goal services”, a new feature of Oracle Solaris 11.4, is here to provide a single, unambiguous, and well-defined point where one can consider the system up and running. You can choose your customized, mission critical services and link them together into a single SMF service in one step. This SMF service is called a goal service. It can be used to monitor the health of your system upon booting up. This makes administration much easier as monitoring each of the services individually is no longer required!

There are two ways in which you can make your services part of a goal service.

1. Using the supplied Goal Service

By default Oracle Solaris 11.4 system provides you a goal service called “svc:/milestone/goals:default”. This goal service has a dependency on the service “svc:/milestone/multi-user-server:default” by default.

You can set your mission critical service to the default goal service as below:

# svcadm goals system/my-critical-service-1:default

Note: This is a set/clear interface. Therefore the above command will clear the dependency from “svc:/milestone/multi-user-server:default”.

In order to set the dependency on both the services use:

# svcadm goals svc:/milestone/multi-user-server:default \
system/my-critical-service-1:default

2. Creating you own Goal Service

Oracle Solaris 11.4 allows you to create your own goal service and set your mission critical services as dependent services. Follow the below steps to create and use a goal service.

# svcbundle -o new-gs.xml -s service-name=milestone/new-gs -s start-method=":true"
# cp new-gs.xml /lib/svc/manifest/site/new-gs.xml
# svccfg validate /lib/svc/manifest/site/new-gs.xml
# svcadm restart svc:/system/manifest-import
# svcs new-gs
   STATE        STIME FMRI
   online       6:03:36 svc:/milestone/new-gs:default
  • To make this SMF service as a goal service, set the property general/goal-service=true:
# svcadm disable svc:/milestone/new-gs:default 
# svccfg -s svc:/milestone/new-gs:default setprop general/goal-service=true
# svcadm enable svc:/milestone/new-gs:default 
  • Now you can set dependencies in the newly created goal services using the -g option as below:
# svcadm goals -g svc:/milestone/new-gs:default system/critical-service-1:default \
system/critical-service-2:default

Note: By omitting the -g option without specifying a goal service, you will set the dependency to the system provided default goal service, i.e svc:/milestone/multi-user-server:default.

  • On system boot up if one of your critical services does not come online, then the goal service will go into maintenance state.
# svcs -d milestone/new-gs
STATE            STIME FMRI
disabled         5:54:31 svc:/system/critical-service-2:default
online           Feb_19  svc:/system/critical-service-1:default
# svcs milestone/new-gs
STATE            STIME FMRI
maintenance      5:54:30 svc:/milestone/new-gs:default

Note: You can use -d option of svcs(1) to check the dependencies on your goal service.

  • Once all of the dependent services come online then your goal service will also come online. For goal services to be online, they are expected to have all their dependencies satisfied.
# svcs -d milestone/new-gs
STATE            STIME FMRI
online           Feb_19  svc:/system/critical-service-1:default
online           5:56:39 svc:/system/critical-service-2:default
# svcs milestone/new-gs
STATE            STIME FMRI
online           5:56:39 svc:/milestone/new-gs:default

Note: For more information refer to "Goal Services" in smf(7) and subcommand goal in svcadm(8).

The goal service “milestone/new-gs” is your new single SMF service with which you can monitor all of your other mission critical services!

Thus, Goals Service acts as the headquarters that monitors the rest of your services.

Be the first to comment

Comments ( 0 )
Please enter your name.Please provide a valid email address.Please enter a comment.CAPTCHA challenge response provided was incorrect. Please try again.Captcha
Oracle

Integrated Cloud Applications & Platform Services