A disabled service in SMF does nothing. It doesn't tell you that it's disabled without being asked. Well … at the end that is is the point of disabling it and the first sentence seems to be self-evident. However this is sometimes a problem. Sometimes you need to know that a services is not disabled because it’s crucial that it is running for normal operation. Or more broadly speaking, sometimes you want or need a single point to check, if all services are running that you need for your system. Out of this reason SMF goal services were introduced in Solaris 11.4 .

They are pretty easy to use: Let’s assume that you considering your system only up and running if sendmail and Apache is running on your system. You can use the build in goal service to monitor this.

As the smtp:sendmail is usually already active, I will just enable the http:apache24 service here.

root@batou:~# svcadm enable apache24

In order to configure that the goal of the system is to have svc:/network/smtp:sendmail and svc:/network/http:apache24 online, I’m using the the goals subcommand of svcs

root@batou:~# svcadm  goals svc:/network/smtp:sendmail svc:/network/http:apache24

As currently both services are up and running the goal will be in the online state as well.

root@batou:~# svcs goals
STATE          STIME      FMRI
online         19:13:55   svc:/milestone/goals:default

However as soon, as I’m disabling it, the goal service will transition into the maintenance state.

root@batou:~# svcadm disable apache24
root@batou:~# svcs goals
STATE          STIME      FMRI
maintenance    19:17:46   svc:/milestone/goals:default

This information is not just available with the SMF toolset. It propagates as well into the Fault Management Architecture (FMA):

root@batou:~# fmdump -v
March 26 19:17:47.0329 fa39821d-ef48-420a-ba23-a3d71349e816 SMF-8000-YX Diagnosed
  100%  defect.sunos.smf.svc.maintenance

        Problem in: svc:///milestone/goals:default
           Affects: svc:///milestone/goals:default
               FRU: -
      FRU Location: -

March 26 19:17:47.0388 fa39821d-ef48-420a-ba23-a3d71349e816 FMD-8000-9L Isolated
  100%  defect.sunos.smf.svc.maintenance

        Problem in: svc:///milestone/goals:default
           Affects: svc:///milestone/goals:default
               FRU: -
      FRU Location: -

Now lets’s reenable the http:apache24 service

root@batou:~# svcadm enable apache24
root@batou:~# svcs goals
STATE          STIME      FMRI
online         19:18:33   svc:/milestone/goals:default

The goal service transitions back into the online state. This transition is relayed into the FMA as well.

March 26 19:19:47.0409 fa39821d-ef48-420a-ba23-a3d71349e816 FMD-8000-4M Repaired
  100%  defect.sunos.smf.svc.maintenance        Repair Attempted

        Problem in: svc:///milestone/goals:default
           Affects: svc:///milestone/goals:default
               FRU: -
      FRU Location: -

March 26 19:19:47.0435 fa39821d-ef48-420a-ba23-a3d71349e816 FMD-8000-6U Resolved
  100%  defect.sunos.smf.svc.maintenance        Repair Attempted

        Problem in: svc:///milestone/goals:default
           Affects: svc:///milestone/goals:default
               FRU: -
      FRU Location: -

In my next blog entry i will explain how you can create your own goal services.

No comments

Add Comment

Enclosing asterisks marks text as bold (*word*), underscore are made via _word_.
Standard emoticons like :-) and ;-) are converted to images.

To prevent automated Bots from commentspamming, please enter the string you see in the image below in the appropriate input box. Your comment will only be submitted if the strings match. Please ensure that your browser supports and accepts cookies, or your comment cannot be verified correctly.
CAPTCHA