Xymon Mailing List Archive search

Solaris 10 SMF monitor [was RE: Ext script to monitor Solaris 10 services]

list Henrik Størner
Tue, 19 Feb 2008 14:05:32 +0100
Message-Id: <user-438cd7ed0744@xymon.invalid>

On Tue, Feb 19, 2008 at 12:36:28PM -0000, Ward, Martin wrote:
So, having scripted around a couple of issues with sh(1) 
I have written the following. You are welcome to comment 
on it or suggest improvements.

Find below bb-smf.sh
----
#!/bin/sh

# A Hobbit script to examine specific Solaris 10 services.

# Author: Martin Ward 19 Feb 2008.
# Version: 1.0 - Initial version.

# SVCS is a list of services to examine the status of. Each name must be
# enough to make it unique in the svcs list. Separate each service with
# a | so that we can use ${EGREP} to search for them.
SVCS='svc:/network/ssh:default|svc:/site/tftpd:default'
One obvious improvement would be to grab this setting from the 
Hobbit "client-local.cfg" configuration. The host-specific
client-local setting is stored by the Hobbit client in
~hobbit/client/tmp/logfetch.HOSTNAME.cfg, so assuming you
put a line like
  svc:/network/ssh:default|svc:/site/tftpd:default
in client-local.cfg (on the Hobbit server), you could grab it
using
  SVCS=`grep '^svc:' $BBTMP/logfetch.$MACHINEDOTS.cfg`
instead of hardcoding it into the script.

(Untested, but it should be rather trivial).


Regards,
Henrik