Suleyman Poyraz 0788f96ae5 Fixed mixing different types ("str" and "bytes") error 4 years ago
..
examples ed72841f7e Github application kafayı yedi 6 years ago
scom 0788f96ae5 Fixed mixing different types ("str" and "bytes") error 4 years ago
README ce32cd4d86 Dosya dizin izinleri 6 years ago
setup.py b6d74eae49 Fixed dbus exception class, filemode checking enabled 6 years ago

README

SCOM API package offers modules for accessing COMAR over D-Bus without pain and
common methods/classes for SCOM scripts.

Here are some examples for accessing SCOM:

import scom
link = scom.Link()

# Localize strings
link.setLocale()

# Never use authentication agent (GUI)
link.useAgent(False)

# Get a list of packages that provide system.service method
packages = list(link.System.Service)

# Start a service
link.System.Service["kdebase"].start()

# Stop all services and ignore replies from packages.
link.System.Service.stop(quiet=True)

Asynchronous calls:

import gobject
import dbus.mainloop.glib
dbus.mainloop.glib.DBusGMainLoop(set_as_default=True)
mainloop = gobject.MainLoop()

import scom
link = scom.Link()

# Localize strings
link.setLocale()

# Use authentication agent (GUI)
link.useAgent()

# Make an asynchronous call to get service information
def handler(package, exception, result):
if exception:
print ("%s error: %s" % (package, exception))
else:
print ("%s result: %s" % (package, result))
link.System.Service.info(async=handler)

mainloop.run()

Connecting SCOM service on alternate destination:

import scom
link = scom.Link(alternate=True)

This will simply try to connect tr.org.pardus.scom2 instead
of tr.org.pardus.scom

Connecting to alternative DBus server:

import scom
link = scom.Link(socket="/mnt/target/var/run/dbus/system_bus_socket")