[Spacewalk-list] Checking osad status from client side

Matthew Madey mattmadey at gmail.com
Thu May 22 17:31:40 UTC 2014


Well, as far as the client side goes, I think the best you can get is to
write a script that checks for specific output in /var/log/osad, but to get
any useful data, you need to increase the verbosity of debugging in
/etc/sysconfig/osad.conf

I run a report daily for all systems in my Spacewalk environment, which
dumps out the hostnames and OSAD status of everything registered into a csv
file, which I feed in to a dashboard. It's a simple python script but might
provide the information you're looking for. It uses the API getDetails
method which has an entry for osad_status in the array. As the last person
said, monitoring last ping requests would be rather difficult.. but you
could enable more logging on /etc/init.d/jabberd and have it write debug
logs to /var/lib/jabberd/log. These logs grow tremendously if you have more
than 1000 systems registered however.. so use caution.. jabber is a very
chatty protocol.



Here is the script I use to dump osad status for all my clients:


#!/usr/bin/python

import xmlrpclib
import os
import sys
import ConfigParser

cfg_file="/etc/rhn/rhn-api-user.conf"
config = ConfigParser.ConfigParser()
try:
    config.read (cfg_file)
except:
    print "Could not read config file %s." % cfg_file
    sys.exit(1)
try:
    spw_server = config.get ('Spacewalk', 'spw_server')
    spw_user = config.get ('Spacewalk', 'spw_user')
    spw_pass = config.get ('Spacewalk', 'spw_pass')
except:
    print "The file %s seems not to be a valid config file." %
options.cfg_file
    sys.exit(1)


SATELLITE_URL = "http://{0}/rpc/api".format(spw_server)
SATELLITE_LOGIN = spw_user
SATELLITE_PASSWORD = spw_pass
client = xmlrpclib.Server(SATELLITE_URL, verbose=0)
key = client.auth.login(SATELLITE_LOGIN, SATELLITE_PASSWORD)

print "hostname,status"
systems = client.system.listSystems(key)
for system in systems:
        hostname = system['name']
        id = system['id']
        details = client.system.getDetails(key, id)
        status = details['osa_status']
        print "%s,%s" % (hostname, status)

client.auth.logout(key)




On Wed, May 21, 2014 at 4:27 AM, Milan Zázrivec <mzazrivec at redhat.com>wrote:

> On Thursday 10 April 2014 11:34:41 Innes, Duncan wrote:
> > Hi folks,
> >
> > Is there a way of checking the connectivity status of osad from the
> > client side?  I know I can query the Satellite to show the OSA Status of
> > each client, but am wondering about being able to do this on the client
> > side so that (for example) a Nagios check can be built for all RHEL
> > systems.
> >
> > I think I need something more refined than just "service osad status".
> > Something that shows the last ping request from osa-dispatcher that the
> > client successfully responded to perhaps?
>
> Monitoring the success of ping requests -- long shot. Not quite sure how
> you'd go about this really.
>
> You can monitor the network connection between osad and c2s on your
> Spacewalk / Spacewalk proxy or you can be periodically scheduling a remote
> command on your clients and monitoring the results (a time stamp of
> a file created on the client for example).
>
> -MZ
>
> _______________________________________________
> Spacewalk-list mailing list
> Spacewalk-list at redhat.com
> https://www.redhat.com/mailman/listinfo/spacewalk-list
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/spacewalk-list/attachments/20140522/4d5fe7e1/attachment.htm>


More information about the Spacewalk-list mailing list