Exemple #1
0
def main():
    global_config = configfile.get_global_config(
        process_tools.get_programm_name(), single_process_mode=True)
    from initat.host_monitoring.server import ServerCode
    ret_state = ServerCode(global_config).loop()

    return ret_state
Exemple #2
0
def main(options=None):
    global_config = configfile.get_global_config(
        process_tools.get_programm_name(), single_process_mode=True)
    prog_name = global_config.name()
    if prog_name == "collclient":
        global_config.add_config_entries([
            ("IDENTITY_STRING",
             configfile.StringConfigVar(options.IDENTITY_STRING)),
            ("TIMEOUT", configfile.IntegerConfigVar(options.TIMEOUT)),
            ("COMMAND_PORT",
             configfile.IntegerConfigVar(options.COMMAND_PORT)),
            ("HOST", configfile.StringConfigVar(options.HOST)),
            ("ARGUMENTS", configfile.ArrayConfigVar(options.ARGUMENTS)),
        ])
    ret_state = run_code(prog_name, global_config)
    return ret_state
Exemple #3
0
def main():
    global_config = configfile.get_global_config(
        process_tools.get_programm_name(),
        single_process_mode=True,
    )
    ret_code = 0
    ps_file_name = "/etc/packageserver"
    if not os.path.isfile(ps_file_name):
        try:
            open(ps_file_name, "w").write("localhost\n")
        except:
            print("error writing to {}: {}".format(
                ps_file_name, process_tools.get_except_info()))
            ret_code = 5
        else:
            pass
    try:
        global_config.add_config_entries([
            ("PACKAGE_SERVER",
             configfile.StringConfigVar(
                 open(ps_file_name,
                      "r").read().strip().split("\n")[0].strip())),
            ("VERSION", configfile.StringConfigVar(VERSION_STRING)),
        ])
    except:
        print("error reading from {}: {}".format(
            ps_file_name, process_tools.get_except_info()))
        ret_code = 5
    if not ret_code:
        global_config.add_config_entries([
            ("DEBIAN",
             configfile.BoolConfigVar(os.path.isfile("/etc/debian_version")))
        ])
        run_code(global_config)
        # exit
        os._exit(0)
    return 0
Exemple #4
0
# -*- coding: utf-8 -*-
#
# Copyright (C) 2013,2015 Andreas Lang-Nevyjel
#
# Send feedback to: <*****@*****.**>
#
# This file is part of icsw-client
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License Version 3 as
# published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
#

""" SNMP-relay, config """



from initat.tools import configfile, process_tools

global_config = configfile.get_global_config(process_tools.get_programm_name())
IPC_SOCK_SNMP = process_tools.get_zmq_ipc_name("snmp", connect_to_root_instance=True, s_name="snmp-relay")
Exemple #5
0
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License Version 3 as
# published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
#
""" meta-server, config """

from initat.tools import configfile, process_tools

__all__ = [
    "global_config",
    # original sql schema version
    "INIT_SQL_SCHEMA_VERSION",
    "SQL_SCHEMA_VERSION",
]

global_config = configfile.get_global_config(process_tools.get_programm_name(),
                                             single_process_mode=True)

INIT_SQL_SCHEMA_VERSION = 1
SQL_SCHEMA_VERSION = 2
Exemple #6
0
# Copyright (C) 2013,2016 Andreas Lang-Nevyjel, init.at
#
# this file is part of cluster-server
#
# Send feedback to: <*****@*****.**>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License Version 3 as
# published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
#

from initat.tools import configfile, process_tools

# delay memcache backend until we have an unique key

global_config = configfile.get_global_config(process_tools.get_programm_name(),
                                             mc_enabled=False)
Exemple #7
0
def main():
    global_config = configfile.get_global_config(
        process_tools.get_programm_name(), single_process_mode=True)
    MainProcess(global_config).loop()
    return 0
Exemple #8
0
import shutil
import stat
import statvfs
import subprocess
import tempfile
import time

from django.db.models import Q
from lxml import etree

from initat.cluster.backbone import db_tools
from initat.cluster.backbone.models import image
from initat.cluster.backbone.server_enums import icswServiceEnum
from initat.tools import logging_tools, process_tools, threading_tools, configfile, config_tools

global_config = configfile.get_global_config("build_image")

SLASH_NAME = "SLASH"

NEEDED_PACKAGES = [
    [
        "python-init",
        "ethtool-init",
        "host-monitoring",
        "meta-server",
        "logging-server",
        "package-client",
        "loadmodules",
        "python-modules-base",
        "child",
        "modules-init",