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
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
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
# -*- 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")
def main(): global_config = configfile.get_global_config( process_tools.get_programm_name(), single_process_mode=True) MainProcess(global_config).loop() return 0
# Copyright (C) 2013,2016-2017 Andreas Lang-Nevyjel, init.at # # this file is part of icsw-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)